Skip to content

Commit

Permalink
Dify: add global.labels to values file (#91)
Browse files Browse the repository at this point in the history
* Dify: add global.labels to values file

* Dify: bump Chart version

* add comment for global.labels

* Update charts/dify/values.yaml

---------

Co-authored-by: Leo Q <LeoQuote@users.noreply.github.com>
  • Loading branch information
kaktos and LeoQuote authored Jun 20, 2024
1 parent 69c84f8 commit 3fa7828
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/dify/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.4.0
version: 0.4.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
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
3 changes: 3 additions & 0 deletions charts/dify/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ global:
# name: dify
# key: SECRET_KEY

# Provide extra labels for all deployments and related pods of this chart
labels: {}

ingress:
enabled: false
className: ""
Expand Down

0 comments on commit 3fa7828

Please sign in to comment.