|
2 | 2 | Expand the name of the chart.
|
3 | 3 | */}}
|
4 | 4 | {{- define "application.name" -}}
|
5 |
| -{{- default .Chart.Name .Values.server.name | trunc 63 | trimSuffix "-" }} |
| 5 | +{{- .Values.server.name | default (printf "%s-%s" .Release.Name "server") | trunc 63 | trimSuffix "-" }} |
6 | 6 | {{- end }}
|
7 | 7 |
|
8 | 8 | {{- define "application.server.name" -}}
|
9 |
| -{{- default .Chart.Name .Values.server.name | trunc 63 | trimSuffix "-" }} |
| 9 | +{{- .Values.server.name | default (printf "%s-%s" .Release.Name "server") | trunc 63 | trimSuffix "-" }} |
10 | 10 | {{- end }}
|
11 | 11 |
|
12 | 12 | {{- define "application.worker.name" -}}
|
13 |
| -{{- default .Chart.Name .Values.worker.name | trunc 63 | trimSuffix "-" }} |
| 13 | +{{- .Values.worker.name | default (printf "%s-%s" .Release.Name "worker") | trunc 63 | trimSuffix "-" }} |
14 | 14 | {{- end }}
|
15 | 15 |
|
16 | 16 | {{- define "application.scheduler.name" -}}
|
17 |
| -{{- default .Chart.Name .Values.scheduler.name | trunc 63 | trimSuffix "-" }} |
| 17 | +{{- .Values.scheduler.name | default (printf "%s-%s" .Release.Name "scheduler" ) | trunc 63 | trimSuffix "-" }} |
18 | 18 | {{- end }}
|
19 | 19 |
|
20 | 20 | {{/*
|
@@ -45,56 +45,81 @@ Create chart name and version as used by the chart label.
|
45 | 45 | {{/*
|
46 | 46 | Common labels
|
47 | 47 | */}}
|
48 |
| -{{- define "application.labels" -}} |
49 |
| -helm.sh/chart: {{ .Release.Name }} |
50 |
| -app.kubernetes.io/version: {{ .Release.Revision | quote }} |
| 48 | +{{- define "application.commonLabels" -}} |
| 49 | +helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
51 | 50 | app.kubernetes.io/managed-by: {{ .Release.Service }}
|
52 | 51 | app.modusign.co.kr/zone: {{ .Release.Namespace }}
|
| 52 | +app.kubernetes.io/env: {{ .Values.global.runtimeEnv | default "stage" }} |
| 53 | +env: {{ .Values.global.runtimeEnv | default "stage" }} |
| 54 | +app.kubernetes.io/instance: {{ .Release.Name }} |
| 55 | +app.kubernetes.io/part-of: {{ .Release.Name }} |
53 | 56 | {{- if .Values.global.observability.datadog.admissionController.enabled }}
|
54 |
| -tags.datadoghq.com/env: {{ default "stage" .Values.global.env.DD_ENV}} |
| 57 | +tags.datadoghq.com/env: {{ .Values.global.env.DD_ENV | .Values.global.runtimeEnv | default "stage" }} |
55 | 58 | tags.datadoghq.com/service: {{ .Release.Name }}
|
56 |
| -tags.datadoghq.com/version: {{ .Release.Revision | quote }} |
| 59 | +tags.datadoghq.com/version: {{ .Values.global.image.tag | quote }} |
57 | 60 | {{- end }}
|
58 | 61 | {{- with .Values.global.additionalLabels }}
|
59 | 62 | {{ toYaml . }}
|
60 | 63 | {{- end }}
|
61 | 64 | {{- end }}
|
62 | 65 |
|
63 | 66 | {{/*
|
64 |
| -Selector labels |
| 67 | +Each Component labels |
65 | 68 | */}}
|
66 |
| -{{- define "application.server.selectorLabels" -}} |
67 |
| -app: {{ (.Values.server.name | default .Chart.Name )| lower}} |
68 |
| -version: {{ .Chart.Version }} |
| 69 | +{{- define "application.server.labels" -}} |
| 70 | +{{ include "application.commonLabels" . }} |
| 71 | +app.kubernetes.io/name: {{ include "application.server.name" . }} |
| 72 | +app.kubernetes.io/version: {{ include "application.server.image.tag" . }} |
| 73 | +app.kubernetes.io/component: server |
| 74 | + |
69 | 75 | {{- end }}
|
70 | 76 |
|
71 |
| -{{- define "application.scheduler.selectorLabels" -}} |
72 |
| -app: {{ (.Values.scheduler.name | default .Chart.Name )| lower}} |
73 |
| -version: {{ .Chart.Version | quote }} |
| 77 | +{{- define "application.scheduler.labels" -}} |
| 78 | +{{ include "application.commonLabels" . }} |
| 79 | +app.kubernetes.io/name: {{ include "application.scheduler.name" . }} |
| 80 | +app.kubernetes.io/version: {{ include "application.scheduler.image.tag" . }} |
| 81 | +app.kubernetes.io/component: scheduler |
74 | 82 | {{- end }}
|
75 | 83 |
|
76 |
| -{{- define "application.worker.selectorLabels" -}} |
77 |
| -app: {{ (.Values.worker.name | default .Chart.Name )| lower}} |
78 |
| -version: {{ .Chart.Version | quote }} |
| 84 | +{{- define "application.worker.labels" -}} |
| 85 | +{{ include "application.commonLabels" . }} |
| 86 | +app.kubernetes.io/name: {{ include "application.worker.name" . }} |
| 87 | +app.kubernetes.io/version: {{ include "application.worker.image.tag" . }} |
| 88 | +app.kubernetes.io/component: worker |
79 | 89 | {{- end }}
|
80 | 90 |
|
81 | 91 |
|
82 | 92 | {{/*
|
83 |
| -matchLabels labels |
| 93 | +Image tags(version) |
84 | 94 | */}}
|
85 |
| -{{- define "application.server.matchLabels" -}} |
86 |
| -app: {{ (.Values.server.name | default .Chart.Name )| lower}} |
87 |
| -version: {{ .Chart.Version }} |
| 95 | +{{- define "application.server.image.tag" -}} |
| 96 | +{{ .Values.server.image.tag | default .Values.global.image.tag }} |
88 | 97 | {{- end }}
|
89 | 98 |
|
90 |
| -{{- define "application.scheduler.matchLabels" -}} |
91 |
| -app: {{ (.Values.scheduler.name | default .Chart.Name )| lower}} |
92 |
| -version: {{ .Chart.Version | quote }} |
| 99 | +{{- define "application.scheduler.image.tag" -}} |
| 100 | +{{ .Values.scheduler.image.tag | default .Values.global.image.tag }} |
93 | 101 | {{- end }}
|
94 | 102 |
|
95 |
| -{{- define "application.worker.matchLabels" -}} |
96 |
| -app: {{ (.Values.worker.name | default .Chart.Name )| lower}} |
97 |
| -version: {{ .Chart.Version | quote }} |
| 103 | +{{- define "application.worker.image.tag" -}} |
| 104 | +{{ .Values.worker.image.tag | default .Values.global.image.tag }} |
| 105 | +{{- end }} |
| 106 | + |
| 107 | +{{/* |
| 108 | +Selector labels |
| 109 | +*/}} |
| 110 | +{{- define "application.server.selectorLabels" -}} |
| 111 | +app: {{ include "application.server.name" . }} |
| 112 | +version: {{ include "application.server.image.tag" . }} |
| 113 | +{{- end }} |
| 114 | + |
| 115 | +{{- define "application.scheduler.selectorLabels" -}} |
| 116 | +app: {{ include "application.scheduler.name" . }} |
| 117 | +version: {{ include "application.scheduler.image.tag" . }} |
| 118 | +{{- end }} |
| 119 | + |
| 120 | +{{- define "application.worker.selectorLabels" -}} |
| 121 | +app: {{ include "application.worker.name" . }} |
| 122 | +version: {{ include "application.worker.image.tag" . }} |
98 | 123 | {{- end }}
|
99 | 124 |
|
100 | 125 |
|
|
0 commit comments