From 71d9625d1d742e94bfbec5180c2e031e00b3b3ee Mon Sep 17 00:00:00 2001 From: chatchai-level Date: Tue, 23 May 2023 17:18:44 -0700 Subject: [PATCH] feat(bazel-remote): support DaemonSet and updateStrategy --- charts/bazel-remote/Chart.yaml | 4 ++-- charts/bazel-remote/README.md | 3 ++- charts/bazel-remote/templates/daemonset.yaml | 23 +++++++++++++++++++ charts/bazel-remote/templates/deployment.yaml | 4 ++++ .../bazel-remote/templates/statefulset.yaml | 4 ++++ charts/bazel-remote/values.yaml | 9 +++++++- 6 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 charts/bazel-remote/templates/daemonset.yaml diff --git a/charts/bazel-remote/Chart.yaml b/charts/bazel-remote/Chart.yaml index 6a48783..30444b9 100644 --- a/charts/bazel-remote/Chart.yaml +++ b/charts/bazel-remote/Chart.yaml @@ -3,8 +3,8 @@ name: bazel-remote description: |- Helm chart to deploy [bazel-remote](https://github.com/buchgr/bazel-remote). type: application -version: 0.0.4 -appVersion: v2.3.8 +version: 0.0.5 +appVersion: v2.4.1 home: https://github.com/slamdev/helm-charts/tree/master/charts/bazel-remote icon: https://bazel.build/images/bazel-icon.svg maintainers: diff --git a/charts/bazel-remote/README.md b/charts/bazel-remote/README.md index 777b461..45586e6 100644 --- a/charts/bazel-remote/README.md +++ b/charts/bazel-remote/README.md @@ -26,7 +26,7 @@ Helm chart to deploy [bazel-remote](https://github.com/buchgr/bazel-remote). | image.repository | string | `"buchgr/bazel-remote-cache"` | image repository | | image.tag | string | `""` | image tag (chart's appVersion value will be used if not set) | | imagePullSecrets | list | `[]` | image pull secret for private images | -| kind | string | `"Deployment"` | resource type to operate bazel-remote, can be StatefulSet or Deployment | +| kind | string | `"Deployment"` | resource type to operate bazel-remote, can be StatefulSet, Deployment or DaemonSet | | livenessProbe.httpGet.path | string | `"/status"` | path for liveness probe | | livenessProbe.httpGet.port | string | `"http"` | port for liveness probe | | nameOverride | string | `""` | override name of the chart | @@ -48,6 +48,7 @@ Helm chart to deploy [bazel-remote](https://github.com/buchgr/bazel-remote). | startupProbe.httpGet.path | string | `"/status"` | | | startupProbe.httpGet.port | string | `"http"` | | | tolerations | list | `[]` | tolerations for scheduler pod assignment | +| updateStrategy | object | `{}` | configure automated rolling updates for pods | | volumeClaimTemplates | list | `[]` | volume claim templates; used only when 'kind: StatefulSet' | | volumeMounts | list | `[]` | additional volume mounts | | volumes | list | `[]` | additional volumes | diff --git a/charts/bazel-remote/templates/daemonset.yaml b/charts/bazel-remote/templates/daemonset.yaml new file mode 100644 index 0000000..98c78e7 --- /dev/null +++ b/charts/bazel-remote/templates/daemonset.yaml @@ -0,0 +1,23 @@ +{{- if eq .Values.kind "DaemonSet" }} +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: {{ include "bazel-remote.fullname" . }} + namespace: {{ .Release.Namespace }} +{{- with .Values.deploymentAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} +{{- end }} + labels: + {{- include "bazel-remote.labels" . | nindent 4 }} +spec: + selector: + matchLabels: + {{- include "bazel-remote.selectorLabels" . | nindent 6 }} + template: + {{- include "bazel-remote.pod" . | nindent 4 }} + {{- with .Values.updateStrategy }} + updateStrategy: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/bazel-remote/templates/deployment.yaml b/charts/bazel-remote/templates/deployment.yaml index 8ede95c..b0b4ac6 100644 --- a/charts/bazel-remote/templates/deployment.yaml +++ b/charts/bazel-remote/templates/deployment.yaml @@ -17,4 +17,8 @@ spec: {{- include "bazel-remote.selectorLabels" . | nindent 6 }} template: {{- include "bazel-remote.pod" . | nindent 4 }} +{{- with .Values.updateStrategy }} + strategy: + {{- toYaml . | nindent 4 }} +{{- end }} {{- end }} diff --git a/charts/bazel-remote/templates/statefulset.yaml b/charts/bazel-remote/templates/statefulset.yaml index 667b755..4e5699d 100644 --- a/charts/bazel-remote/templates/statefulset.yaml +++ b/charts/bazel-remote/templates/statefulset.yaml @@ -22,4 +22,8 @@ spec: volumeClaimTemplates: {{- toYaml . | nindent 4 }} {{- end }} +{{- with .Values.updateStrategy }} + updateStrategy: + {{- toYaml . | nindent 4 }} +{{- end }} {{- end }} diff --git a/charts/bazel-remote/values.yaml b/charts/bazel-remote/values.yaml index 395274e..daa0f9c 100644 --- a/charts/bazel-remote/values.yaml +++ b/charts/bazel-remote/values.yaml @@ -1,4 +1,4 @@ -# kind -- resource type to operate bazel-remote, can be StatefulSet or Deployment +# kind -- resource type to operate bazel-remote, can be StatefulSet, Deployment or DaemonSet kind: Deployment # replicaCount -- number of replicas for bazel-remote deployment. @@ -143,3 +143,10 @@ conf: |- access_log_level: none port: 8080 grpc_port: 9092 + +# updateStrategy -- configure automated rolling updates for pods +updateStrategy: {} + # rollingUpdate: + # maxSurge: 0 + # maxUnavailable: 25% + # type: RollingUpdate \ No newline at end of file