From 2613abd4ccadad9241e419384bb8406261eeee41 Mon Sep 17 00:00:00 2001 From: Justin Brooks Date: Sat, 26 Aug 2023 20:44:35 -0400 Subject: [PATCH] Add pvc to weave --- charts/operator-wandb/Chart.yaml | 2 +- .../charts/mysql/templates/NOTES.txt | 0 .../charts/mysql/templates/pvc.yaml | 2 +- .../charts/mysql/templates/statefulset.yaml | 1 + .../charts/weave/templates/NOTES.txt | 0 .../charts/weave/templates/deployment.yaml | 8 ++++++++ .../charts/weave/templates/pvc.yaml | 15 +++++++++++++++ charts/operator-wandb/charts/weave/values.yaml | 4 ++++ charts/operator-wandb/templates/_storage.tpl | 4 ++-- charts/operator-wandb/templates/ingress.yaml | 10 +++++----- charts/operator-wandb/values.yaml | 11 ++++++----- 11 files changed, 43 insertions(+), 14 deletions(-) delete mode 100644 charts/operator-wandb/charts/mysql/templates/NOTES.txt delete mode 100644 charts/operator-wandb/charts/weave/templates/NOTES.txt create mode 100644 charts/operator-wandb/charts/weave/templates/pvc.yaml diff --git a/charts/operator-wandb/Chart.yaml b/charts/operator-wandb/Chart.yaml index d0b10754..0c20c98b 100644 --- a/charts/operator-wandb/Chart.yaml +++ b/charts/operator-wandb/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: operator-wandb description: A Helm chart for deploying W&B to Kubernetes type: application -version: 0.2.0 +version: 0.3.0 appVersion: 1.0.0 icon: https://wandb.ai/logo.svg maintainers: diff --git a/charts/operator-wandb/charts/mysql/templates/NOTES.txt b/charts/operator-wandb/charts/mysql/templates/NOTES.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/charts/operator-wandb/charts/mysql/templates/pvc.yaml b/charts/operator-wandb/charts/mysql/templates/pvc.yaml index 619725f2..d0d8b544 100644 --- a/charts/operator-wandb/charts/mysql/templates/pvc.yaml +++ b/charts/operator-wandb/charts/mysql/templates/pvc.yaml @@ -10,7 +10,7 @@ metadata: spec: accessModes: - ReadWriteOnce - {{ include "wandb.storageClass" . | nindent 4 }} + {{ include "wandb.storageClass" .Values.persistence | nindent 4 }} resources: requests: storage: {{ .Values.persistence.size | quote }} diff --git a/charts/operator-wandb/charts/mysql/templates/statefulset.yaml b/charts/operator-wandb/charts/mysql/templates/statefulset.yaml index 093f709f..2f4d4446 100644 --- a/charts/operator-wandb/charts/mysql/templates/statefulset.yaml +++ b/charts/operator-wandb/charts/mysql/templates/statefulset.yaml @@ -80,6 +80,7 @@ spec: subPath: my.cnf resources: {{- toYaml .Values.resources | nindent 12 }} + volumes: - name: initdb configMap: diff --git a/charts/operator-wandb/charts/weave/templates/NOTES.txt b/charts/operator-wandb/charts/weave/templates/NOTES.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/charts/operator-wandb/charts/weave/templates/deployment.yaml b/charts/operator-wandb/charts/weave/templates/deployment.yaml index 93a43ba9..01e64b5b 100644 --- a/charts/operator-wandb/charts/weave/templates/deployment.yaml +++ b/charts/operator-wandb/charts/weave/templates/deployment.yaml @@ -79,4 +79,12 @@ spec: resources: {{- toYaml .Values.resources | nindent 12 }} + + volumeMounts: + - name: cache + mountPath: /vol/weave/cache + volumes: + - name: cache + persistentVolumeClaim: + claimName: {{ template "weave.fullname" . }} {{- end }} \ No newline at end of file diff --git a/charts/operator-wandb/charts/weave/templates/pvc.yaml b/charts/operator-wandb/charts/weave/templates/pvc.yaml new file mode 100644 index 00000000..7e75953c --- /dev/null +++ b/charts/operator-wandb/charts/weave/templates/pvc.yaml @@ -0,0 +1,15 @@ +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: {{ template "weave.fullname" . }} + namespace: {{ $.Release.Namespace }} + labels: + {{- include "wandb.commonLabels" . | nindent 4 }} + {{- include "weave.commonLabels" . | nindent 4 }} + {{- include "weave.labels" . | nindent 4 }} +spec: + accessModes: [ReadWriteOnce] + {{ include "wandb.storageClass" . | nindent 4 }} + resources: + requests: + storage: {{ .Values.persistence.size | quote }} diff --git a/charts/operator-wandb/charts/weave/values.yaml b/charts/operator-wandb/charts/weave/values.yaml index 31c96587..1c9820ea 100644 --- a/charts/operator-wandb/charts/weave/values.yaml +++ b/charts/operator-wandb/charts/weave/values.yaml @@ -43,3 +43,7 @@ resources: limits: cpu: 8 memory: 16Gi + +persistence: + # storageClassName: "" + size: 20Gi diff --git a/charts/operator-wandb/templates/_storage.tpl b/charts/operator-wandb/templates/_storage.tpl index 427b2fa0..a640371c 100644 --- a/charts/operator-wandb/templates/_storage.tpl +++ b/charts/operator-wandb/templates/_storage.tpl @@ -1,6 +1,6 @@ {{- define "wandb.storageClass" -}} -{{- if .Values.storageClass -}} -{{- if (ne .Values.storageClass "") -}} +{{- if .Values.persistence.storageClass -}} +{{- if (ne .Values.persistence.storageClass "") -}} {{- printf "storageClassName: %s" .Values.storageClass -}} {{- end -}} {{- else if .Values.global.storageClass -}} diff --git a/charts/operator-wandb/templates/ingress.yaml b/charts/operator-wandb/templates/ingress.yaml index e7eac12b..31da5cd0 100644 --- a/charts/operator-wandb/templates/ingress.yaml +++ b/charts/operator-wandb/templates/ingress.yaml @@ -4,12 +4,12 @@ metadata: name: {{ .Release.Name }} labels: {{- include "wandb.commonLabels" . | nindent 4 }} - {{- if .Values.ingress.labels -}} - {{- toYaml .Values.ingress.labels | nindent 4 }} + {{- if .Values.global.ingress.labels -}} + {{- toYaml .Values.global.ingress.labels | nindent 4 }} {{- end }} annotations: - {{- if .Values.ingress.annotations -}} - {{- toYaml .Values.ingress.annotations | nindent 4 }} + {{- if .Values.global.ingress.annotations -}} + {{- toYaml .Values.global.ingress.annotations | nindent 4 }} {{- end }} spec: rules: @@ -24,7 +24,7 @@ spec: number: 8082 defaultBackend: service: - {{- if eq .Values.ingress.defaultBackend "console" }} + {{- if eq .Values.global.ingress.defaultBackend "console" }} name: {{ .Release.Name }}-console port: number: 8082 diff --git a/charts/operator-wandb/values.yaml b/charts/operator-wandb/values.yaml index 64f2bb8c..f36c5a93 100644 --- a/charts/operator-wandb/values.yaml +++ b/charts/operator-wandb/values.yaml @@ -14,6 +14,7 @@ global: host: "http://localhost:8080" storageClass: "" + common: labels: {} annotations: {} @@ -60,6 +61,11 @@ global: parameters: {} caCert: "" + ingress: + defaultBackend: "app" + annotations: {} + labels: {} + parquet: install: true image: @@ -93,10 +99,5 @@ mysql: redis: install: true -ingress: - defaultBackend: "app" - annotations: {} - labels: {} - nameOverride: "" fullnameOverride: ""