Skip to content

Commit

Permalink
Rename variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesper Svendsen committed Jan 11, 2023
1 parent 1a46561 commit 8c3daa8
Show file tree
Hide file tree
Showing 10 changed files with 282 additions and 173 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ $ helm uninstall studio -n <namespace>
| `global.secrets.postgresDatabaseUser` | PostgreSQL Database Username | `""` | True |
| `global.secrets.postgresDatabasePassword` | PostgreSQL Database Password | `""` | True |
| `global.secrets.blobVaultAccessKeyId` | Blob Vault (Minio) Access Key ID | `""` | True |
| `global.secrets.blobVaultSecretAccessId` | Blob Vault (Minio) Secret Access ID | `""` | True |
| `global.secrets.blobVaultSecretAccessKeyId` | Blob Vault (Minio) Secret Access ID | `""` | True |
| `global.secrets.secretKey` | Secret Key | `""` | False |
| `global.configurations.githubUrl` | Github URL | `""` | False |
| `global.configurations.githubWebhookUrl` | Github Webhook URL | `""` | False |
Expand All @@ -93,9 +93,8 @@ $ helm uninstall studio -n <namespace>
| `global.configurations.celeryBrokerUrl` | Redis Endpoint | `""` | False |
| `global.configurations.celeryResultBackend` | Redis Endpoint | `""` | False |
| `global.configurations.postgresDatabaseUrl` | PostgreSQL Database URL | `""` | True |
| `global.configurations.scmProviders` | Enable List of SCMs | `""` | True |
| `global.configurations.maxViews` | Maximum Views | `""` | True |
| `global.configurations.maxTeams` | Maximum Teams | `""` | True |
| `global.maxViews` | Maximum Views | `""` | True |
| `global.maxTeams` | Maximum Teams | `""` | True |
| `redis.enabled` | Install in-cluster Redis | `true` | False |
| `postgresql.enabled` | Install in-cluster PostgreSQL | `true` | False |
| `postgresql.global.postgresql.auth.postgresPassword` | Password for the "postgres" admin user | `true` | True |
Expand Down
4 changes: 2 additions & 2 deletions charts/studio/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.2
version: 0.1.3

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand All @@ -35,4 +35,4 @@ dependencies:
- name: postgresql
condition: postgresql.enabled
version: "11.9.1"
repository: "https://charts.bitnami.com/bitnami"
repository: "https://charts.bitnami.com/bitnami"
99 changes: 46 additions & 53 deletions charts/studio/templates/_env_vars.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,28 @@
{{- end }}

- name: BITBUCKET_URL
{{- if .Values.global.configurations.bitbucketUrl }}
value: {{ .Values.global.configurations.bitbucketUrl }}
{{- if .Values.global.scmProviders.bitbucket.url }}
value: {{ .Values.global.scmProviders.bitbucket.url }}
{{- else }}
value: ""
{{- end }}

- name: BITBUCKET_API_URL
{{- if .Values.global.configurations.bitbucketApiUrl }}
value: {{ .Values.global.configurations.bitbucketApiUrl }}
{{- if .Values.global.scmProviders.bitbucket.apiUrl }}
value: {{ .Values.global.scmProviders.bitbucket.apiUrl }}
{{- else }}
value: ""
{{- end }}

- name: BITBUCKET_WEBHOOK_URL
{{- if .Values.global.configurations.bitbucketWebhookUrl }}
value: {{ .Values.global.configurations.bitbucketWebhookUrl }}
{{- if .Values.global.scmProviders.bitbucket.webhookUrl }}
value: {{ .Values.global.scmProviders.bitbucket.webhookUrl }}
{{- else }}
value: ""
{{- end }}

- name: BITBUCKET_CLIENT_ID
{{- if .Values.global.secrets.bitbucketClientId }}
{{- if .Values.global.scmProviders.bitbucket.clientId }}
valueFrom:
secretKeyRef:
name: studio
Expand All @@ -56,7 +56,7 @@
{{- end }}

- name: BITBUCKET_SECRET_KEY
{{- if .Values.global.secrets.bitbucketSecretKey }}
{{- if .Values.global.scmProviders.bitbucket.secretKey }}
valueFrom:
secretKeyRef:
name: studio
Expand All @@ -69,69 +69,69 @@
value: "True"

- name: BLOBVAULT_AWS_ACCESS_KEY_ID
{{- if .Values.global.secrets.blobVaultAccessKeyId }}
{{- if .Values.global.blobvault.accessKeyId }}
valueFrom:
secretKeyRef:
name: studio
key: blobVaultAccessKeyId
key: blobvaultAccessKeyId
{{- else }}
value: ""
{{- end }}

- name: BLOBVAULT_AWS_SECRET_ACCESS_ID
{{- if .Values.global.secrets.blobVaultSecretAccessId }}
{{- if .Values.global.blobvault.secretAccessKeyId }}
valueFrom:
secretKeyRef:
name: studio
key: blobVaultSecretAccessId
key: blobvaultSecretAccessKeyId
{{- else }}
value: ""
{{- end }}

