Skip to content

Commit

Permalink
Add templates for azurefile and filestore
Browse files Browse the repository at this point in the history
  • Loading branch information
jsbroks committed Aug 30, 2023
1 parent 7b300f2 commit 52271b6
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/operator-wandb/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: operator-wandb
description: A Helm chart for deploying W&B to Kubernetes
type: application
version: 0.5.4
version: 0.6.0
appVersion: 1.0.0
icon: https://wandb.ai/logo.svg

Expand Down
28 changes: 28 additions & 0 deletions charts/operator-wandb/charts/weave/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ spec:
value: /vol/weave/cache
- name: WEAVE_AUTH_GRAPHQL_URL
value: {{ .Values.global.host }}/graphql
- name: WEAVE_SERVER_NUM_WORKERS
value: "4"

{{- include "weave.extraEnv" (dict "global" .Values.global "local" .Values) | nindent 12 }}
{{- include "wandb.extraEnvFrom" (dict "root" $ "local" .) | nindent 12 }}
Expand Down Expand Up @@ -89,4 +91,30 @@ spec:
- name: cache
persistentVolumeClaim:
claimName: {{ template "weave.fullname" . }}
{{- end }}
---
{{- if eq .Values.persistence.accessMode "ReadWriteMany" }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "weave.fullname" . }}
namespace: {{ $.Release.Namespace }}
labels:
{{- include "wandb.commonLabels" . | nindent 4 }}
{{- include "weave.commonLabels" . | nindent 4 }}
{{- include "weave.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "weave.fullname" . }}
minReplicas: 2
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70
{{- end }}
43 changes: 42 additions & 1 deletion charts/operator-wandb/charts/weave/templates/pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,49 @@ metadata:
{{- include "weave.commonLabels" . | nindent 4 }}
{{- include "weave.labels" . | nindent 4 }}
spec:
accessModes: [ReadWriteMany]
accessModes:
- {{ .Values.persistence.accessMode | quote }}
{{- if eq .Values.persistence.provider "" }}
{{ include "wandb.storageClass" . | nindent 4 }}
{{- else }}
storageClassName: {{ template "weave.fullname" . }}-{{ .Values.persistence.provider }}-cache
{{- end }}
resources:
requests:
storage: {{ .Values.persistence.size | quote }}
---
{{- if ne .Values.persistence.provider "" }}
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: {{ template "weave.fullname" . }}-{{ .Values.persistence.provider }}-cache
namespace: {{ $.Release.Namespace }}
labels:
{{- include "wandb.commonLabels" . | nindent 4 }}
{{- include "weave.commonLabels" . | nindent 4 }}
{{- include "weave.labels" . | nindent 4 }}
{{- if eq .Values.persistence.provider "azurefile" }}
provisioner: file.csi.azure.com
allowVolumeExpansion: true
mountOptions:
- dir_mode=0777
- file_mode=0777
- uid=0
- gid=0
- mfsymlinks
- cache=strict
- actimeo=30
parameters:
skuName: Premium_LRS
{{- else if eq .Values.persistence.provider "google" }}
provisioner: filestore.csi.storage.gke.io
allowVolumeExpansion: true
parameters:
tier: BASIC_SSD
network: default
mountOptions:
- "strictatime"
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
{{- end }}
{{- end }}
6 changes: 4 additions & 2 deletions charts/operator-wandb/charts/weave/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ resources:
# and remove the curly braces after 'resources:'.
requests:
cpu: 1
memory: 2Gi
memory: 4Gi
limits:
cpu: 8
cpu: 4
memory: 16Gi

persistence:
provider: ""
accessMode: ReadWriteMany
# storageClassName: ""
size: 20Gi

0 comments on commit 52271b6

Please sign in to comment.