Skip to content

Instantly share code, notes, and snippets.

@EvilFreelancer
Last active April 25, 2023 23:16
Show Gist options
  • Select an option

  • Save EvilFreelancer/8a36563fd3e4318f2474ceb484e66027 to your computer and use it in GitHub Desktop.

Select an option

Save EvilFreelancer/8a36563fd3e4318f2474ceb484e66027 to your computer and use it in GitHub Desktop.
Использование циклов в шаблонах
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}
spec:
selector:
app: {{ .Release.Name }}
ports:
{{- range .Values.service.ports }}
- name: {{ .name }}
protocol: TCP
port: {{ .port }}
targetPort: {{ .targetPort }}
{{- end }}
service:
ports:
- name: http
port: 80
targetPort: 8080
- name: https
port: 443
targetPort: 8443
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment