From b369b77a9409693d95bd5d8c72cb5fe224122ce9 Mon Sep 17 00:00:00 2001 From: Jeff Zellner Date: Mon, 9 Dec 2024 14:37:58 -0700 Subject: [PATCH] add extra volume + init container support to helm charts --- charts/edge-site/templates/statefulset.yaml | 12 +++++++++++- charts/edge-site/values.yaml | 4 ++++ .../templates/cronjobs/garbage-collector.yaml | 12 +++++++++++- .../templates/deployments/_inbox-container.tpl | 12 +++++++++++- .../templates/deployments/site-controller.yaml | 14 +++++++++++++- .../templates/deployments/stream-service.yaml | 12 +++++++++++- charts/primary-site/values.yaml | 16 ++++++++++++++++ 7 files changed, 77 insertions(+), 5 deletions(-) diff --git a/charts/edge-site/templates/statefulset.yaml b/charts/edge-site/templates/statefulset.yaml index 71d3dc9..f9c7f37 100644 --- a/charts/edge-site/templates/statefulset.yaml +++ b/charts/edge-site/templates/statefulset.yaml @@ -33,9 +33,16 @@ spec: secret: secretName: gcp-cloud-credential optional: true + {{- if .Values.edgeController.extraVolumes }} + {{- toYaml .Values.edgeController.extraVolumes| nindent 8 }} + {{- end }} + {{- if .Values.edgeController.initContainers }} + initContainers: + {{- toYaml .Values.edgeController.initContainers | nindent 10 }} + {{- end }} containers: - name: edge-controller - image: us-central1-docker.pkg.dev/foxglove-images/images/edge-controller:{{ .Chart.AppVersion }} + image: {{ .Values.edgeController.image }}:{{ .Chart.AppVersion }} resources: requests: memory: {{ .Values.edgeController.resources.requests.memory }} @@ -44,6 +51,9 @@ spec: memory: {{ .Values.edgeController.resources.limits.memory }} cpu: {{ .Values.edgeController.resources.limits.cpu }} volumeMounts: + {{- if .Values.edgeController.extraVolumeMounts }} + {{- toYaml .Values.edgeController.extraVolumeMounts | nindent 12 }} + {{- end }} {{ if eq .Values.recordingStorage.provider "local" }} - mountPath: /data/storage name: storage-root diff --git a/charts/edge-site/values.yaml b/charts/edge-site/values.yaml index 834d5d0..67411f1 100644 --- a/charts/edge-site/values.yaml +++ b/charts/edge-site/values.yaml @@ -43,6 +43,7 @@ recordingStorage: s3CompatibleServiceRegion: "" edgeController: + image: "us-central1-docker.pkg.dev/foxglove-images/images/edge-controller" storageClaim: edge-controller-storage-claim indexClaim: edge-controller-index-claim metrics: @@ -59,3 +60,6 @@ edgeController: podAnnotations: {} serviceLabels: {} env: [] + initContainers: [] + extraVolumes: [] + extraVolumeMounts: [] diff --git a/charts/primary-site/templates/cronjobs/garbage-collector.yaml b/charts/primary-site/templates/cronjobs/garbage-collector.yaml index 8150360..ce630dd 100644 --- a/charts/primary-site/templates/cronjobs/garbage-collector.yaml +++ b/charts/primary-site/templates/cronjobs/garbage-collector.yaml @@ -18,12 +18,22 @@ spec: secret: secretName: gcp-cloud-credential optional: true + {{- if .Values.garbageCollector.deployment.extraVolumes }} + {{- toYaml .Values.garbageCollector.deployment.extraVolumes | nindent 12 }} + {{- end }} + {{- if .Values.garbageCollector.deployment.initContainers }} + initContainers: + {{- toYaml .Values.garbageCollector.deployment.initContainers | nindent 12 }} + {{- end }} containers: - name: garbage-collector - image: us-central1-docker.pkg.dev/foxglove-images/images/garbage-collector:{{ .Chart.AppVersion }} + image: {{ .Values.garbageCollector.deployment.image }}:{{ .Chart.AppVersion }} volumeMounts: - mountPath: /secrets name: cloud-credentials + {{- if .Values.garbageCollector.deployment.extraVolumeMounts }} + {{- toYaml .Values.garbageCollector.deployment.extraVolumeMounts | nindent 16 }} + {{- end }} envFrom: - secretRef: name: cloud-credentials diff --git a/charts/primary-site/templates/deployments/_inbox-container.tpl b/charts/primary-site/templates/deployments/_inbox-container.tpl index 7bb1c87..8c34754 100644 --- a/charts/primary-site/templates/deployments/_inbox-container.tpl +++ b/charts/primary-site/templates/deployments/_inbox-container.tpl @@ -16,6 +16,9 @@ template: secret: secretName: gcp-cloud-credential optional: true + {{- if .Values.inboxListener.deployment.extraVolumes }} + {{- toYaml .Values.inboxListener.deployment.extraVolumes | nindent 6 }} + {{- end }} {{- if .Values.inboxListener.deployment.localScratch.enabled }} - name: local-scratch emptyDir: @@ -30,9 +33,13 @@ template: {{- if .Values.inboxListener.deployment.serviceAccount.enabled }} serviceAccount: inbox-listener {{- end}} + {{- if .Values.inboxListener.deployment.initContainers }} + initContainers: + {{- toYaml .Values.inboxListener.deployment.initContainers | nindent 6 }} + {{- end }} containers: - name: inbox-listener - image: us-central1-docker.pkg.dev/foxglove-images/images/inbox-listener:{{ .Chart.AppVersion }} + image: {{ .Values.inboxListener.deployment.image }}:{{ .Chart.AppVersion }} resources: requests: cpu: {{ .Values.inboxListener.deployment.resources.requests.cpu }} @@ -53,6 +60,9 @@ template: - mountPath: /local-scratch name: local-scratch {{- end }} + {{- if .Values.inboxListener.deployment.extraVolumeMounts }} + {{- toYaml .Values.inboxListener.deployment.extraVolumeMounts | nindent 10 }} + {{- end }} ports: - name: metrics containerPort: 6001 diff --git a/charts/primary-site/templates/deployments/site-controller.yaml b/charts/primary-site/templates/deployments/site-controller.yaml index bc969e2..78766ce 100644 --- a/charts/primary-site/templates/deployments/site-controller.yaml +++ b/charts/primary-site/templates/deployments/site-controller.yaml @@ -21,9 +21,17 @@ spec: {{ $key }}: {{ $value | quote }} {{- end }} spec: + {{- if .Values.siteController.deployment.extraVolumes }} + volumes: + {{- toYaml .Values.siteController.deployment.extraVolumes | nindent 8 }} + {{- end }} + {{- if .Values.siteController.deployment.initContainers }} + initContainers: +{{ toYaml .Values.siteController.deployment.initContainers | nindent 8 }} + {{- end }} containers: - name: site-controller - image: us-central1-docker.pkg.dev/foxglove-images/images/site-controller:{{ .Chart.AppVersion }} + image: {{ .Values.siteController.deployment.image }}:{{ .Chart.AppVersion }} resources: requests: cpu: {{ .Values.siteController.deployment.resources.requests.cpu }} @@ -42,6 +50,10 @@ spec: - secretRef: name: foxglove-site-token optional: true + {{- if .Values.siteController.deployment.extraVolumeMounts }} + volumeMounts: + {{- toYaml .Values.siteController.deployment.extraVolumeMounts | nindent 12 }} + {{- end }} env: - name: FOXGLOVE_API_URL value: {{ .Values.globals.foxgloveApiUrl }} diff --git a/charts/primary-site/templates/deployments/stream-service.yaml b/charts/primary-site/templates/deployments/stream-service.yaml index 08b414e..259685e 100644 --- a/charts/primary-site/templates/deployments/stream-service.yaml +++ b/charts/primary-site/templates/deployments/stream-service.yaml @@ -31,9 +31,16 @@ spec: secret: secretName: gcp-cloud-credential optional: true + {{- if .Values.streamService.deployment.extraVolumes }} + {{- toYaml .Values.streamService.deployment.extraVolumes | nindent 8 }} + {{- end }} + {{- if .Values.streamService.deployment.initContainers }} + initContainers: + {{- toYaml .Values.streamService.deployment.initContainers | nindent 8 }} + {{- end }} containers: - name: stream-service - image: us-central1-docker.pkg.dev/foxglove-images/images/stream-server:{{ .Chart.AppVersion }} + image: {{ .Values.streamService.deployment.image }}:{{ .Chart.AppVersion }} resources: requests: cpu: {{ .Values.streamService.deployment.resources.requests.cpu }} @@ -49,6 +56,9 @@ spec: volumeMounts: - mountPath: /secrets name: cloud-credentials + {{- if .Values.streamService.deployment.extraVolumeMounts }} + {{- toYaml .Values.streamService.deployment.extraVolumeMounts | nindent 12 }} + {{- end }} envFrom: - secretRef: name: cloud-credentials diff --git a/charts/primary-site/values.yaml b/charts/primary-site/values.yaml index 66eb706..3711903 100644 --- a/charts/primary-site/values.yaml +++ b/charts/primary-site/values.yaml @@ -51,7 +51,11 @@ ingress: inboxListener: deployment: + image: "us-central1-docker.pkg.dev/foxglove-images/images/inbox-listener" replicas: 1 + initContainers: [] + extraVolumes: [] + extraVolumeMounts: [] resources: requests: cpu: 1000m @@ -132,7 +136,11 @@ streamService: service: annotations: {} deployment: + image: "us-central1-docker.pkg.dev/foxglove-images/images/stream-server" replicas: 1 + initContainers: [] + extraVolumes: [] + extraVolumeMounts: [] resources: requests: cpu: 1000m @@ -161,6 +169,10 @@ siteController: service: annotations: {} deployment: + image: "us-central1-docker.pkg.dev/foxglove-images/images/site-controller" + initContainers: [] + extraVolumes: [] + extraVolumeMounts: [] resources: requests: cpu: 250m @@ -181,6 +193,10 @@ garbageCollector: failedJobsHistoryLimit: 1 successfulJobsHistoryLimit: 3 deployment: + image: "us-central1-docker.pkg.dev/foxglove-images/images/garbage-collector" + initContainers: [] + extraVolumes: [] + extraVolumeMounts: [] env: [] nodeSelectors: {} serviceAccount: