|
| 1 | +{{ define "env_database" }} |
| 2 | +- |
| 3 | + name: INFRABOX_DATABASE_USER |
| 4 | + valueFrom: |
| 5 | + secretKeyRef: |
| 6 | + name: infrabox-postgres |
| 7 | + key: username |
| 8 | +- |
| 9 | + name: INFRABOX_DATABASE_PASSWORD |
| 10 | + valueFrom: |
| 11 | + secretKeyRef: |
| 12 | + name: infrabox-postgres |
| 13 | + key: password |
| 14 | +- |
| 15 | + name: INFRABOX_DATABASE_HOST |
| 16 | + value: {{ default "localhost" .Values.storage.postgres.host | quote }} |
| 17 | +- |
| 18 | + name: INFRABOX_DATABASE_DB |
| 19 | + value: {{ default "infrabox" .Values.storage.postgres.db | quote }} |
| 20 | +- |
| 21 | + name: INFRABOX_DATABASE_PORT |
| 22 | + value: {{ default 5432 .Values.storage.postgres.port | quote }} |
| 23 | +- |
| 24 | + name: INFRABOX_STORAGE_CLOUDSQL_ENABLED |
| 25 | + value: {{ .Values.storage.cloudsql.enabled | quote }} |
| 26 | +{{ if .Values.storage.cloudsql.enabled }} |
| 27 | +- |
| 28 | + name: INFRABOX_STORAGE_CLOUDSQL_INSTANCE_CONNECTION_NAME |
| 29 | + value: {{ .Values.storage.cloudsql.instance_connection_name }} |
| 30 | +{{ end }} |
| 31 | +{{ end }} |
| 32 | + |
| 33 | +{{ define "volumes_rsa" }} |
| 34 | +- |
| 35 | + name: rsa-key |
| 36 | + secret: |
| 37 | + secretName: infrabox-rsa |
| 38 | +{{ end }} |
| 39 | + |
| 40 | +{{ define "mounts_rsa_private" }} |
| 41 | +- |
| 42 | + name: rsa-key |
| 43 | + mountPath: "/var/run/secrets/infrabox.net/rsa/id_rsa" |
| 44 | + subPath: id_rsa |
| 45 | + readOnly: true |
| 46 | +{{ end }} |
| 47 | + |
| 48 | +{{ define "mounts_rsa_public" }} |
| 49 | +- |
| 50 | + name: rsa-key |
| 51 | + mountPath: "/var/run/secrets/infrabox.net/rsa/id_rsa.pub" |
| 52 | + subPath: id_rsa.pub |
| 53 | + readOnly: true |
| 54 | +{{ end }} |
| 55 | + |
| 56 | +{{ define "volumes_database" }} |
| 57 | +{{ if .Values.storage.cloudsql.enabled }} |
| 58 | +- |
| 59 | + name: cloudsql-instance-credentials |
| 60 | + secret: |
| 61 | + secretName: infrabox-cloudsql-instance-credentials |
| 62 | +- |
| 63 | + name: cloudsql |
| 64 | + emptyDir: |
| 65 | +{{ end }} |
| 66 | +{{ end }} |
| 67 | + |
| 68 | +{{ define "env_gcs" }} |
| 69 | +- |
| 70 | + name: INFRABOX_STORAGE_GCS_ENABLED |
| 71 | + value: {{ .Values.storage.gcs.enabled | quote }} |
| 72 | +{{ if .Values.storage.gcs.enabled }} |
| 73 | +- |
| 74 | + name: INFRABOX_STORAGE_GCS_BUCKET |
| 75 | + value: {{ .Values.storage.gcs.bucket }} |
| 76 | +- |
| 77 | + name: GOOGLE_APPLICATION_CREDENTIALS |
| 78 | + value: /etc/infrabox/gcs/gcs_service_account.json |
| 79 | +{{ end }} |
| 80 | +{{ end }} |
| 81 | + |
| 82 | +{{ define "env_s3" }} |
| 83 | +- |
| 84 | + name: INFRABOX_STORAGE_S3_ENABLED |
| 85 | + value: {{ .Values.storage.s3.enabled | quote }} |
| 86 | +{{ if .Values.storage.s3.enabled }} |
| 87 | +- |
| 88 | + name: INFRABOX_STORAGE_S3_ENDPOINT |
| 89 | + value: {{ .Values.storage.s3.endpoint }} |
| 90 | +- |
| 91 | + name: INFRABOX_STORAGE_S3_PORT |
| 92 | + value: {{ .Values.storage.s3.port | quote }} |
| 93 | +- |
| 94 | + name: INFRABOX_STORAGE_S3_REGION |
| 95 | + value: {{ .Values.storage.s3.region | quote }} |
| 96 | +- |
| 97 | + name: INFRABOX_STORAGE_S3_SECURE |
| 98 | + value: {{ .Values.storage.s3.secure | quote }} |
| 99 | +- |
| 100 | + name: INFRABOX_STORAGE_S3_BUCKET |
| 101 | + value: {{ default "infrabox" .Values.storage.s3.bucket | quote }} |
| 102 | +- |
| 103 | + name: INFRABOX_STORAGE_S3_ACCESS_KEY |
| 104 | + valueFrom: |
| 105 | + secretKeyRef: |
| 106 | + name: infrabox-s3-credentials |
| 107 | + key: accessKey |
| 108 | +- |
| 109 | + name: INFRABOX_STORAGE_S3_SECRET_KEY |
| 110 | + valueFrom: |
| 111 | + secretKeyRef: |
| 112 | + name: infrabox-s3-credentials |
| 113 | + key: secretKey |
| 114 | +{{ end }} |
| 115 | +{{ end }} |
| 116 | + |
| 117 | +{{ define "env_azure" }} |
| 118 | +- |
| 119 | + name: INFRABOX_STORAGE_AZURE_ENABLED |
| 120 | + value: {{ .Values.storage.azure.enabled | quote }} |
| 121 | +{{ if .Values.storage.azure.enabled }} |
| 122 | +- |
| 123 | + name: INFRABOX_STORAGE_AZURE_ACCOUNT_NAME |
| 124 | + valueFrom: |
| 125 | + secretKeyRef: |
| 126 | + name: infrabox-azure-credentials |
| 127 | + key: account-name |
| 128 | +- |
| 129 | + name: INFRABOX_STORAGE_AZURE_ACCOUNT_KEY |
| 130 | + valueFrom: |
| 131 | + secretKeyRef: |
| 132 | + name: infrabox-azure-credentials |
| 133 | + key: account-key |
| 134 | +{{ end }} |
| 135 | +{{ end }} |
| 136 | + |
| 137 | +{{ define "env_github" }} |
| 138 | +- |
| 139 | + name: INFRABOX_GITHUB_ENABLED |
| 140 | + value: {{ .Values.github.enabled | quote }} |
| 141 | +{{ if .Values.github.enabled }} |
| 142 | +- |
| 143 | + name: INFRABOX_GITHUB_LOGIN_ENABLED |
| 144 | + value: {{ .Values.github.login.enabled | quote }} |
| 145 | +- |
| 146 | + name: INFRABOX_GITHUB_API_URL |
| 147 | + value: {{ default "https://api.github.com" .Values.github.api_url }} |
| 148 | +- |
| 149 | + name: INFRABOX_GITHUB_LOGIN_URL |
| 150 | + value: {{ default "https://github.com/login" .Values.github.login.url }} |
| 151 | +- |
| 152 | + name: INFRABOX_GITHUB_LOGIN_ALLOWED_ORGANIZATIONS |
| 153 | + value: {{ default "" .Values.github.login.allowed_organizations | quote }} |
| 154 | +{{ end }} |
| 155 | +{{ end }} |
| 156 | + |
| 157 | +{{ define "env_gerrit" }} |
| 158 | +- |
| 159 | + name: INFRABOX_GERRIT_ENABLED |
| 160 | + value: {{ .Values.gerrit.enabled | quote }} |
| 161 | +{{ if .Values.gerrit.enabled }} |
| 162 | +- |
| 163 | + name: INFRABOX_GERRIT_HOSTNAME |
| 164 | + value: {{ required "gerrit.hostname is required" .Values.gerrit.hostname }} |
| 165 | +- |
| 166 | + name: INFRABOX_GERRIT_KEY_FILENAME |
| 167 | + value: /root/.ssh/id_rsa |
| 168 | +- |
| 169 | + name: INFRABOX_GERRIT_USERNAME |
| 170 | + value: {{ required "gerrit.username is required" .Values.gerrit.username }} |
| 171 | +- |
| 172 | + name: INFRABOX_GERRIT_PORT |
| 173 | + value: {{ default "29418" .Values.gerrit.port | quote }} |
| 174 | +{{ end }} |
| 175 | +{{ end }} |
| 176 | + |
| 177 | +{{ define "env_ldap" }} |
| 178 | +- |
| 179 | + name: INFRABOX_ACCOUNT_LDAP_ENABLED |
| 180 | + value: {{ .Values.account.ldap.enabled | quote }} |
| 181 | +{{ if .Values.account.ldap.enabled }} |
| 182 | +- |
| 183 | + name: INFRABOX_ACCOUNT_LDAP_URL |
| 184 | + value: {{ required "account.ldap.url is required" .Values.account.ldap.url }} |
| 185 | +- |
| 186 | + name: INFRABOX_ACCOUNT_LDAP_BASE |
| 187 | + value: {{ required "account.ldap.base is required" .Values.account.ldap.base }} |
| 188 | +- |
| 189 | + name: INFRABOX_ACCOUNT_LDAP_DN |
| 190 | + valueFrom: |
| 191 | + secretKeyRef: |
| 192 | + name: infrabox-ldap |
| 193 | + key: dn |
| 194 | +- |
| 195 | + name: INFRABOX_ACCOUNT_LDAP_PASSWORD |
| 196 | + valueFrom: |
| 197 | + secretKeyRef: |
| 198 | + name: infrabox-ldap |
| 199 | + key: password |
| 200 | +{{ end }} |
| 201 | +{{ end }} |
| 202 | + |
| 203 | + |
| 204 | +{{ define "env_github_secrets" }} |
| 205 | +{{ if .Values.github.enabled }} |
| 206 | +- |
| 207 | + name: INFRABOX_GITHUB_CLIENT_ID |
| 208 | + valueFrom: |
| 209 | + secretKeyRef: |
| 210 | + name: infrabox-github |
| 211 | + key: client_id |
| 212 | +- |
| 213 | + name: INFRABOX_GITHUB_CLIENT_SECRET |
| 214 | + valueFrom: |
| 215 | + secretKeyRef: |
| 216 | + name: infrabox-github |
| 217 | + key: client_secret |
| 218 | +- |
| 219 | + name: INFRABOX_GITHUB_WEBHOOK_SECRET |
| 220 | + valueFrom: |
| 221 | + secretKeyRef: |
| 222 | + name: infrabox-github |
| 223 | + key: webhook_secret |
| 224 | +{{ end }} |
| 225 | +{{ end }} |
| 226 | + |
| 227 | +{{ define "env_general" }} |
| 228 | +- |
| 229 | + name: INFRABOX_GENERAL_LOG_STACKDRIVER |
| 230 | + value: {{ default "false" .Values.general.log.stackdriver | quote }} |
| 231 | +- |
| 232 | + name: INFRABOX_GENERAL_DONT_CHECK_CERTIFICATES |
| 233 | + value: {{ default "false" .Values.general.dont_check_certificates | quote }} |
| 234 | +- |
| 235 | + name: INFRABOX_GENERAL_WORKER_NAMESPACE |
| 236 | + value: {{ default "infrabox-worker" .Values.general.worker_namespace }} |
| 237 | +- |
| 238 | + name: INFRABOX_ROOT_URL |
| 239 | + value: {{ .Values.root_url }} |
| 240 | +- |
| 241 | + name: INFRABOX_GENERAL_REPORT_ISSUE_URL |
| 242 | + value: {{ .Values.general.report_issue_url }} |
| 243 | +- |
| 244 | + name: INFRABOX_GENERAL_DOCKER_REGISTRY |
| 245 | + value: {{ .Values.general.docker_registry }} |
| 246 | +{{ end }} |
| 247 | + |
| 248 | +{{ define "env_docker_registry" }} |
| 249 | +- |
| 250 | + name: INFRABOX_DOCKER_REGISTRY_ADMIN_USERNAME |
| 251 | + value: "admin" |
| 252 | +- |
| 253 | + name: INFRABOX_DOCKER_REGISTRY_ADMIN_PASSWORD |
| 254 | + valueFrom: |
| 255 | + secretKeyRef: |
| 256 | + name: infrabox-admin |
| 257 | + key: password |
| 258 | +{{ end }} |
| 259 | + |
| 260 | +{{ define "containers_database" }} |
| 261 | +{{ if .Values.storage.cloudsql.enabled }} |
| 262 | +- |
| 263 | + image: gcr.io/cloudsql-docker/gce-proxy:1.09 |
| 264 | + name: cloudsql-proxy |
| 265 | + command: ["/cloud_sql_proxy", "--dir=/cloudsql", |
| 266 | + "-instances={{ .Values.storage.cloudsql.instance_connection_name }}=tcp:5432", |
| 267 | + "-credential_file=/secrets/cloudsql/credentials.json"] |
| 268 | + volumeMounts: |
| 269 | + - name: cloudsql-instance-credentials |
| 270 | + mountPath: /secrets/cloudsql |
| 271 | + readOnly: true |
| 272 | + - name: cloudsql |
| 273 | + mountPath: /cloudsql |
| 274 | +{{ end }} |
| 275 | +{{ end }} |
| 276 | + |
| 277 | +{{ define "env_job" }} |
| 278 | +- |
| 279 | + name: INFRABOX_JOB_MAX_OUTPUT_SIZE |
| 280 | + value: {{ default "104857600" .Values.job.max_output_size | quote }} |
| 281 | +- |
| 282 | + name: INFRABOX_JOB_SECURITY_CONTEXT_CAPABILITIES_ENABLED |
| 283 | + value: {{ default "false" .Values.job.security_context.capabilities.enabled | quote }} |
| 284 | +{{ end }} |
| 285 | + |
| 286 | +{{ define "env_kubernetes" }} |
| 287 | +- |
| 288 | + name: INFRABOX_KUBERNETES_MASTER_HOST |
| 289 | + value: {{ default "kubernetes.default.svc.cluster.local" .Values.general.kubernetes_master_host }} |
| 290 | +- |
| 291 | + name: INFRABOX_KUBERNETES_MASTER_PORT |
| 292 | + value: {{ default 443 .Values.general.kubernetes_master_port | quote }} |
| 293 | +{{ end }} |
0 commit comments