File tree 12 files changed +123
-45
lines changed
12 files changed +123
-45
lines changed Original file line number Diff line number Diff line change 61
61
nameservers :
62
62
- 10.96.0.10
63
63
searches :
64
- - " svc.{{ .clusterDomain }} "
65
- - " {{ .podNamespace }}.svc.{{ .clusterDomain }} "
64
+ - " svc.cluster.local "
65
+ - " {{ .podNamespace }}.svc.cluster.local "
66
66
options :
67
67
- name : ndots
68
68
value : " 2"
Original file line number Diff line number Diff line change
1
+ {{- if .Values.dnsclass.enabled }}
2
+ apiVersion : batch/v1
3
+ kind : Job
4
+ metadata :
5
+ name : {{ include "chart.fullname" . }}-api-check
6
+ namespace : {{ .Release.Namespace }}
7
+ annotations :
8
+ helm.sh/hook : post-install,post-upgrade
9
+ helm.sh/hook-weight : " 3"
10
+ helm.sh/hook-delete-policy : hook-succeeded
11
+ labels :
12
+ app.kubernetes.io/component : api-check
13
+ app.kubernetes.io/part-of : kubedns-shepherd
14
+ {{- include "chart.labels" . | nindent 4 }}
15
+ spec :
16
+ template :
17
+ spec :
18
+ containers :
19
+ - name : api-check
20
+ image : quay.io/curl/curl:latest
21
+ command :
22
+ - /bin/sh
23
+ - -c
24
+ - |
25
+ # Max retries and sleep interval
26
+ MAX_RETRIES={{ .Values.readyCheck.maxRetries }}
27
+ SLEEP_INTERVAL={{ .Values.readyCheck.sleepInterval }}
28
+
29
+ # Check API readiness with a limit on retries
30
+ retries=0
31
+ until [ "$retries" -ge "$MAX_RETRIES" ] || curl -sf http://{{ include "chart.fullname" . }}-probe-service.{{ .Release.Namespace }}:8081/readyz; do
32
+ echo "Waiting for API to be ready... Attempt $((retries+1))/$MAX_RETRIES"
33
+ retries=$((retries+1))
34
+ sleep $SLEEP_INTERVAL
35
+ done
36
+
37
+ # If API is not ready after max retries, exit with failure
38
+ if [ "$retries" -ge "$MAX_RETRIES" ]; then
39
+ echo "API did not become ready within the time limit, exiting."
40
+ exit 1
41
+ fi
42
+
43
+ echo "API is ready to respond!"
44
+ resources :
45
+ limits :
46
+ cpu : " 100m"
47
+ memory : " 128Mi"
48
+ requests :
49
+ cpu : " 50m"
50
+ memory : " 64Mi"
51
+ restartPolicy : Never
52
+ backoffLimit : 4
53
+ {{- end }}
Original file line number Diff line number Diff line change 1
- {{- if .Values.crds.enabled }}
1
+ # START crd {{- if .Values.crds.enabled }}
2
2
apiVersion : apiextensions.k8s.io/v1
3
3
kind : CustomResourceDefinition
4
4
metadata :
5
5
name : dnsclasses.config.kubedns-shepherd.io
6
6
annotations :
7
- helm.sh/hook : post-install,post-upgrade
8
- helm.sh/hook-weight : " 3"
9
7
cert-manager.io/inject-ca-from : ' {{ .Release.Namespace }}/{{ include "chart.fullname" . }}-serving-cert'
10
8
controller-gen.kubebuilder.io/version : v0.16.3
11
- {{- if .Values.crds.keep }}
9
+ # START keep {{- if .Values.crds.keep }}
12
10
helm.sh/resource-policy : keep
13
- {{- end }}
11
+ # END keep {{- end }}
14
12
labels :
15
- {{- include "chart.labels" . | nindent 4 }}
13
+ app.kubernetes.io/component : crd
14
+ app.kubernetes.io/part-of : kubedns-shepherd
15
+ # Generated labels {{- include "chart.labels" . | nindent 4 }}
16
16
spec :
17
17
conversion :
18
18
strategy : Webhook
19
19
webhook :
20
20
clientConfig :
21
21
service :
22
- name : {{ include "chart.fullname" . }}-webhook-service
23
- namespace : {{ .Release.Namespace }}
22
+ name : ' {{ include "chart.fullname" . }}-webhook-service'
23
+ namespace : ' {{ .Release.Namespace }}'
24
24
path : /convert
25
25
conversionReviewVersions :
26
26
- v1
@@ -211,4 +211,4 @@ spec:
211
211
storage : true
212
212
subresources :
213
213
status : {}
214
- {{- end }}
214
+ # END crd {{- end }}
Original file line number Diff line number Diff line change @@ -3,9 +3,6 @@ kind: Deployment
3
3
metadata :
4
4
name : {{ include "chart.fullname" . }}
5
5
namespace : {{ .Release.Namespace }}
6
- annotations :
7
- helm.sh/hook : post-install,post-upgrade
8
- helm.sh/hook-weight : " 4"
9
6
labels :
10
7
app.kubernetes.io/component : controller
11
8
app.kubernetes.io/part-of : kubedns-shepherd
42
39
{{- end }}
43
40
image : {{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}
44
41
imagePullPolicy : {{ .Values.imagePullPolicy }}
45
- livenessProbe :
46
- httpGet :
47
- path : /healthz
48
- port : 8081
49
- initialDelaySeconds : 15
50
- periodSeconds : 20
51
42
name : controller
52
43
ports :
53
44
- containerPort : 9443
@@ -56,10 +47,19 @@ spec:
56
47
- containerPort : 8080
57
48
name : metrics
58
49
protocol : TCP
50
+ - containerPort : 8081
51
+ name : probe
52
+ protocol : TCP
53
+ livenessProbe :
54
+ httpGet :
55
+ path : /healthz
56
+ port : probe
57
+ initialDelaySeconds : 15
58
+ periodSeconds : 20
59
59
readinessProbe :
60
60
httpGet :
61
61
path : /readyz
62
- port : 8081
62
+ port : probe
63
63
initialDelaySeconds : 5
64
64
periodSeconds : 10
65
65
resources : {{- toYaml .Values.resources | nindent 10 }}
Original file line number Diff line number Diff line change
1
+ {{- if .Values.dnsclass.enabled }}
1
2
apiVersion : config.kubedns-shepherd.io/v1alpha1
2
3
kind : DNSClass
3
4
metadata :
4
5
name : {{ include "chart.fullname" . }}-dnsclass-config
5
6
annotations :
6
7
helm.sh/hook : post-install,post-upgrade
7
- helm.sh/hook-weight : " 6 "
8
+ helm.sh/hook-weight : " 4 "
8
9
labels :
9
10
{{- include "chart.labels" . | nindent 4 }}
10
11
spec :
21
22
searches :
22
23
{{- toYaml .Values.dnsclass.dnsConfig.searches | nindent 6 }}
23
24
options :
24
- {{- toYaml .Values.dnsclass.dnsConfig.options | nindent 6 }}
25
+ {{- toYaml .Values.dnsclass.dnsConfig.options | nindent 6 }}
26
+ {{- end }}
Original file line number Diff line number Diff line change 1
1
apiVersion : v1
2
2
kind : Service
3
3
metadata :
4
- name : {{ include "chart.fullname" . }}-metric -service
4
+ name : {{ include "chart.fullname" . }}-metrics -service
5
5
namespace : {{ .Release.Namespace }}
6
6
labels :
7
7
app.kubernetes.io/component : metrics
Original file line number Diff line number Diff line change @@ -3,18 +3,16 @@ kind: MutatingWebhookConfiguration
3
3
metadata :
4
4
name : {{ include "chart.fullname" . }}-mutating-webhook-configuration
5
5
annotations :
6
- helm.sh/hook : post-install,post-upgrade
7
- helm.sh/hook-weight : " 5"
8
- cert-manager.io/inject-ca-from : {{ .Release.Namespace }}/{{ include "chart.fullname" . }}-serving-cert
6
+ cert-manager.io/inject-ca-from : ' {{ .Release.Namespace }}/{{ include "chart.fullname" . }}-serving-cert'
9
7
labels :
10
8
{{- include "chart.labels" . | nindent 4 }}
11
9
webhooks :
12
10
- admissionReviewVersions :
13
11
- v1
14
12
clientConfig :
15
13
service :
16
- name : {{ include "chart.fullname" . }}-webhook-service
17
- namespace : {{ .Release.Namespace }}
14
+ name : ' {{ include "chart.fullname" . }}-webhook-service'
15
+ namespace : ' {{ .Release.Namespace }}'
18
16
path : /mutate-config-kubedns-shepherd-io-v1alpha1-dnsclass
19
17
failurePolicy : Fail
20
18
name : mdnsclass.kubedns-shepherd.io
@@ -33,8 +31,8 @@ webhooks:
33
31
- v1
34
32
clientConfig :
35
33
service :
36
- name : {{ include "chart.fullname" . }}-webhook-service
37
- namespace : {{ .Release.Namespace }}
34
+ name : ' {{ include "chart.fullname" . }}-webhook-service'
35
+ namespace : ' {{ .Release.Namespace }}'
38
36
path : /mutate-v1-pod
39
37
failurePolicy : Ignore
40
38
name : mpod.kubedns-shepherd.io
Original file line number Diff line number Diff line change
1
+ {{- if .Values.dnsclass.enabled }}
2
+ apiVersion : v1
3
+ kind : Service
4
+ metadata :
5
+ name : {{ include "chart.fullname" . }}-probe-service
6
+ namespace : {{ .Release.Namespace }}
7
+ labels :
8
+ app.kubernetes.io/component : probe
9
+ app.kubernetes.io/part-of : kubedns-shepherd
10
+ {{- include "chart.labels" . | nindent 4 }}
11
+ spec :
12
+ type : ClusterIP
13
+ selector :
14
+ control-plane : controller-manager
15
+ {{- include "chart.selectorLabels" . | nindent 4 }}
16
+ ports :
17
+ - name : probe
18
+ port : 8081
19
+ protocol : TCP
20
+ targetPort : probe
21
+ {{- end }}
Original file line number Diff line number Diff line change @@ -6,11 +6,10 @@ metadata:
6
6
annotations :
7
7
{{- if .Values.certmanager.enabled }}
8
8
helm.sh/hook : post-install,post-upgrade
9
- helm.sh/hook-weight : " 1"
10
9
{{- else }}
11
10
helm.sh/hook : pre-install,pre-upgrade
12
- helm.sh/hook-weight : " 1"
13
11
{{- end }}
12
+ helm.sh/hook-weight : " 1"
14
13
labels :
15
14
{{- include "chart.labels" . | nindent 4 }}
16
15
spec :
Original file line number Diff line number Diff line change @@ -6,11 +6,10 @@ metadata:
6
6
annotations :
7
7
{{- if .Values.certmanager.enabled }}
8
8
helm.sh/hook : post-install,post-upgrade
9
- helm.sh/hook-weight : " 2"
10
9
{{- else }}
11
10
helm.sh/hook : pre-install,pre-upgrade
12
- helm.sh/hook-weight : " 2"
13
11
{{- end }}
12
+ helm.sh/hook-weight : " 2"
14
13
labels :
15
14
{{- include "chart.labels" . | nindent 4 }}
16
15
spec :
Original file line number Diff line number Diff line change @@ -3,18 +3,16 @@ kind: ValidatingWebhookConfiguration
3
3
metadata :
4
4
name : {{ include "chart.fullname" . }}-validating-webhook-configuration
5
5
annotations :
6
- helm.sh/hook : post-install,post-upgrade
7
- helm.sh/hook-weight : " 5"
8
- cert-manager.io/inject-ca-from : {{ .Release.Namespace }}/{{ include "chart.fullname" . }}-serving-cert
6
+ cert-manager.io/inject-ca-from : ' {{ .Release.Namespace }}/{{ include "chart.fullname" . }}-serving-cert'
9
7
labels :
10
8
{{- include "chart.labels" . | nindent 4 }}
11
9
webhooks :
12
10
- admissionReviewVersions :
13
11
- v1
14
12
clientConfig :
15
13
service :
16
- name : {{ include "chart.fullname" . }}-webhook-service
17
- namespace : {{ .Release.Namespace }}
14
+ name : ' {{ include "chart.fullname" . }}-webhook-service'
15
+ namespace : ' {{ .Release.Namespace }}'
18
16
path : /validate-config-kubedns-shepherd-io-v1alpha1-dnsclass
19
17
failurePolicy : Fail
20
18
name : vdnsclass.kubedns-shepherd.io
Original file line number Diff line number Diff line change @@ -55,22 +55,30 @@ certmanager:
55
55
keep : true
56
56
57
57
dnsclass :
58
+ enabled : false
58
59
disabledNamespaces :
59
60
- kube-system
60
- allowedNamespaces :
61
- - default
61
+ allowedNamespaces : []
62
62
allowedDNSPolicies :
63
63
- None
64
64
- ClusterFirst
65
65
- ClusterFirstWithHostNet
66
66
dnsPolicy : None
67
+ # dnsConfig supports templating for dynamic configuration.
68
+ # For more details on how to use templating with dnsConfig,
69
+ # please refer to the documentation:
70
+ # https://github.com/eminaktas/kubedns-shepherd?tab=readme-ov-file#dynamic-configuration-in-dnsclass
67
71
dnsConfig :
68
72
nameservers :
69
73
- 10.96.0.10
70
74
searches :
71
- - " svc.{{ .clusterDomain }} "
72
- - " {{ .podNamespace }}.svc.{{ .clusterDomain }} "
75
+ - " svc.cluster.local "
76
+ - " {{ .podNamespace }}.svc.cluster.local "
73
77
options :
74
78
- name : ndots
75
79
value : " 2"
76
- - name : edns0
80
+ - name : edns0
81
+
82
+ readyCheck :
83
+ maxRetries : 12
84
+ sleepInterval : 10
You can’t perform that action at this time.
0 commit comments