Skip to content

Commit 1d77379

Browse files
authored
Merge pull request #16 from KyriosGN0/helm-chart-ready
make the helm chart work out of the box with default airflow helm chart
2 parents 2048203 + 3b849f5 commit 1d77379

7 files changed

Lines changed: 46 additions & 4 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ Install the operator from an OCI registry.
196196

197197
```bash
198198
# install or upgrade the operator from an OCI chart reference
199-
helm upgrade --install airflow-operator oci://ghcr.io/drfaust92/charts/airflow-k8s-operator --namespace airflow-operator --create-namespace
199+
helm upgrade --install airflow-operator oci://ghcr.io/drfaust92/charts/airflow-k8s-operator --set operator.airflowHost=airflow.example.com --namespace airflow-operator --create-namespace
200200
```
201201

202202
## Project Architecture

chart/airflow-k8s-operator/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.4.4
18+
version: 0.5.0
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{ required "operator.airflowHost is required" .Values.operator.airflowHost }}

chart/airflow-k8s-operator/templates/deployment.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,24 @@ spec:
4848
{{- toYaml . | nindent 12 }}
4949
{{- end }}
5050
env:
51+
- name: AIRFLOW_HOST
52+
value: {{ tpl .Values.operator.airflowHost . | quote }}
5153
{{- if .Values.livenessProbe }}
5254
- name: LIVENESS_PROBE
5355
value: {{ tpl .Values.operator.livenessProbeAddress . | quote }}
5456
{{- end }}
57+
{{- if .Values.operator.basicAuthSecret.enabled }}
58+
- name: AIRFLOW_USERNAME
59+
valueFrom:
60+
secretKeyRef:
61+
name: {{ .Values.operator.basicAuthSecret.secretName }}
62+
key: {{ .Values.operator.basicAuthSecret.usernameKey }}
63+
- name: AIRFLOW_PASSWORD
64+
valueFrom:
65+
secretKeyRef:
66+
name: {{ .Values.operator.basicAuthSecret.secretName }}
67+
key: {{ .Values.operator.basicAuthSecret.passwordKey }}
68+
{{- end }}
5569
{{- with .Values.env }}
5670
{{- toYaml . | nindent 12 }}
5771
{{- end }}

chart/airflow-k8s-operator/templates/rbac.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ rules:
1414
resources: [secrets]
1515
verbs: [get, list, watch]
1616
- apiGroups: [airflow.drfaust92]
17-
resources: [variables, connections]
17+
resources: [variables, connections, pools]
1818
verbs: [list, watch, get]
1919
---
2020
apiVersion: rbac.authorization.k8s.io/v1
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{{- if and .Values.operator.basicAuthSecret.enabled .Values.operator.basicAuthSecret.create }}
2+
apiVersion: v1
3+
kind: Secret
4+
metadata:
5+
name: {{ .Values.operator.basicAuthSecret.secretName }}
6+
type: Opaque
7+
data:
8+
{{ .Values.operator.basicAuthSecret.usernameKey }}: {{ printf "admin" | b64enc }}
9+
{{ .Values.operator.basicAuthSecret.passwordKey }}: {{ printf "admin" | b64enc }}
10+
{{- end }}

chart/airflow-k8s-operator/values.yaml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ resources:
7272
# -- (map) liveness probe configuration
7373
livenessProbe:
7474
httpGet:
75-
path: /
75+
path: "/healthz"
7676
port: http
7777

7878
# Additional volumes on the output Deployment definition.
@@ -135,5 +135,22 @@ affinity: {}
135135
port: 8080
136136

137137
operator:
138+
# -- (string) address for the operator
139+
airflowHost: ""
140+
141+
basicAuthSecret:
142+
# -- (bool) whether to use basic auth secrets
143+
enabled: false
144+
# -- (bool) whether to create the basic auth secret
145+
# If set to false, you must provide a Kubernetes secret with the name specified in `secretName`.
146+
# The secret must contain the keys specified in `usernameKey` and `passwordKey`.
147+
# If the secret or keys do not exist, the deployment will fail.
148+
create: false
149+
# -- (string) name of the basic auth secret
150+
secretName: "airflow-basic-auth"
151+
# -- (string) key name for username in the secret
152+
usernameKey: AIRFLOW_USERNAME
153+
# -- (string) key name for password in the secret
154+
passwordKey: AIRFLOW_PASSWORD
138155
# -- (string) liveness probe address for the operator
139156
livenessProbeAddress: "http://0.0.0.0:{{ .Values.port }}/healthz"

0 commit comments

Comments
 (0)