Skip to content

Commit

Permalink
feat(helm): support labels in values.yaml (#374)
Browse files Browse the repository at this point in the history
* feat(helm): support labels in values.yaml

* doc: changelog

* fix: remove unnecessary template block
  • Loading branch information
razvan authored Jan 29, 2024
1 parent 6a99126 commit 04c1a5e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Added

- More CRD documentation ([#354]).
- Helm: support labels in values.yaml ([#374]).

### Changed

Expand All @@ -27,6 +28,7 @@
[#354]: https://github.com/stackabletech/airflow-operator/pull/354
[#366]: https://github.com/stackabletech/airflow-operator/pull/366
[#372]: https://github.com/stackabletech/airflow-operator/pull/372
[#374]: https://github.com/stackabletech/airflow-operator/pull/374

## [23.11.0] - 2023-11-24

Expand Down
4 changes: 3 additions & 1 deletion deploy/helm/airflow-operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ Selector labels
{{- define "operator.selectorLabels" -}}
app.kubernetes.io/name: {{ include "operator.appname" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- with .Values.labels }}
{{ toYaml . }}
{{- end }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
Expand Down
3 changes: 2 additions & 1 deletion deploy/helm/airflow-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ spec:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- toYaml . | nindent 8 }}
{{- end }}

labels:
{{- include "operator.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
{{- with .Values.image.pullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
6 changes: 6 additions & 0 deletions deploy/helm/airflow-operator/templates/roles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "operator.fullname" . }}-clusterrole
labels:
{{- include "operator.labels" . | nindent 4 }}
rules:
- apiGroups:
- ""
Expand Down Expand Up @@ -126,6 +128,8 @@ apiVersion: security.openshift.io/v1
kind: SecurityContextConstraints
metadata:
name: airflow-scc
labels:
{{- include "operator.labels" . | nindent 4 }}
annotations:
kubernetes.io/description: |-
This resource is derived from hostmount-anyuid. It provides all the features of the
Expand Down Expand Up @@ -171,6 +175,8 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "operator.name" . }}-clusterrole
labels:
{{- include "operator.labels" . | nindent 4 }}
rules:
- apiGroups:
- ""
Expand Down
5 changes: 4 additions & 1 deletion deploy/helm/airflow-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
image:
repository: docker.stackable.tech/stackable/airflow-operator
pullPolicy: IfNotPresent
pullSecrets: []

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

Expand All @@ -17,6 +17,9 @@ serviceAccount:
# If not set and create is true, a name is generated using the fullname template
name: ""

# Provide additional labels which get attached to all deployed resources
labels: {}

podAnnotations: {}

podSecurityContext: {}
Expand Down

0 comments on commit 04c1a5e

Please sign in to comment.