Skip to content

Commit 7ac2430

Browse files
committed
Merge pull request #787 from rancher/updatecli_main-source_1df24b328e59ff2e968c37f2a8f2f8290daa6f92c129028317023af316f89bbd
Update CoreDNS chart 1.44.3
1 parent 2b8869d commit 7ac2430

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+3127
-0
lines changed
21.3 KB
Binary file not shown.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*~
18+
# Various IDEs
19+
.project
20+
.idea/
21+
*.tmproj
22+
OWNERS
23+
*.tests
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
annotations:
2+
artifacthub.io/changes: |
3+
- kind: changed
4+
description: Use tpl function for affinity values
5+
- kind: added
6+
description: Add kubernetes plugin multicluster required RBAC
7+
apiVersion: v2
8+
appVersion: 1.12.3
9+
description: CoreDNS is a DNS server that chains plugins and provides Kubernetes DNS
10+
Services
11+
home: https://coredns.io
12+
icon: https://coredns.io/images/CoreDNS_Colour_Horizontal.png
13+
keywords:
14+
- coredns
15+
- dns
16+
- kubedns
17+
maintainers:
18+
- name: mrueg
19+
- name: haad
20+
- name: hagaibarel
21+
- name: shubham-cmyk
22+
name: rke2-coredns
23+
sources:
24+
- https://github.com/coredns/coredns
25+
type: application
26+
version: 1.44.300

charts/rke2-coredns/rke2-coredns/1.44.300/README.md

