|
| 1 | +# Deployment notes |
| 2 | + |
| 3 | +MaintainerD - input data (List of Projects and associated Maintainers) |
| 4 | + |
| 5 | +## Kubernetes resources overview |
| 6 | +```mermaid |
| 7 | +graph RL |
| 8 | + subgraph maintainerd["Namespace: maintainerd"] |
| 9 | + subgraph pod["Pod"] |
| 10 | + subgraph initContainerBootstrap["initContainer: bootstrap"] |
| 11 | + bootstrap["Loads Project → Maintainer data <br>into sqlite3 database<br>from CNCF-Internal Google Sheet"] |
| 12 | + end |
| 13 | + subgraph maintainerdServer["maintainerd-server"] |
| 14 | + server["<br>GitHub WebHooks<br>labels can start on-boarding processes<br>issue comments can progress workflows<br>/healthz establishes availability by maintainerd-service."] |
| 15 | + end |
| 16 | + end |
| 17 | +
|
| 18 | + pvc[(PersistentVolumeClaim<br/>sqlite3 maintainerd-db)] |
| 19 | + svc{{Service<br/>maintainerd-service<br/>type=LoadBalancer}} |
| 20 | + svc -->|"ports 80/443"| ext[(External LB IP<br/>github-events.cncf.io/webhook)] |
| 21 | + end |
| 22 | +
|
| 23 | + bootstrap -->|"SQL INSERTs into PROJECT and MAINTAINERS tables"| pvc |
| 24 | +``` |
| 25 | + |
| 26 | + |
| 27 | + deploy -->|creates| pod |
| 28 | + deploy -->|mounts| pvc |
| 29 | + deploy -->|envFrom| secrets |
| 30 | + deploy -->|imagePullSecrets| ghcr |
| 31 | + pod -->|exposes 2525| svc |
| 32 | + svc -->|TLS| tls |
| 33 | + pod -->|volumeMount| pvc |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | +## Maintainer Database ER diagram |
| 39 | + |
| 40 | +```mermaid |
| 41 | +erDiagram |
| 42 | +companies { |
| 43 | +INTEGER id PK |
| 44 | +DATETIME created_at |
| 45 | +DATETIME updated_at |
| 46 | +DATETIME deleted_at |
| 47 | +TEXT name |
| 48 | +} |
| 49 | +
|
| 50 | + projects { |
| 51 | + INTEGER id PK |
| 52 | + DATETIME created_at |
| 53 | + DATETIME updated_at |
| 54 | + DATETIME deleted_at |
| 55 | + TEXT name |
| 56 | + INTEGER parent_project_id "FK to projects.id" |
| 57 | + TEXT maturity |
| 58 | + TEXT maintainer_ref |
| 59 | + TEXT onboarding_issue |
| 60 | + TEXT mailing_list |
| 61 | + } |
| 62 | +
|
| 63 | + services { |
| 64 | + INTEGER id PK |
| 65 | + DATETIME created_at |
| 66 | + DATETIME updated_at |
| 67 | + DATETIME deleted_at |
| 68 | + TEXT name |
| 69 | + TEXT description |
| 70 | + } |
| 71 | +
|
| 72 | + service_projects { |
| 73 | + INTEGER project_id PK "FK to projects.id" |
| 74 | + INTEGER service_id PK "FK to services.id" |
| 75 | + } |
| 76 | +
|
| 77 | + maintainers { |
| 78 | + INTEGER id PK |
| 79 | + DATETIME created_at |
| 80 | + DATETIME updated_at |
| 81 | + DATETIME deleted_at |
| 82 | + TEXT name |
| 83 | + TEXT email |
| 84 | + TEXT git_hub_account |
| 85 | + TEXT git_hub_email |
| 86 | + TEXT maintainer_status |
| 87 | + TEXT import_warnings |
| 88 | + DATETIME registered_at |
| 89 | + INTEGER company_id "FK to companies.id" |
| 90 | + } |
| 91 | +
|
| 92 | + maintainer_projects { |
| 93 | + INTEGER maintainer_id PK "FK to maintainers.id" |
| 94 | + INTEGER project_id PK "FK to projects.id" |
| 95 | + DATETIME joined_at |
| 96 | + } |
| 97 | +
|
| 98 | + collaborators { |
| 99 | + INTEGER id PK |
| 100 | + DATETIME created_at |
| 101 | + DATETIME updated_at |
| 102 | + DATETIME deleted_at |
| 103 | + TEXT name |
| 104 | + TEXT email |
| 105 | + TEXT git_hub_email |
| 106 | + TEXT git_hub_account |
| 107 | + DATETIME last_login |
| 108 | + DATETIME registered_at |
| 109 | + } |
| 110 | +
|
| 111 | + service_teams { |
| 112 | + INTEGER id PK |
| 113 | + DATETIME created_at |
| 114 | + DATETIME updated_at |
| 115 | + DATETIME deleted_at |
| 116 | + INTEGER project_id "FK to projects.id" |
| 117 | + INTEGER service_id "FK to services.id" |
| 118 | + TEXT service_team_name |
| 119 | + TEXT project_name |
| 120 | + } |
| 121 | +
|
| 122 | + service_users { |
| 123 | + INTEGER id PK |
| 124 | + DATETIME created_at |
| 125 | + DATETIME updated_at |
| 126 | + DATETIME deleted_at |
| 127 | + INTEGER service_id "FK to services.id" |
| 128 | + INTEGER service_user_id |
| 129 | + TEXT service_email |
| 130 | + TEXT service_ref |
| 131 | + TEXT service_git_hub_name |
| 132 | + } |
| 133 | +
|
| 134 | + service_user_teams { |
| 135 | + INTEGER id PK |
| 136 | + DATETIME created_at |
| 137 | + DATETIME updated_at |
| 138 | + DATETIME deleted_at |
| 139 | + INTEGER service_id "FK to services.id" |
| 140 | + INTEGER service_user_id "FK to service_users.id" |
| 141 | + INTEGER service_team_id "FK to service_teams.id" |
| 142 | + INTEGER maintainer_id "FK to maintainers.id" |
| 143 | + INTEGER collaborator_id "FK to collaborators.id" |
| 144 | + } |
| 145 | +
|
| 146 | + companies ||--o{ maintainers : employs |
| 147 | + projects ||--o{ projects : parent_of |
| 148 | + projects ||--o{ service_projects : includes |
| 149 | + services ||--o{ service_projects : provides |
| 150 | + maintainers ||--o{ maintainer_projects : assigned_to |
| 151 | + projects ||--o{ maintainer_projects : hosts |
| 152 | + service_teams ||--o{ service_user_teams : has |
| 153 | + services ||--o{ service_users : has |
| 154 | +``` |
| 155 | + |
| 156 | + |
| 157 | + |
| 158 | +## init-container |
| 159 | + - bootstrap process loads project and maintainer data from |
| 160 | + - a CNCF-Internal worksheet |
| 161 | + - in future, should be loaded from a combination of PCC user profiles (keyed by GitHub user account) and a registered list of project.yaml files on a per-project basis. |
| 162 | + |
| 163 | +## GitHub Event Listener |
| 164 | + |
| 165 | +### cert-manager |
| 166 | +Manages the server cert associated with the maintainer-d event listener that listens for changes to onboarding issues. |
| 167 | + |
| 168 | +Steps to integrate with Let's Encrypt on OKE: |
| 169 | + |
| 170 | +1. Create the OCI DNS credentials secret: |
| 171 | + ```bash |
| 172 | + kubectl create secret generic oci-dns-credentials -n cert-manager \ |
| 173 | + --from-literal=tenancyOCID=<tenancy_ocid> \ |
| 174 | + --from-literal=userOCID=<user_ocid> \ |
| 175 | + --from-literal=fingerprint=<api_key_fingerprint> \ |
| 176 | + --from-file=privateKey=<path_to_api_key_private_key_pem> |
| 177 | + ``` |
| 178 | +2. Apply a `ClusterIssuer` using the OCI DNS solver (update compartment OCID, DNS zone, and email): |
| 179 | + ```yaml |
| 180 | + apiVersion: cert-manager.io/v1 |
| 181 | + kind: ClusterIssuer |
| 182 | + metadata: |
| 183 | + name: letsencrypt-dns |
| 184 | + spec: |
| 185 | + acme: |
| 186 | + |
| 187 | + server: https://acme-v02.api.letsencrypt.org/directory |
| 188 | + privateKeySecretRef: |
| 189 | + name: letsencrypt-dns-account-key |
| 190 | + solvers: |
| 191 | + - dns01: |
| 192 | + oci: |
| 193 | + compartmentOCID: ocid1.compartment.oc1..aaaaaaaa22icap66vxktktubjlhf6oxvfhev6n7udgje2chahyrtq65ga63a |
| 194 | + dnsZoneName: cncf.io. |
| 195 | + secretRef: |
| 196 | + name: oci-dns-credentials |
| 197 | + key: privateKey |
| 198 | + tenancyOCID: ocid1.tenancy.oc1... # must match the secret |
| 199 | + userOCID: ocid1.user.oc1... # must match the secret |
| 200 | + fingerprint: <api_key_fingerprint> |
| 201 | + ``` |
| 202 | +3. Request the certificate in the `maintainerd` namespace: |
| 203 | + ```yaml |
| 204 | + apiVersion: cert-manager.io/v1 |
| 205 | + kind: Certificate |
| 206 | + metadata: |
| 207 | + name: maintainerd-cert |
| 208 | + namespace: maintainerd |
| 209 | + spec: |
| 210 | + secretName: maintainerd-tls |
| 211 | + issuerRef: |
| 212 | + name: letsencrypt-dns |
| 213 | + kind: ClusterIssuer |
| 214 | + dnsNames: |
| 215 | + - github-events.cncf.io |
| 216 | + ``` |
| 217 | +4. Update `deploy/manifests/service.yaml` to expose HTTPS and reference the secret: |
| 218 | + ```yaml |
| 219 | + metadata: |
| 220 | + annotations: |
| 221 | + service.beta.kubernetes.io/oci-load-balancer-ssl-ports: https |
| 222 | + service.beta.kubernetes.io/oci-load-balancer-tls-secret: maintainerd/maintainerd-tls |
| 223 | + spec: |
| 224 | + ports: |
| 225 | + - name: http |
| 226 | + port: 80 |
| 227 | + targetPort: 2525 |
| 228 | + - name: https |
| 229 | + port: 443 |
| 230 | + targetPort: 2525 |
| 231 | + ``` |
| 232 | +5. Apply the manifests (`kubectl apply -f deploy/manifests/service.yaml`) and verify: |
| 233 | + - `kubectl describe certificate maintainerd-cert -n maintainerd` |
| 234 | + - `kubectl get secret maintainerd-tls -n maintainerd` |
| 235 | + - `curl -vk https://github-events.cncf.io/healthz` |
| 236 | + |
| 237 | +Ensure your OCI IAM policies allow the OKE dynamic group to manage DNS records in the relevant compartment; otherwise the ACME solver cannot create the TXT challenges. |
0 commit comments