Skip to content

Commit

Permalink
Fix prefix for named templates
Browse files Browse the repository at this point in the history
  • Loading branch information
kvaps committed Jul 20, 2021
1 parent ed78b51 commit fed78ea
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion deploy/helm/kubernetes/manifests/coredns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ metadata:
spec:
selector:
k8s-app: kube-dns
clusterIP: {{ template "getCoreDNS" . }}
clusterIP: {{ template "kubernetes.getCoreDNS" . }}
ports:
- name: dns
port: 53
Expand Down
4 changes: 2 additions & 2 deletions deploy/helm/kubernetes/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ Generate etcd servers list.
{{/*
Take the first IP address from the serviceClusterIPRange for the kube-dns service.
*/}}
{{- define "getCoreDNS" -}}
{{- define "kubernetes.getCoreDNS" -}}
{{- $octetsList := splitList "." .Values.apiServer.serviceClusterIPRange -}}
{{- printf "%d.%d.%d.%d" (index $octetsList 0 | int) (index $octetsList 1 | int) (index $octetsList 2 | int) 10 -}}
{{- end -}}

{{- define "getAPIAddress" -}}
{{- define "kubernetes.getAPIAddress" -}}
{{- $octetsList := splitList "." .Values.apiServer.serviceClusterIPRange -}}
{{- printf "%d.%d.%d.%d" (index $octetsList 0 | int) (index $octetsList 1 | int) (index $octetsList 2 | int) 1 -}}
{{- end -}}
6 changes: 3 additions & 3 deletions deploy/helm/kubernetes/templates/kubernetes-certs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ spec:
{{- end }}
ipAddresses:
- "127.0.0.1"
- "{{- template "getAPIAddress" . }}"
- "{{- template "kubernetes.getAPIAddress" . }}"
{{- with .Values.apiServer.service.loadBalancerIP }}
{{- if not (has . $.Values.apiServer.certSANs.ipAddresses) }}
- {{ . | quote }}
Expand Down Expand Up @@ -122,7 +122,7 @@ spec:
{{- end }}
ipAddresses:
- "127.0.0.1"
- "{{- template "getAPIAddress" . }}"
- "{{- template "kubernetes.getAPIAddress" . }}"
{{- with .Values.apiServer.service.loadBalancerIP }}
{{- if not (has . $.Values.apiServer.certSANs.ipAddresses) }}
- {{ . | quote }}
Expand Down Expand Up @@ -164,7 +164,7 @@ spec:
{{- end }}
ipAddresses:
- "127.0.0.1"
- "{{- template "getAPIAddress" . }}"
- "{{- template "kubernetes.getAPIAddress" . }}"
{{- with .Values.apiServer.service.loadBalancerIP }}
{{- if not (has . $.Values.apiServer.certSANs.ipAddresses) }}
- {{ . | quote }}
Expand Down

0 comments on commit fed78ea

Please sign in to comment.