Skip to content

Commit

Permalink
Dify: add global.labels to values file
Browse files Browse the repository at this point in the history
  • Loading branch information
kaktos committed Jun 19, 2024
1 parent 69c84f8 commit 1357fb2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions charts/dify/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ app.kubernetes.io/name: {{ include "dify.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Global labels
*/}}
{{- define "dify.global.labels" -}}
{{- if .Values.global.labels }}
{{- toYaml .Values.global.labels }}
{{- end -}}
{{- end -}}

{{/*
Create the name of the service account to use
*/}}
Expand Down
8 changes: 8 additions & 0 deletions charts/dify/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ metadata:
labels:
{{- include "dify.labels" . | nindent 4 }}
app.kubernetes.io/component: api
{{- include "dify.global.labels" . | nindent 4 }}
spec:
{{- if not .Values.api.autoscaling.enabled }}
replicas: {{ .Values.api.replicaCount }}
Expand All @@ -24,6 +25,7 @@ spec:
labels:
{{- include "dify.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: api
{{- include "dify.global.labels" . | nindent 8 }}
spec:
{{- with .Values.api.imagePullSecrets }}
imagePullSecrets:
Expand Down Expand Up @@ -108,6 +110,7 @@ metadata:
labels:
{{- include "dify.labels" . | nindent 4 }}
app.kubernetes.io/component: worker
{{- include "dify.global.labels" . | nindent 4 }}
spec:
{{- if not .Values.worker.autoscaling.enabled }}
replicas: {{ .Values.worker.replicaCount }}
Expand All @@ -125,6 +128,7 @@ spec:
labels:
{{- include "dify.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: worker
{{- include "dify.global.labels" . | nindent 8 }}
spec:
{{- with .Values.worker.imagePullSecrets }}
imagePullSecrets:
Expand Down Expand Up @@ -192,6 +196,7 @@ metadata:
labels:
{{- include "dify.labels" . | nindent 4 }}
app.kubernetes.io/component: frontend
{{- include "dify.global.labels" . | nindent 4 }}
spec:
{{- if not .Values.frontend.autoscaling.enabled }}
replicas: {{ .Values.frontend.replicaCount }}
Expand All @@ -209,6 +214,7 @@ spec:
labels:
{{- include "dify.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: frontend
{{- include "dify.global.labels" . | nindent 8 }}
spec:
{{- with .Values.frontend.imagePullSecrets }}
imagePullSecrets:
Expand Down Expand Up @@ -268,6 +274,7 @@ metadata:
labels:
{{- include "dify.labels" . | nindent 4 }}
app.kubernetes.io/component: sandbox
{{- include "dify.global.labels" . | nindent 4 }}
spec:
{{- if not .Values.sandbox.autoscaling.enabled }}
replicas: {{ .Values.sandbox.replicaCount }}
Expand All @@ -285,6 +292,7 @@ spec:
labels:
{{- include "dify.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: sandbox
{{- include "dify.global.labels" . | nindent 8 }}
spec:
{{- with .Values.sandbox.imagePullSecrets }}
imagePullSecrets:
Expand Down
1 change: 1 addition & 0 deletions charts/dify/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ global:
# secretKeyRef:
# name: dify
# key: SECRET_KEY
labels: {}

ingress:
enabled: false
Expand Down

0 comments on commit 1357fb2

Please sign in to comment.