Skip to content

Commit bb61177

Browse files
authored
Merge pull request #246 from hligit/feat/pod-and-rbac-customization
feat: add customAnnotations, dnsConfig, and podLabels support
2 parents 6770f32 + 5de1c46 commit bb61177

File tree

7 files changed

+32
-5
lines changed

7 files changed

+32
-5
lines changed

.github/workflows/lint-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
version: v3.13.1
1818

1919
- name: Install helm-unittest plugin
20-
run: helm plugin install https://github.com/helm-unittest/helm-unittest
20+
run: helm plugin install --version 1.0.2 https://github.com/helm-unittest/helm-unittest
2121

2222
- name: Add Helm repo
2323
run: |

charts/coredns/Chart.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
22
name: coredns
3-
version: 1.45.0
3+
version: 1.45.1
44
appVersion: 1.13.1
55
home: https://coredns.io
66
icon: https://coredns.io/images/CoreDNS_Colour_Horizontal.png
@@ -19,5 +19,9 @@ maintainers:
1919
type: application
2020
annotations:
2121
artifacthub.io/changes: |
22-
- kind: changed
23-
description: Bump to CoreDNS 1.13.1
22+
- kind: added
23+
description: Support for customAnnotations on ClusterRole and ClusterRoleBinding
24+
- kind: added
25+
description: Support for dnsConfig in deployment
26+
- kind: added
27+
description: Support for podLabels

charts/coredns/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@ The command removes all the Kubernetes components associated with the chart and
172172
| `rollingUpdate.maxSurge` | Maximum number of pods created above desired number of pods | `25%` |
173173
| `podDisruptionBudget` | Optional PodDisruptionBudget | {} |
174174
| `podAnnotations` | Optional Pod only Annotations | {} |
175+
| `podLabels` | Optional Pod only Labels | {} |
176+
| `dnsConfig` | Optional Pod DNS configuration. When set, `dnsPolicy` is automatically set to `None` | {} |
175177
| `terminationGracePeriodSeconds` | Optional duration in seconds the pod needs to terminate gracefully. | 30 |
176178
| `hpa.enabled` | Enable Hpa autoscaler instead of proportional one | `false` |
177179
| `hpa.minReplicas` | Hpa minimum number of CoreDNS replicas | `1` |

charts/coredns/templates/clusterrole.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ kind: ClusterRole
44
metadata:
55
name: {{ template "coredns.clusterRoleName" . }}
66
labels: {{- include "coredns.labels" . | nindent 4 }}
7+
{{- with .Values.customAnnotations }}
8+
annotations:
9+
{{- toYaml . | nindent 4 }}
10+
{{- end }}
711
rules:
812
- apiGroups:
913
- ""

charts/coredns/templates/clusterrolebinding.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ kind: ClusterRoleBinding
44
metadata:
55
name: {{ template "coredns.clusterRoleName" . }}
66
labels: {{- include "coredns.labels" . | nindent 4 }}
7+
{{- with .Values.customAnnotations }}
8+
annotations:
9+
{{- toYaml . | nindent 4 }}
10+
{{- end }}
711
roleRef:
812
apiGroup: rbac.authorization.k8s.io
913
kind: ClusterRole

charts/coredns/templates/deployment.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ spec:
4949
app.kubernetes.io/instance: {{ .Release.Name | quote }}
5050
{{- if .Values.customLabels }}
5151
{{ toYaml .Values.customLabels | indent 8 }}
52+
{{- end }}
53+
{{- if .Values.podLabels }}
54+
{{ toYaml .Values.podLabels | indent 8 }}
5255
{{- end }}
5356
annotations:
5457
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
@@ -66,12 +69,20 @@ spec:
6669
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
6770
{{- end }}
6871
serviceAccountName: {{ template "coredns.serviceAccountName" . }}
72+
{{- if eq .Values.automountServiceAccountToken false }}
73+
automountServiceAccountToken: false
74+
{{- end }}
6975
{{- if .Values.priorityClassName }}
7076
priorityClassName: {{ .Values.priorityClassName | quote }}
7177
{{- end }}
72-
{{- if .Values.isClusterService }}
78+
{{- if .Values.dnsConfig }}
79+
dnsPolicy: None
80+
{{- else if .Values.isClusterService }}
7381
dnsPolicy: Default
7482
{{- end }}
83+
{{- if .Values.dnsConfig }}
84+
dnsConfig: {{ toYaml .Values.dnsConfig | nindent 8 }}
85+
{{- end }}
7586
{{- if .Values.affinity }}
7687
affinity:
7788
{{ tpl (toYaml .Values.affinity) $ | indent 8 }}

charts/coredns/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ terminationGracePeriodSeconds: 30
3434
podAnnotations: {}
3535
# cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
3636

37+
podLabels: {}
38+
3739
serviceType: "ClusterIP"
3840

3941
prometheus:

0 commit comments

Comments
 (0)