Lines changed: 317 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{{- if .Values.isClusterService }}
2+
CoreDNS is now running in the cluster as a cluster-service.
3+
{{- else }}
4+
CoreDNS is now running in the cluster.
5+
It can be accessed using the below endpoint
6+
{{- if contains "NodePort" .Values.serviceType }}
7+
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "coredns.fullname" . }})
8+
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
9+
echo "$NODE_IP:$NODE_PORT"
10+
{{- else if contains "LoadBalancer" .Values.serviceType }}
11+
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
12+
You can watch the status by running 'kubectl get svc -w {{ template "coredns.fullname" . }}'
13+
14+
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "coredns.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
15+
echo $SERVICE_IP
16+
{{- else if contains "ClusterIP" .Values.serviceType }}
17+
"{{ template "coredns.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local"
18+
from within the cluster
19+
{{- end }}
20+
{{- end }}
21+
22+
It can be tested with the following:
23+
24+
1. Launch a Pod with DNS tools:
25+
26+
kubectl run -it --rm --restart=Never --image=infoblox/dnstools:latest dnstools
27+
28+
2. Query the DNS server:
29+
30+
/ # host kubernetes
Lines changed: 302 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,302 @@
1+
{{/* vim: set filetype=mustache: */}}
2+
{{/*
3+
Expand the name of the chart.
4+
*/}}
5+
{{- define "coredns.name" -}}
6+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
7+
{{- end -}}
8+
9+
{{/*
10+
Create a default fully qualified app name.
11+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
12+
*/}}
13+
{{- define "coredns.fullname" -}}
14+
{{- if .Values.fullnameOverride -}}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
16+
{{- else -}}
17+
{{- $name := default .Chart.Name .Values.nameOverride -}}
18+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
19+
{{- end -}}
20+
{{- end -}}
21+
22+
{{/*
23+
Common labels
24+
*/}}
25+
{{- define "coredns.labels" -}}
26+
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
27+
app.kubernetes.io/instance: {{ .Release.Name | quote }}
28+
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
29+
{{- if .Values.isClusterService }}
30+
k8s-app: {{ template "coredns.k8sapplabel" . }}
31+
kubernetes.io/cluster-service: "true"
32+
kubernetes.io/name: "CoreDNS"
33+
{{- end }}
34+
app.kubernetes.io/name: {{ template "coredns.name" . }}
35+
{{- end -}}
36+
37+
{{/*
38+
Common labels with autoscaler
39+
*/}}
40+
{{- define "coredns.labels.autoscaler" -}}
41+
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
42+
app.kubernetes.io/instance: {{ .Release.Name | quote }}
43+
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
44+
{{- if .Values.isClusterService }}
45+
k8s-app: {{ template "coredns.k8sapplabel" . }}-autoscaler
46+
kubernetes.io/cluster-service: "true"
47+
kubernetes.io/name: "CoreDNS"
48+
{{- end }}
49+
app.kubernetes.io/name: {{ template "coredns.name" . }}-autoscaler
50+
{{- end -}}
51+
52+
{{/*
53+
Allow k8s-app label to be overridden
54+
*/}}
55+
{{- define "coredns.k8sapplabel" -}}
56+
{{- coalesce .Values.k8sApp .Values.k8sAppLabelOverride .Chart.Name | trunc 63 | trimSuffix "-" -}}
57+
{{- end -}}
58+
59+
{{/*
60+
Generate the list of ports automatically from the server definitions
61+
*/}}
62+
{{- define "coredns.servicePorts" -}}
63+
{{/* Set ports to be an empty dict */}}
64+
{{- $ports := dict -}}
65+
{{/* Iterate through each of the server blocks */}}
66+
{{- range .Values.servers -}}
67+
{{/* Capture port to avoid scoping awkwardness */}}
68+
{{- $port := toString .port -}}
69+
{{- $serviceport := default .port .servicePort -}}
70+
71+
{{/* If none of the server blocks has mentioned this port yet take note of it */}}
72+
{{- if not (hasKey $ports $port) -}}
73+
{{- $ports := set $ports $port (dict "istcp" false "isudp" false "serviceport" $serviceport) -}}
74+
{{- end -}}
75+
{{/* Retrieve the inner dict that holds the protocols for a given port */}}
76+
{{- $innerdict := index $ports $port -}}
77+
78+
{{/*
79+
Look at each of the zones and check which protocol they serve
80+
At the moment the following are supported by CoreDNS:
81+
UDP: dns://
82+
TCP: tls://, grpc://, https://
83+
*/}}
84+
{{- range .zones -}}
85+
{{- if has (default "" .scheme) (list "dns://" "") -}}
86+
{{/* Optionally enable tcp for this service as well */}}
87+
{{- if eq (default false .use_tcp) true }}
88+
{{- $innerdict := set $innerdict "istcp" true -}}
89+
{{- end }}
90+
{{- $innerdict := set $innerdict "isudp" true -}}
91+
{{- end -}}
92+
93+
{{- if has (default "" .scheme) (list "tls://" "grpc://" "https://") -}}
94+
{{- $innerdict := set $innerdict "istcp" true -}}
95+
{{- end -}}
96+
{{- end -}}
97+
98+
{{/* If none of the zones specify scheme, default to dns:// on both tcp & udp */}}
99+
{{- if and (not (index $innerdict "istcp")) (not (index $innerdict "isudp")) -}}
100+
{{- $innerdict := set $innerdict "isudp" true -}}
101+
{{- $innerdict := set $innerdict "istcp" true -}}
102+
{{- end -}}
103+
104+
{{- if .nodePort -}}
105+
{{- $innerdict := set $innerdict "nodePort" .nodePort -}}
106+
{{- end -}}
107+
108+
{{/* Write the dict back into the outer dict */}}
109+
{{- $ports := set $ports $port $innerdict -}}
110+
{{- end -}}
111+
112+
{{/* Write out the ports according to the info collected above */}}
113+
{{- range $port, $innerdict := $ports -}}
114+
{{- $portList := list -}}
115+
{{- if index $innerdict "isudp" -}}
116+
{{- $portList = append $portList (dict "port" (get $innerdict "serviceport") "protocol" "UDP" "name" (printf "udp-%s" $port) "targetPort" ($port | int)) -}}
117+
{{- end -}}
118+
{{- if index $innerdict "istcp" -}}
119+
{{- $portList = append $portList (dict "port" (get $innerdict "serviceport") "protocol" "TCP" "name" (printf "tcp-%s" $port) "targetPort" ($port | int)) -}}
120+
{{- end -}}
121+
122+
{{- range $portDict := $portList -}}
123+
{{- if index $innerdict "nodePort" -}}
124+
{{- $portDict := set $portDict "nodePort" (get $innerdict "nodePort" | int) -}}
125+
{{- end -}}
126+
127+
{{- printf "- %s\n" (toJson $portDict) -}}
128+
{{- end -}}
129+
{{- end -}}
130+
{{- end -}}
131+
132+
{{/*
133+
Generate the list of ports automatically from the server definitions
134+
*/}}
135+
{{- define "coredns.containerPorts" -}}
136+
{{/* Set ports to be an empty dict */}}
137+
{{- $ports := dict -}}
138+
{{/* Iterate through each of the server blocks */}}
139+
{{- range .Values.servers -}}
140+
{{/* Capture port to avoid scoping awkwardness */}}
141+
{{- $port := toString .port -}}
142+
143+
{{/* If none of the server blocks has mentioned this port yet take note of it */}}
144+
{{- if not (hasKey $ports $port) -}}
145+
{{- $ports := set $ports $port (dict "istcp" false "isudp" false) -}}
146+
{{- end -}}
147+
{{/* Retrieve the inner dict that holds the protocols for a given port */}}
148+
{{- $innerdict := index $ports $port -}}
149+
150+
{{/*
151+
Look at each of the zones and check which protocol they serve
152+
At the moment the following are supported by CoreDNS:
153+
UDP: dns://
154+
TCP: tls://, grpc://, https://
155+
*/}}
156+
{{- range .zones -}}
157+
{{- if has (default "" .scheme) (list "dns://" "") -}}
158+
{{/* Optionally enable tcp for this service as well */}}
159+
{{- if eq (default false .use_tcp) true }}
160+
{{- $innerdict := set $innerdict "istcp" true -}}
161+
{{- end }}
162+
{{- $innerdict := set $innerdict "isudp" true -}}
163+
{{- end -}}
164+
165+
{{- if has (default "" .scheme) (list "tls://" "grpc://" "https://") -}}
166+
{{- $innerdict := set $innerdict "istcp" true -}}
167+
{{- end -}}
168+
{{- end -}}
169+
170+
{{/* If none of the zones specify scheme, default to dns:// on both tcp & udp */}}
171+
{{- if and (not (index $innerdict "istcp")) (not (index $innerdict "isudp")) -}}
172+
{{- $innerdict := set $innerdict "isudp" true -}}
173+
{{- $innerdict := set $innerdict "istcp" true -}}
174+
{{- end -}}
175+
176+
{{- if .hostPort -}}
177+
{{- $innerdict := set $innerdict "hostPort" .hostPort -}}
178+
{{- end -}}
179+
180+
{{/* Write the dict back into the outer dict */}}
181+
{{- $ports := set $ports $port $innerdict -}}
182+
183+
{{/* Fetch port from the configuration if the prometheus section exists */}}
184+
{{- range .plugins -}}
185+
{{- if eq .name "prometheus" -}}
186+
{{- $prometheus_addr := toString .parameters -}}
187+
{{- $prometheus_addr_list := regexSplit ":" $prometheus_addr -1 -}}
188+
{{- $prometheus_port := index $prometheus_addr_list 1 -}}
189+
{{- $ports := set $ports $prometheus_port (dict "istcp" true "isudp" false) -}}
190+
{{- end -}}
191+
{{- end -}}
192+
{{- end -}}
193+
194+
{{/* Write out the ports according to the info collected above */}}
195+
{{- range $port, $innerdict := $ports -}}
196+
{{- $portList := list -}}
197+
{{- if index $innerdict "isudp" -}}
198+
{{- $portList = append $portList (dict "containerPort" ($port | int) "protocol" "UDP" "name" (printf "udp-%s" $port)) -}}
199+
{{- end -}}
200+
{{- if index $innerdict "istcp" -}}
201+
{{- $portList = append $portList (dict "containerPort" ($port | int) "protocol" "TCP" "name" (printf "tcp-%s" $port)) -}}
202+
{{- end -}}
203+
204+
{{- range $portDict := $portList -}}
205+
{{- if index $innerdict "hostPort" -}}
206+
{{- $portDict := set $portDict "hostPort" (get $innerdict "hostPort" | int) -}}
207+
{{- end -}}
208+
209+
{{- printf "- %s\n" (toJson $portDict) -}}
210+
{{- end -}}
211+
{{- end -}}
212+
{{- end -}}
213+
214+
{{/*
215+
Create the name of the service account to use
216+
*/}}
217+
{{- define "coredns.serviceAccountName" -}}
218+
{{- if .Values.serviceAccount.create -}}
219+
{{ default (include "coredns.fullname" .) .Values.serviceAccount.name }}
220+
{{- else -}}
221+
{{ default "default" .Values.serviceAccount.name }}
222+
{{- end -}}
223+
{{- end -}}
224+
225+
{{/*
226+
Create the name of the service account to use
227+
*/}}
228+
{{- define "coredns.clusterRoleName" -}}
229+
{{- if and .Values.clusterRole .Values.clusterRole.nameOverride -}}
230+
{{ .Values.clusterRole.nameOverride }}
231+
{{- else -}}
232+
{{ template "coredns.fullname" . }}
233+
{{- end -}}
234+
{{- end -}}
235+
236+
{{- define "system_default_registry" -}}
237+
{{- if .Values.global.systemDefaultRegistry -}}
238+
{{- printf "%s/" .Values.global.systemDefaultRegistry -}}
239+
{{- else -}}
240+
{{- "" -}}
241+
{{- end -}}
242+
{{- end -}}
243+
244+
{{/*
245+
Set the clusterDNS service IP
246+
*/}}
247+
{{- define "clusterDNSServerIP" -}}
248+
{{- if .Values.service.clusterIP }}
249+
{{- .Values.service.clusterIP }}
250+
{{ else }}
251+
{{- $dnsIPs := split "," .Values.global.clusterDNS }}
252+
{{- $dnsCount := len $dnsIPs }}
253+
{{- if eq $dnsCount 1 }}
254+
{{- .Values.global.clusterDNS -}}
255+
{{- else }}
256+
{{- if gt $dnsCount 1 }}
257+
{{- $dnsIPs._0 -}}
258+
{{ else }}
259+
{{- "10.43.0.10" }}
260+
{{- end }}
261+
{{- end }}
262+
{{- end }}
263+
{{- end }}
264+
265+
{{/*
266+
Pass the clusterDNS service IP for the nodelocal config
267+
*/}}
268+
{{- define "nodelocalUpstreamDNSServerIP" -}}
269+
{{- if .Values.nodelocal.ipvs }}
270+
{{- "" -}}
271+
{{ else }}
272+
{{- (include "clusterDNSServerIP" .) -}}
273+
{{- end }}
274+
{{- end }}
275+
276+
{{/*
277+
Fill the localip flag in the nodelocal CLI
278+
*/}}
279+
{{- define "nodelocalLocalIPFlag" -}}
280+
{{- if .Values.nodelocal.ipvs }}
281+
{{- "" -}}
282+
{{ else }}
283+
{{- printf ",%s" (include "clusterDNSServerIP" .) -}}
284+
{{- end }}
285+
{{- end }}
286+
287+
{{/*
288+
Fill the ipFamily correctly
289+
*/}}
290+
{{- define "ipFamilyPolicy" -}}
291+
{{- if .Values.service.ipFamilyPolicy }}
292+
{{- .Values.service.ipFamilyPolicy }}
293+
{{ else }}
294+
{{- $dnsIPs := split "," .Values.global.clusterDNS }}
295+
{{- $dnsCount := len $dnsIPs }}
296+
{{- if gt $dnsCount 1 }}
297+
{{- "PreferDualStack" }}
298+
{{ else }}
299+
{{- "SingleStack" }}
300+
{{- end }}
301+
{{- end }}
302+
{{- end }}

0 commit comments

Comments
 (0)