diff --git a/charts/operator-wandb/Chart.yaml b/charts/operator-wandb/Chart.yaml index 7b7aae13..3d135490 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.12.11 +version: 0.13.0 appVersion: 1.0.0 icon: https://wandb.ai/logo.svg diff --git a/charts/operator-wandb/templates/_ingress.tpl b/charts/operator-wandb/templates/_ingress.tpl index abfbc38a..e2cd6d52 100644 --- a/charts/operator-wandb/templates/_ingress.tpl +++ b/charts/operator-wandb/templates/_ingress.tpl @@ -38,3 +38,27 @@ It expects a dictionary with two entries: {{- define "defaultHost" -}} {{- replace "https://" "" (replace "http://" "" .Values.global.host) }} {{- end -}} + + +{{- define "IngressPath" -}} +- pathType: Prefix + path: / + backend: + service: + {{- if eq $.Values.ingress.defaultBackend "console" }} + name: {{ $.Release.Name }}-console + port: + number: 8082 + {{- else }} + name: {{ $.Release.Name }}-app + port: + number: 8080 + {{- end }} +- pathType: Prefix + path: /console + backend: + service: + name: {{ $.Release.Name }}-console + port: + number: 8082 +{{- end }} \ No newline at end of file diff --git a/charts/operator-wandb/templates/ingress.yaml b/charts/operator-wandb/templates/ingress.yaml index b204845f..ad7ca341 100644 --- a/charts/operator-wandb/templates/ingress.yaml +++ b/charts/operator-wandb/templates/ingress.yaml @@ -22,6 +22,7 @@ spec: {{- end }} {{- if .Values.ingress.install }} --- +{{- if .Values.ingress.create }} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: @@ -54,29 +55,54 @@ spec: {{- end }} rules: + {{- $dot := . }} {{- range concat (list $defaultHost) .Values.ingress.additionalHosts }} - host: {{ . }} http: paths: - - pathType: Prefix - path: / - backend: - service: - {{- if eq $.Values.ingress.defaultBackend "console" }} - name: {{ $.Release.Name }}-console - port: - number: 8082 - {{- else }} - name: {{ $.Release.Name }}-app - port: - number: 8080 - {{- end }} - - pathType: Prefix - path: /console - backend: - service: - name: {{ $.Release.Name }}-console - port: - number: 8082 + {{- include "IngressPath" $dot | nindent 6 }} {{- end }} {{- end }} +{{- end }} +--- +{{- if .Values.ingress.secondary.create }} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ default .Release.Name .Values.ingress.secondary.nameOverride }} + labels: + {{- include "wandb.commonLabels" . | nindent 4 }} + {{- if .Values.ingress.secondary.labels -}} + {{- toYaml .Values.ingress.secondary.labels | nindent 4 }} + {{- end }} + annotations: + {{- if .Values.ingress.secondary.issuer.create }} + "cert-manager.io/issuer": "{{ .Release.Name }}-issuer" + "cert-manager.io/acme-challenge-type": "http01" + "kubernetes.io/ingress.allow-http" : "false" + {{- end }} + + {{- if .Values.ingress.secondary.annotations -}} + {{- toYaml .Values.ingress.secondary.annotations | nindent 4 }} + {{- end }} +spec: + ingressClassName: {{ .Values.ingress.secondary.class }} + {{- $defaultHost := include "defaultHost" . -}} + + {{- if .Values.ingress.secondary.issuer.create }} + tls: + - host: [{{ $defaultHost }}] + secretName: {{ .Release.Name }}-tls + {{- else }} + tls: {{ toYaml .Values.ingress.secondary.tls | nindent 4 }} + {{- end }} + + rules: + {{- $dot := . }} + {{- range concat (list $defaultHost) .Values.ingress.secondary.additionalHosts }} + - host: {{ . }} + http: + paths: + {{- include "IngressPath" $dot | nindent 6 }} + {{- end }} + {{- end }} \ No newline at end of file diff --git a/charts/operator-wandb/values.yaml b/charts/operator-wandb/values.yaml index 91d73a88..be2c1a5b 100644 --- a/charts/operator-wandb/values.yaml +++ b/charts/operator-wandb/values.yaml @@ -104,6 +104,7 @@ global: ingress: install: true + create: true nameOverride: "" defaultBackend: "app" annotations: {} @@ -116,6 +117,21 @@ ingress: provider: "" server: https://acme-v02.api.letsencrypt.org/directory email: support@wandb.com + secondary: + create: false + install: true + nameOverride: "" + defaultBackend: "app" + annotations: {} + labels: {} + tls: [] + additionalHosts: [] + class: "" + issuer: + create: false + provider: "" + server: https://acme-v02.api.letsencrypt.org/directory + email: support@wandb.com parquet: install: true