Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(helm): use configmap to configure tailing-sidecar-operator #534

Merged
merged 1 commit into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions helm/tailing-sidecar-operator/conf/operator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sidecar:
image: {{ .Values.sidecar.image.repository }}:{{ .Values.sidecar.image.tag | default .Chart.AppVersion }}
7 changes: 7 additions & 0 deletions helm/tailing-sidecar-operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,10 @@ Selector labels
app.kubernetes.io/name: {{ include "tailing-sidecar-operator.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Configmap name
*/}}
{{- define "tailing-sidecar-operator.configMap.name" -}}
{{- printf "%s-%s" .Release.Name "operator-config" | trunc 63 | trimSuffix "-" }}
{{- end }}
9 changes: 9 additions & 0 deletions helm/tailing-sidecar-operator/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "tailing-sidecar-operator.configMap.name" . }}
labels:
{{- include "tailing-sidecar-operator.labels" . | nindent 4 }}
data:
config.yaml: |
{{- (tpl (.Files.Get "conf/operator.yaml") .) | nindent 4 }}
10 changes: 9 additions & 1 deletion helm/tailing-sidecar-operator/templates/resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,8 @@ spec:
metadata:
labels:
{{- include "tailing-sidecar-operator.selectorLabels" . | nindent 8 }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
spec:
containers:
- args:
Expand All @@ -384,7 +386,7 @@ spec:
- args:
- --metrics-addr=127.0.0.1:8080
- --enable-leader-election
- --tailing-sidecar-image={{ .Values.sidecar.image.repository }}:{{ .Values.sidecar.image.tag | default .Chart.AppVersion }}
- --config=/tailing-sidecar/config/config.yaml
command:
- /manager
image: {{ .Values.operator.image.repository }}:{{ .Values.operator.image.tag | default .Chart.AppVersion }}
Expand Down Expand Up @@ -431,10 +433,16 @@ spec:
- mountPath: /tmp/k8s-webhook-server/serving-certs
name: cert
readOnly: true
- mountPath: /tailing-sidecar/config
name: config
readOnly: true
serviceAccountName: tailing-sidecar-service-account
terminationGracePeriodSeconds: 10
volumes:
- name: cert
secret:
defaultMode: 420
secretName: webhook-server-cert
- name: config
configMap:
name: {{ template "tailing-sidecar-operator.configMap.name" . }}