- name: BLOBVAULT_ENDPOINT_URL
{{- if .Values.global.configurations.blobvaultEndpointUrl }}
value: {{ .Values.global.configurations.blobvaultEndpointUrl }}
{{- if .Values.global.blobvault.endpointUrl }}
value: {{ .Values.global.blobvault.endpointUrl }}
{{- else }}
value: "{{ .Values.minio.fullnameOverride }}.{{ .Release.Namespace }}.svc.cluster.local:9000"
{{- end }}

- name: BLOBVAULT_ENDPOINT_URL_FE
{{- if .Values.global.configurations.blobvaultEndpointUrlFe }}
value: {{ .Values.global.configurations.blobvaultEndpointUrlFe }}
{{- if .Values.global.blobvault.endpointUrlFe }}
value: {{ .Values.global.blobvault.endpointUrlFe }}
{{- else }}
value: "{{ .Values.minio.fullnameOverride }}.{{ .Release.Namespace }}.svc.cluster.local:9000"
{{- end }}

- name: BLOBVAULT_BUCKET
{{- if .Values.global.configurations.blobvaultBucket }}
value: {{ .Values.global.configurations.blobvaultBucket }}
{{- if .Values.global.blobvault.bucket }}
value: {{ .Values.global.blobvault.bucket }}
{{- else }}
value: ""
{{- end }}

- name: CELERY_BROKER_URL
{{- if .Values.global.configurations.celeryBrokerUrl }}
value: {{ .Values.global.configurations.celeryBrokerUrl }}
{{- if .Values.global.celery.brokerUrl }}
value: {{ .Values.global.celery.brokerUrl }}
{{- else }}
value: "redis://{{ .Values.redis.fullnameOverride }}-master.{{ .Release.Namespace }}.svc.cluster.local:6379"
{{- end }}

- name: CELERY_RESULT_BACKEND
{{- if .Values.global.configurations.celeryResultBackend }}
value: {{ .Values.global.configurations.celeryResultBackend }}
{{- if .Values.global.celery.resultBackend }}
value: {{ .Values.global.celery.resultBackend }}
{{- else }}
value: "redis://{{ .Values.redis.fullnameOverride }}-master.{{ .Release.Namespace }}.svc.cluster.local:6379"
{{- end }}

- name: REDIS_URL
{{- if .Values.global.configurations.celeryResultBackend }}
value: {{ .Values.global.configurations.celeryResultBackend }}
{{- if .Values.global.celery.resultBackend }}
value: {{ .Values.global.celery.resultBackend }}
{{- else }}
value: "redis://{{ .Values.redis.fullnameOverride }}-master.{{ .Release.Namespace }}.svc.cluster.local:6379"
{{- end }}

- name: DATABASE_URL
value: "psql://{{ .Values.global.secrets.postgresDatabaseUser}}:{{ .Values.global.secrets.postgresDatabasePassword }}@{{ .Values.global.configurations.postgresDatabaseUrl }}"
value: "psql://{{ .Values.global.postgres.databaseUser}}:{{ .Values.global.postgres.databasePassword }}@{{ .Values.global.postgres.databaseUrl }}"

- name: SECRET_KEY
valueFrom:
Expand All @@ -140,7 +140,7 @@
key: secretKey

- name: GITHUB_APP_ID
{{- if .Values.global.secrets.githubAppId }}
{{- if .Values.global.scmProviders.github.appId }}
valueFrom:
secretKeyRef:
name: studio
Expand All @@ -150,7 +150,7 @@
{{- end }}

- name: GITHUB_APP_CLIENT_ID
{{- if .Values.global.secrets.githubClientId }}
{{- if .Values.global.scmProviders.github.clientId }}
valueFrom:
secretKeyRef:
name: studio
Expand All @@ -160,7 +160,7 @@
{{- end }}

- name: GITHUB_APP_SECRET_KEY
{{- if .Values.global.secrets.githubAppSecret }}
{{- if .Values.global.scmProviders.github.appSecret }}
valueFrom:
secretKeyRef:
name: studio
Expand All @@ -170,7 +170,7 @@
{{- end }}

- name: GITHUB_APP_PRIVATE_KEY_PEM
{{- if .Values.global.secrets.githubPrivateKey }}
{{- if .Values.global.scmProviders.github.privateKey }}
valueFrom:
secretKeyRef:
name: studio
Expand All @@ -180,7 +180,7 @@
{{- end }}

- name: GITHUB_WEBHOOK_SECRET
{{- if .Values.global.secrets.githubWebhookSecret }}
{{- if .Values.global.scmProviders.github.webhookSecret }}
valueFrom:
secretKeyRef:
name: studio
Expand All @@ -190,21 +190,21 @@
{{- end }}

- name: GITHUB_URL
{{- if .Values.global.configurations.githubUrl }}
value: {{ .Values.global.configurations.githubUrl }}
{{- if .Values.global.scmProviders.github.url }}
value: {{ .Values.global.scmProviders.github.url }}
{{- else }}
value: ""
{{- end }}

