Created
April 25, 2023 23:17
-
-
Save EvilFreelancer/7f7ea72af839e43c22018112846a3939 to your computer and use it in GitHub Desktop.
Использование вложенных шаблонов
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # templates/_helpers.tpl | |
| {{- define "my-chart.labels" }} | |
| labels: | |
| app: {{ .Release.Name }} | |
| chart: {{ .Chart.Name }}-{{ .Chart.Version }} | |
| release: {{ .Release.Name }} | |
| heritage: {{ .Release.Service }} | |
| {{- end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # templates/deployment.yaml | |
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: {{ .Release.Name }} | |
| {{- include "my-chart.labels" . }} | |
| spec: | |
| replicas: {{ .Values.deployment.replicas }} | |
| selector: | |
| matchLabels: | |
| app: {{ .Release.Name }} | |
| template: | |
| metadata: | |
| {{- include "my-chart.labels" . }} | |
| spec: | |
| containers: | |
| - name: {{ .Release.Name }} | |
| image: "{{ .Values.deployment.image.repository }}:{{ .Values.deployment.image.tag }}" | |
| ports: | |
| - containerPort: {{ .Values.deployment.containerPort }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment