rke2-charts/packages/rke2-coredns/rke2-coredns.patch

389 lines
18 KiB
Diff

diff -x '*.tgz' -x '*.lock' -uNr packages/rke2-coredns/charts-original/Chart.yaml packages/rke2-coredns/charts/Chart.yaml
--- packages/rke2-coredns/charts-original/Chart.yaml
+++ packages/rke2-coredns/charts/Chart.yaml
@@ -17,7 +17,7 @@
name: andor44
- email: manuel@rueg.eu
name: mrueg
-name: coredns
+name: rke2-coredns
sources:
- https://github.com/coredns/coredns
-version: 1.10.1
+version: 1.10.101-build20210223
diff -x '*.tgz' -x '*.lock' -uNr packages/rke2-coredns/charts-original/templates/_helpers.tpl packages/rke2-coredns/charts/templates/_helpers.tpl
--- packages/rke2-coredns/charts-original/templates/_helpers.tpl
+++ packages/rke2-coredns/charts/templates/_helpers.tpl
@@ -137,6 +137,7 @@
{{- end -}}
{{- end -}}
+
{{/*
Create the name of the service account to use
*/}}
@@ -147,3 +148,11 @@
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}
+
+{{- define "system_default_registry" -}}
+{{- if .Values.global.systemDefaultRegistry -}}
+{{- printf "%s/" .Values.global.systemDefaultRegistry -}}
+{{- else -}}
+{{- "" -}}
+{{- end -}}
+{{- end -}}
diff -x '*.tgz' -x '*.lock' -uNr packages/rke2-coredns/charts-original/templates/clusterrole-autoscaler.yaml packages/rke2-coredns/charts/templates/clusterrole-autoscaler.yaml
--- packages/rke2-coredns/charts-original/templates/clusterrole-autoscaler.yaml
+++ packages/rke2-coredns/charts/templates/clusterrole-autoscaler.yaml
@@ -9,7 +9,7 @@
app.kubernetes.io/instance: {{ .Release.Name | quote }}
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
{{- if .Values.isClusterService }}
- k8s-app: {{ .Chart.Name }}-autoscaler
+ k8s-app: {{ .Values.k8sApp | default .Chart.Name }}-autoscaler
kubernetes.io/cluster-service: "true"
kubernetes.io/name: "CoreDNS"
{{- end }}
diff -x '*.tgz' -x '*.lock' -uNr packages/rke2-coredns/charts-original/templates/clusterrole.yaml packages/rke2-coredns/charts/templates/clusterrole.yaml
--- packages/rke2-coredns/charts-original/templates/clusterrole.yaml
+++ packages/rke2-coredns/charts/templates/clusterrole.yaml
@@ -8,7 +8,7 @@
app.kubernetes.io/instance: {{ .Release.Name | quote }}
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
{{- if .Values.isClusterService }}
- k8s-app: {{ .Chart.Name | quote }}
+ k8s-app: {{ .Values.k8sApp | default .Chart.Name | quote }}
kubernetes.io/cluster-service: "true"
kubernetes.io/name: "CoreDNS"
{{- end }}
diff -x '*.tgz' -x '*.lock' -uNr packages/rke2-coredns/charts-original/templates/clusterrolebinding-autoscaler.yaml packages/rke2-coredns/charts/templates/clusterrolebinding-autoscaler.yaml
--- packages/rke2-coredns/charts-original/templates/clusterrolebinding-autoscaler.yaml
+++ packages/rke2-coredns/charts/templates/clusterrolebinding-autoscaler.yaml
@@ -9,7 +9,7 @@
app.kubernetes.io/instance: {{ .Release.Name | quote }}
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
{{- if .Values.isClusterService }}
- k8s-app: {{ .Chart.Name }}-autoscaler
+ k8s-app: {{ .Values.k8sApp | default .Chart.Name }}-autoscaler
kubernetes.io/cluster-service: "true"
kubernetes.io/name: "CoreDNS"
{{- end }}
diff -x '*.tgz' -x '*.lock' -uNr packages/rke2-coredns/charts-original/templates/clusterrolebinding.yaml packages/rke2-coredns/charts/templates/clusterrolebinding.yaml
--- packages/rke2-coredns/charts-original/templates/clusterrolebinding.yaml
+++ packages/rke2-coredns/charts/templates/clusterrolebinding.yaml
@@ -8,7 +8,7 @@
app.kubernetes.io/instance: {{ .Release.Name | quote }}
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
{{- if .Values.isClusterService }}
- k8s-app: {{ .Chart.Name | quote }}
+ k8s-app: {{ .Values.k8sApp | default .Chart.Name | quote }}
kubernetes.io/cluster-service: "true"
kubernetes.io/name: "CoreDNS"
{{- end }}
diff -x '*.tgz' -x '*.lock' -uNr packages/rke2-coredns/charts-original/templates/configmap-autoscaler.yaml packages/rke2-coredns/charts/templates/configmap-autoscaler.yaml
--- packages/rke2-coredns/charts-original/templates/configmap-autoscaler.yaml
+++ packages/rke2-coredns/charts/templates/configmap-autoscaler.yaml
@@ -10,7 +10,7 @@
app.kubernetes.io/instance: {{ .Release.Name | quote }}
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
{{- if .Values.isClusterService }}
- k8s-app: {{ .Chart.Name }}-autoscaler
+ k8s-app: {{ .Values.k8sApp | default .Chart.Name }}-autoscaler
kubernetes.io/cluster-service: "true"
kubernetes.io/name: "CoreDNS"
{{- end }}
diff -x '*.tgz' -x '*.lock' -uNr packages/rke2-coredns/charts-original/templates/configmap.yaml packages/rke2-coredns/charts/templates/configmap.yaml
--- packages/rke2-coredns/charts-original/templates/configmap.yaml
+++ packages/rke2-coredns/charts/templates/configmap.yaml
@@ -7,7 +7,7 @@
app.kubernetes.io/instance: {{ .Release.Name | quote }}
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
{{- if .Values.isClusterService }}
- k8s-app: {{ .Chart.Name | quote }}
+ k8s-app: {{ .Values.k8sApp | default .Chart.Name | quote }}
kubernetes.io/cluster-service: "true"
kubernetes.io/name: "CoreDNS"
{{- end }}
@@ -19,7 +19,7 @@
{{- if .port }}:{{ .port }} {{ end -}}
{
{{- range .plugins }}
- {{ .name }}{{ if .parameters }} {{ .parameters }}{{ end }}{{ if .configBlock }} {
+ {{ .name }} {{ if .parameters }} {{if eq .name "kubernetes" }} {{ (lookup "v1" "ConfigMap" "kube-system" "cluster-dns").data.clusterDomain }} {{ end }} {{.parameters}}{{ end }}{{ if .configBlock }} {
{{ .configBlock | indent 12 }}
}{{ end }}
{{- end }}
diff -x '*.tgz' -x '*.lock' -uNr packages/rke2-coredns/charts-original/templates/deployment-autoscaler.yaml packages/rke2-coredns/charts/templates/deployment-autoscaler.yaml
--- packages/rke2-coredns/charts-original/templates/deployment-autoscaler.yaml
+++ packages/rke2-coredns/charts/templates/deployment-autoscaler.yaml
@@ -10,7 +10,7 @@
app.kubernetes.io/instance: {{ .Release.Name | quote }}
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
{{- if .Values.isClusterService }}
- k8s-app: {{ .Chart.Name }}-autoscaler
+ k8s-app: {{ .Values.k8sApp | default .Chart.Name }}-autoscaler
kubernetes.io/cluster-service: "true"
kubernetes.io/name: "CoreDNS"
{{- end }}
@@ -23,14 +23,14 @@
matchLabels:
app.kubernetes.io/instance: {{ .Release.Name | quote }}
{{- if .Values.isClusterService }}
- k8s-app: {{ .Chart.Name }}-autoscaler
+ k8s-app: {{ .Values.k8sApp | default .Chart.Name }}-autoscaler
{{- end }}
app.kubernetes.io/name: {{ template "coredns.name" . }}-autoscaler
template:
metadata:
labels:
{{- if .Values.isClusterService }}
- k8s-app: {{ .Chart.Name }}-autoscaler
+ k8s-app: {{ .Values.k8sApp | default .Chart.Name }}-autoscaler
{{- end }}
app.kubernetes.io/name: {{ template "coredns.name" . }}-autoscaler
app.kubernetes.io/instance: {{ .Release.Name | quote }}
@@ -63,7 +63,7 @@
{{- end }}
containers:
- name: autoscaler
- image: "{{ .Values.autoscaler.image.repository }}:{{ .Values.autoscaler.image.tag }}"
+ image: {{ template "system_default_registry" . }}{{ .Values.autoscaler.image.repository }}:{{ .Values.autoscaler.image.tag }}
imagePullPolicy: {{ .Values.autoscaler.image.pullPolicy }}
resources:
{{ toYaml .Values.autoscaler.resources | indent 10 }}
diff -x '*.tgz' -x '*.lock' -uNr packages/rke2-coredns/charts-original/templates/deployment.yaml packages/rke2-coredns/charts/templates/deployment.yaml
--- packages/rke2-coredns/charts-original/templates/deployment.yaml
+++ packages/rke2-coredns/charts/templates/deployment.yaml
@@ -7,7 +7,7 @@
app.kubernetes.io/instance: {{ .Release.Name | quote }}
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
{{- if .Values.isClusterService }}
- k8s-app: {{ .Chart.Name | quote }}
+ k8s-app: {{ .Values.k8sApp | default .Chart.Name | quote }}
kubernetes.io/cluster-service: "true"
kubernetes.io/name: "CoreDNS"
{{- end }}
@@ -28,14 +28,14 @@
matchLabels:
app.kubernetes.io/instance: {{ .Release.Name | quote }}
{{- if .Values.isClusterService }}
- k8s-app: {{ .Chart.Name | quote }}
+ k8s-app: {{ .Values.k8sApp | default .Chart.Name | quote }}
{{- end }}
app.kubernetes.io/name: {{ template "coredns.name" . }}
template:
metadata:
labels:
{{- if .Values.isClusterService }}
- k8s-app: {{ .Chart.Name | quote }}
+ k8s-app: {{ .Values.k8sApp | default .Chart.Name | quote }}
{{- end }}
app.kubernetes.io/name: {{ template "coredns.name" . }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
@@ -46,7 +46,6 @@
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- if .Values.isClusterService }}
scheduler.alpha.kubernetes.io/critical-pod: ''
- scheduler.alpha.kubernetes.io/tolerations: '[{"key":"CriticalAddonsOnly", "operator":"Exists"}]'
{{- end }}
spec:
serviceAccountName: {{ template "coredns.serviceAccountName" . }}
@@ -60,9 +59,15 @@
affinity:
{{ toYaml .Values.affinity | indent 8 }}
{{- end }}
- {{- if .Values.tolerations }}
+ {{- if or (.Values.isClusterService) (.Values.tolerations) }}
tolerations:
+ {{- if .Values.isClusterService }}
+ - key: CriticalAddonsOnly
+ operator: Exists
+ {{- end }}
+ {{- if .Values.tolerations }}
{{ toYaml .Values.tolerations | indent 8 }}
+ {{- end }}
{{- end }}
{{- if .Values.nodeSelector }}
nodeSelector:
@@ -70,7 +75,7 @@
{{- end }}
containers:
- name: "coredns"
- image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
+ image: {{ template "system_default_registry" . }}{{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args: [ "-conf", "/etc/coredns/Corefile" ]
volumeMounts:
diff -x '*.tgz' -x '*.lock' -uNr packages/rke2-coredns/charts-original/templates/poddisruptionbudget.yaml packages/rke2-coredns/charts/templates/poddisruptionbudget.yaml
--- packages/rke2-coredns/charts-original/templates/poddisruptionbudget.yaml
+++ packages/rke2-coredns/charts/templates/poddisruptionbudget.yaml
@@ -8,7 +8,7 @@
app.kubernetes.io/instance: {{ .Release.Name | quote }}
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
{{- if .Values.isClusterService }}
- k8s-app: {{ .Chart.Name | quote }}
+ k8s-app: {{ .Values.k8sApp | default .Chart.Name | quote }}
kubernetes.io/cluster-service: "true"
kubernetes.io/name: "CoreDNS"
{{- end }}
@@ -21,7 +21,7 @@
matchLabels:
app.kubernetes.io/instance: {{ .Release.Name | quote }}
{{- if .Values.isClusterService }}
- k8s-app: {{ .Chart.Name | quote }}
+ k8s-app: {{ .Values.k8sApp | default .Chart.Name | quote }}
{{- end }}
app.kubernetes.io/name: {{ template "coredns.name" . }}
{{ toYaml .Values.podDisruptionBudget | indent 2 }}
diff -x '*.tgz' -x '*.lock' -uNr packages/rke2-coredns/charts-original/templates/podsecuritypolicy.yaml packages/rke2-coredns/charts/templates/podsecuritypolicy.yaml
--- packages/rke2-coredns/charts-original/templates/podsecuritypolicy.yaml
+++ packages/rke2-coredns/charts/templates/podsecuritypolicy.yaml
@@ -12,7 +12,7 @@
app.kubernetes.io/instance: {{ .Release.Name | quote }}
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
{{- if .Values.isClusterService }}
- k8s-app: {{ .Chart.Name | quote }}
+ k8s-app: {{ .Values.k8sApp | default .Chart.Name | quote }}
kubernetes.io/cluster-service: "true"
kubernetes.io/name: "CoreDNS"
{{- else }}
diff -x '*.tgz' -x '*.lock' -uNr packages/rke2-coredns/charts-original/templates/service-metrics.yaml packages/rke2-coredns/charts/templates/service-metrics.yaml
--- packages/rke2-coredns/charts-original/templates/service-metrics.yaml
+++ packages/rke2-coredns/charts/templates/service-metrics.yaml
@@ -8,7 +8,7 @@
app.kubernetes.io/instance: {{ .Release.Name | quote }}
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
{{- if .Values.isClusterService }}
- k8s-app: {{ .Chart.Name | quote }}
+ k8s-app: {{ .Values.k8sApp | default .Chart.Name | quote }}
kubernetes.io/cluster-service: "true"
kubernetes.io/name: "CoreDNS"
{{- end }}
@@ -23,7 +23,7 @@
selector:
app.kubernetes.io/instance: {{ .Release.Name | quote }}
{{- if .Values.isClusterService }}
- k8s-app: {{ .Chart.Name | quote }}
+ k8s-app: {{ .Values.k8sApp | default .Chart.Name | quote }}
{{- end }}
app.kubernetes.io/name: {{ template "coredns.name" . }}
ports:
diff -x '*.tgz' -x '*.lock' -uNr packages/rke2-coredns/charts-original/templates/service.yaml packages/rke2-coredns/charts/templates/service.yaml
--- packages/rke2-coredns/charts-original/templates/service.yaml
+++ packages/rke2-coredns/charts/templates/service.yaml
@@ -7,7 +7,7 @@
app.kubernetes.io/instance: {{ .Release.Name | quote }}
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
{{- if .Values.isClusterService }}
- k8s-app: {{ .Chart.Name | quote }}
+ k8s-app: {{ .Values.k8sApp | default .Chart.Name | quote }}
kubernetes.io/cluster-service: "true"
kubernetes.io/name: "CoreDNS"
{{- end }}
@@ -21,11 +21,13 @@
selector:
app.kubernetes.io/instance: {{ .Release.Name | quote }}
{{- if .Values.isClusterService }}
- k8s-app: {{ .Chart.Name | quote }}
+ k8s-app: {{ .Values.k8sApp | default .Chart.Name | quote }}
{{- end }}
app.kubernetes.io/name: {{ template "coredns.name" . }}
{{- if .Values.service.clusterIP }}
clusterIP: {{ .Values.service.clusterIP }}
+ {{ else }}
+ clusterIP: {{ (lookup "v1" "ConfigMap" "kube-system" "cluster-dns").data.clusterDNS }}
{{- end }}
{{- if .Values.service.externalTrafficPolicy }}
externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }}
diff -x '*.tgz' -x '*.lock' -uNr packages/rke2-coredns/charts-original/templates/serviceaccount-autoscaler.yaml packages/rke2-coredns/charts/templates/serviceaccount-autoscaler.yaml
--- packages/rke2-coredns/charts-original/templates/serviceaccount-autoscaler.yaml
+++ packages/rke2-coredns/charts/templates/serviceaccount-autoscaler.yaml
@@ -10,7 +10,7 @@
app.kubernetes.io/instance: {{ .Release.Name | quote }}
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
{{- if .Values.isClusterService }}
- k8s-app: {{ .Chart.Name }}-autoscaler
+ k8s-app: {{ .Values.k8sApp | default .Chart.Name }}-autoscaler
kubernetes.io/cluster-service: "true"
kubernetes.io/name: "CoreDNS"
{{- end }}
diff -x '*.tgz' -x '*.lock' -uNr packages/rke2-coredns/charts-original/templates/serviceaccount.yaml packages/rke2-coredns/charts/templates/serviceaccount.yaml
--- packages/rke2-coredns/charts-original/templates/serviceaccount.yaml
+++ packages/rke2-coredns/charts/templates/serviceaccount.yaml
@@ -8,7 +8,7 @@
app.kubernetes.io/instance: {{ .Release.Name | quote }}
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
{{- if .Values.isClusterService }}
- k8s-app: {{ .Chart.Name | quote }}
+ k8s-app: {{ .Values.k8sApp | default .Chart.Name | quote }}
kubernetes.io/cluster-service: "true"
kubernetes.io/name: "CoreDNS"
{{- end }}
diff -x '*.tgz' -x '*.lock' -uNr packages/rke2-coredns/charts-original/templates/servicemonitor.yaml packages/rke2-coredns/charts/templates/servicemonitor.yaml
--- packages/rke2-coredns/charts-original/templates/servicemonitor.yaml
+++ packages/rke2-coredns/charts/templates/servicemonitor.yaml
@@ -11,7 +11,7 @@
app.kubernetes.io/instance: {{ .Release.Name | quote }}
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
{{- if .Values.isClusterService }}
- k8s-app: {{ .Chart.Name | quote }}
+ k8s-app: {{ .Values.k8sApp | default .Chart.Name | quote }}
kubernetes.io/cluster-service: "true"
kubernetes.io/name: "CoreDNS"
{{- end }}
@@ -24,7 +24,7 @@
matchLabels:
app.kubernetes.io/instance: {{ .Release.Name | quote }}
{{- if .Values.isClusterService }}
- k8s-app: {{ .Chart.Name | quote }}
+ k8s-app: {{ .Values.k8sApp | default .Chart.Name | quote }}
{{- end }}
app.kubernetes.io/name: {{ template "coredns.name" . }}
app.kubernetes.io/component: metrics
diff -x '*.tgz' -x '*.lock' -uNr packages/rke2-coredns/charts-original/values.yaml packages/rke2-coredns/charts/values.yaml
--- packages/rke2-coredns/charts-original/values.yaml
+++ packages/rke2-coredns/charts/values.yaml
@@ -3,8 +3,8 @@
# Declare variables to be passed into your templates.
image:
- repository: coredns/coredns
- tag: "1.6.9"
+ repository: rancher/hardened-coredns
+ tag: "v1.6.9-build20210223"
pullPolicy: IfNotPresent
replicaCount: 1
@@ -34,10 +34,10 @@
prometheus.io/port: "9153"
serviceAccount:
- create: false
+ create: true
# The name of the ServiceAccount to use
# If not set and create is true, a name is generated using the fullname template
- name:
+ name: coredns
rbac:
# If true, create & use RBAC resources
@@ -52,7 +52,7 @@
isClusterService: true
# Optional priority class to be used for the coredns pods. Used for autoscaler if autoscaler.priorityClassName not set.
-priorityClassName: ""
+priorityClassName: "system-cluster-critical"
# Default zone is what Kubernetes recommends:
# https://kubernetes.io/docs/tasks/administer-cluster/dns-custom-nameservers/#coredns-configmap-options
@@ -196,3 +196,7 @@
## Annotations for the coredns-autoscaler configmap
# i.e. strategy.spinnaker.io/versioned: "false" to ensure configmap isn't renamed
annotations: {}
+k8sApp : "kube-dns"
+
+global:
+ systemDefaultRegistry: ""