- name: GITHUB_WEBHOOK_URL
{{- if .Values.global.configurations.githubWebhookUrl }}
value: {{ .Values.global.configurations.githubWebhookUrl }}
{{- if .Values.global.scmProviders.github.webhookUrl }}
value: {{ .Values.global.scmProviders.github.webhookUrl }}
{{- else }}
value: ""
{{- end }}

- name: GITLAB_CLIENT_ID
{{- if .Values.global.secrets.gitlabClientId }}
{{- if .Values.global.scmProviders.gitlab.clientId }}
valueFrom:
secretKeyRef:
name: studio
Expand All @@ -214,7 +214,7 @@
{{- end }}

- name: GITLAB_SECRET_KEY
{{- if .Values.global.secrets.gitlabSecretKey }}
{{- if .Values.global.scmProviders.gitlab.secretKey }}
valueFrom:
secretKeyRef:
name: studio
Expand All @@ -224,46 +224,39 @@
{{- end }}

- name: GITLAB_WEBHOOK_SECRET
{{- if .Values.global.secrets.githubWebhookSecret }}
{{- if .Values.global.scmProviders.gitlab.webhookSecret }}
valueFrom:
secretKeyRef:
name: studio
key: githubWebhookSecret
key: gitlabWebhookSecret
{{- else }}
value: ""
{{- end }}

- name: GITLAB_URL
{{- if .Values.global.configurations.gitlabUrl }}
value: {{ .Values.global.configurations.gitlabUrl }}
{{- if .Values.global.scmProviders.gitlab.url }}
value: {{ .Values.global.scmProviders.gitlab.url }}
{{- else }}
value: ""
{{- end }}

- name: GITLAB_WEBHOOK_URL
{{- if .Values.global.configurations.gitlabWebhookUrl }}
value: {{ .Values.global.configurations.gitlabWebhookUrl }}
{{- else }}
value: ""
{{- end }}

- name: SCM_PROVIDERS
{{- if .Values.global.configurations.scmProviders }}
value: {{ .Values.global.configurations.scmProviders }}
{{- if .Values.global.scmProviders.gitlab.webhookUrl }}
value: {{ .Values.global.scmProviders.gitlab.webhookUrl }}
{{- else }}
value: ""
{{- end }}

- name: MAX_VIEWS
{{- if .Values.global.configurations.maxViews }}
value: {{ .Values.global.configurations.maxViews | quote }}
{{- if .Values.global.maxViews }}
value: {{ .Values.global.maxViews | quote }}
{{- else }}
value: ""
{{- end }}

- name: MAX_TEAMS
{{- if .Values.global.configurations.maxTeams }}
value: {{ .Values.global.configurations.maxTeams | quote }}
{{- if .Values.global.maxTeams }}
value: {{ .Values.global.maxTeams | quote }}
{{- else }}
value: ""
{{- end }}
Expand Down
9 changes: 9 additions & 0 deletions charts/studio/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: studio-ca-certificates
data:
{{- if .Values.global.customCaCert }}
self_signed_ca.crt: |
{{ .Values.global.customCaCert | indent 4}}
{{- end }}
16 changes: 14 additions & 2 deletions charts/studio/templates/deployment-studio-backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ spec:
{{- include "studio-backend.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.studioBackend.podAnnotations }}
annotations:
checksum/studio: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- with .Values.studioBackend.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
Expand All @@ -33,7 +34,7 @@ spec:
{{- toYaml .Values.studioBackend.securityContext | nindent 12 }}
image: "{{ .Values.studioBackend.image.repository }}:{{ .Values.studioBackend.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.studioBackend.image.pullPolicy }}
args: ["uwsgi", "--ini", "uwsgi.ini"]
args: [ "uwsgi", "--ini", "uwsgi.ini" ]
ports:
- name: http
containerPort: 8000
Expand All @@ -45,10 +46,21 @@ spec:
initialDelaySeconds: 5
periodSeconds: 25
timeoutSeconds: 60
{{- if .Values.global.customCaCert }}
volumeMounts:
- name: studio-ca-certificates
mountPath: /usr/local/share/ca-certificates
{{- end }}
resources:
{{- toYaml .Values.studioBackend.resources | nindent 12 }}
env:
{{ include "studio.envvars" . | indent 12 }}
{{- if .Values.global.customCaCert }}
volumes:
- name: studio-ca-certificates
configMap:
name: studio-ca-certificates
{{- end }}
{{- with .Values.studioBackend.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
14 changes: 13 additions & 1 deletion charts/studio/templates/deployment-studio-beat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ spec:
{{- include "studio-beat.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.studioBeat.podAnnotations }}
annotations:
checksum/studio: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- with .Values.studioBeat.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
Expand Down Expand Up @@ -46,6 +47,17 @@ spec:
value: "1"
- name: "WAIT_FOR_MIGRATIONS"
value: "1"
{{- if .Values.global.customCaCert }}
volumeMounts:
- name: studio-ca-certificates
mountPath: /usr/local/share/ca-certificates
{{- end }}
{{- if .Values.global.customCaCert }}
volumes:
- name: studio-ca-certificates
configMap:
name: studio-ca-certificates
{{- end }}
{{- with .Values.studioBeat.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
Loading

0 comments on commit 8c3daa8

Please sign in to comment.