Skip to content

Commit

Permalink
chore(weave): Use app fullname for weave auth (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwlee64 authored Apr 16, 2024
1 parent f39f42c commit 6105c97
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 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.12.7
version: 0.12.8
appVersion: 1.0.0
icon: https://wandb.ai/logo.svg

Expand Down
20 changes: 19 additions & 1 deletion charts/operator-wandb/charts/weave/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Expand the name of the chart.
{{- end }}

{{/*
Create a default fully qualified app name.
Create a default fully qualified app name. (Should be something like wandb-weave)
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
Expand All @@ -25,6 +25,24 @@ If release name contains chart name it will be used as a full name.
{{- end }}
{{- end }}

{{/*
Create a default fully qualified app name. (Should be something like wandb-app)
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "weave.appFullname" -}}
{{- if .Values.app.fullnameOverride }}
{{- .Values.app.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Values.app.serviceName .Values.app.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ spec:
- name: WEAVE_LOCAL_ARTIFACT_DIR
value: /vol/weave/cache
- name: WEAVE_AUTH_GRAPHQL_URL
value: {{ .Values.global.host }}/graphql
value: http://{{ include "weave.appFullname" . }}.{{ $.Release.Namespace }}.svc.{{ .Values.app.clusterDomain }}:8080/graphql
- name: WEAVE_SERVER_NUM_WORKERS
value: "4"

Expand Down
7 changes: 7 additions & 0 deletions charts/operator-wandb/charts/weave/values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
enabled: true

# These need to be set as well if app name overrides are set
app:
serviceName: "app"
clusterDomain: "cluster.local"
nameOverride: ""
fullnameOverride: ""

nameOverride: ""
fullnameOverride: ""

Expand Down

0 comments on commit 6105c97

Please sign in to comment.