Skip to content

Commit

Permalink
fixup! 🔧(helm) rework chart based on jenny helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
wilbrdt committed May 21, 2024
1 parent 4c5503e commit 652ef5e
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 25 deletions.
6 changes: 3 additions & 3 deletions src/helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ Ralph is also distributed as a Helm chart. Check out the [Ralph Helm chart READM

### Deploy the dashboard suite: Warren

Let's create secrets needed for Warren deployment with:
Let's create the secrets needed for Warren deployment:
```bash
kubectl create secret generic warren-api-secrets --from-env-file=warren/charts/api/.secret
kubectl create secret generic warren-app-secrets --from-env-file=warren/charts/app/.secret
kubectl apply -f manifests/warren-app-secrets.yaml
kubectl apply -f manifests/warren-api-secrets.yaml
```

We can now deploy Warren along with its dependencies
Expand Down
17 changes: 17 additions & 0 deletions src/helm/manifests/warren-api-secrets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
apiVersion: v1
kind: Secret
metadata:
name: warren-api-db-password
type: Opaque
stringData:
WARREN_API_DB_PASSWORD: pass
---
apiVersion: v1
kind: Secret
metadata:
name: warren-api-lrs-password
type: Opaque
stringData:
WARREN_LRS_AUTH_BASIC_PASSWORD: password
---
25 changes: 25 additions & 0 deletions src/helm/manifests/warren-app-secrets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
apiVersion: v1
kind: Secret
metadata:
name: warren-app-db-password
type: Opaque
stringData:
WARREN_APP_DB_PASSWORD: pass
---
apiVersion: v1
kind: Secret
metadata:
name: warren-app-secret-key
type: Opaque
stringData:
WARREN_APP_SECRET_KEY: change_me_please
---
apiVersion: v1
kind: Secret
metadata:
name: warren-app-signing-key
type: Opaque
stringData:
WARREN_APP_SIGNING_KEY: change_me
---
3 changes: 0 additions & 3 deletions src/helm/warren/charts/api/.secret

This file was deleted.

8 changes: 5 additions & 3 deletions src/helm/warren/charts/api/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ Selector labels
{{- define "api.selectorLabels" -}}
app.kubernetes.io/name: {{ include "api.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: api
app.kubernetes.io/part-of: warren
{{- end }}

{{/*
Expand All @@ -63,7 +65,7 @@ Environment variables
- name: "WARREN_API_DB_PASSWORD"
valueFrom:
secretKeyRef:
name: warren-api-secrets
name: warren-api-db-password
key: WARREN_API_DB_PASSWORD
- name: "WARREN_API_DB_ENGINE"
value: "{{ .Values.fastapi.db.engine }}"
Expand All @@ -80,14 +82,14 @@ Environment variables
- name: "WARREN_LRS_AUTH_BASIC_PASSWORD"
valueFrom:
secretKeyRef:
name: warren-api-secrets
name: warren-api-lrs-password
key: WARREN_LRS_AUTH_BASIC_PASSWORD
- name: "WARREN_APP_SIGNING_ALGORITHM"
value: "{{ .Values.fastapi.signingAlgorithm }}"
- name: "WARREN_APP_SIGNING_KEY"
valueFrom:
secretKeyRef:
name: warren-api-secrets
name: warren-app-signing-key
key: WARREN_APP_SIGNING_KEY
{{- range $key, $val := .Values.env.secret }}
- name: {{ $val.envName }}
Expand Down
2 changes: 1 addition & 1 deletion src/helm/warren/charts/api/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ template "api.fullname" . }}-ingress
name: {{ template "api.fullname" . }}
labels: {{- include "api.labels" . | nindent 4 }}
{{- if .Values.commonLabels }}
{{ toYaml .Values.commonLabels | nindent 4 }}
Expand Down
5 changes: 2 additions & 3 deletions src/helm/warren/charts/api/templates/jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ spec:
template:
metadata:
labels: {{- include "api.selectorLabels" $ | nindent 8 }}
app.kubernetes.io/component: fastapi
spec:
{{- include "fastapi.imagePullSecrets" $ | nindent 6 }}
containers:
- name: fastapi-{{ .name }}
image: {{ $.Values.image.repository }}:{{ $.Values.image.tag }}
- name: "{{ $.Chart.Name }}-{{ .name }}"
image: "{{ $.Values.image.repository }}:{{ $.Values.image.tag }}"
imagePullPolicy: {{ $.Values.image.pullPolicy }}
env:
{{- include "api.envs" $ | nindent 12 }}
Expand Down
3 changes: 0 additions & 3 deletions src/helm/warren/charts/app/.secret

This file was deleted.

10 changes: 5 additions & 5 deletions src/helm/warren/charts/app/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ Selector labels
{{- define "app.selectorLabels" -}}
app.kubernetes.io/name: {{ include "app.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app: warren-app
service: app
app.kubernetes.io/component: app
app.kubernetes.io/part-of: warren
{{- end }}

{{/*
Expand All @@ -63,7 +63,7 @@ Environment variables
- name: "WARREN_APP_SECRET_KEY"
valueFrom:
secretKeyRef:
name: warren-app-secrets
name: warren-app-secret-key
key: WARREN_APP_SECRET_KEY
- name: "WARREN_APP_ALLOWED_HOSTS"
value: "{{ .Values.django.allowedHosts | join "," }}"
Expand All @@ -74,7 +74,7 @@ Environment variables
- name: "WARREN_APP_DB_PASSWORD"
valueFrom:
secretKeyRef:
name: warren-app-secrets
name: warren-app-db-password
key: WARREN_APP_DB_PASSWORD
- name: "WARREN_APP_DB_HOST"
value: "{{ .Values.django.db.host }}"
Expand All @@ -85,7 +85,7 @@ Environment variables
- name: "WARREN_APP_SIGNING_KEY"
valueFrom:
secretKeyRef:
name: warren-app-secrets
name: warren-app-signing-key
key: WARREN_APP_SIGNING_KEY
- name: "WARREN_APP_ACCESS_TOKEN_LIFETIME"
value: "{{ .Values.django.accessTokenLifetime }}"
Expand Down
2 changes: 1 addition & 1 deletion src/helm/warren/charts/app/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ template "app.fullname" . }}-ingress
name: {{ template "app.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "app.labels" . | nindent 4 }}
{{- if .Values.commonLabels }}
Expand Down
5 changes: 2 additions & 3 deletions src/helm/warren/charts/app/templates/jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ spec:
template:
metadata:
labels: {{- include "app.selectorLabels" $ | nindent 8 }}
app.kubernetes.io/component: django
spec:
{{- include "django.imagePullSecrets" $ | nindent 6 }}
containers:
- name: django-{{ .name }}
image: {{ $.Values.image.repository }}:{{ $.Values.image.tag }}
- name: "{{ $.Chart.Name }}-{{ .name }}"
image: "{{ $.Values.image.repository }}:{{ $.Values.image.tag }}"
imagePullPolicy: {{ $.Values.image.pullPolicy }}
env:
{{- include "app.envs" $ | nindent 12 }}
Expand Down

0 comments on commit 652ef5e

Please sign in to comment.