diff --git a/chart/kubedns-shepherd/templates/dnsclass-configuration.yaml b/chart/kubedns-shepherd/templates/dnsclass-configuration.yaml new file mode 100644 index 0000000..2fb5c6c --- /dev/null +++ b/chart/kubedns-shepherd/templates/dnsclass-configuration.yaml @@ -0,0 +1,24 @@ +apiVersion: config.kubedns-shepherd.io/v1alpha1 +kind: DNSClass +metadata: + name: {{ include "chart.fullname" . }}-dnsclass-config + annotations: + helm.sh/hook: post-install,post-upgrade + helm.sh/hook-weight: "6" + labels: + {{- include "chart.labels" . | nindent 4 }} +spec: + allowedNamespaces: + {{- toYaml .Values.dnsclass.allowedNamespaces | nindent 4 }} + disabledNamespaces: + {{- toYaml .Values.dnsclass.disabledNamespaces | nindent 4 }} + allowedDNSPolicies: + {{- toYaml .Values.dnsclass.allowedDNSPolicies | nindent 4 }} + dnsPolicy: {{ .Values.dnsclass.dnsPolicy }} + dnsConfig: + nameservers: + {{- toYaml .Values.dnsclass.dnsConfig.nameservers | nindent 6 }} + searches: + {{- toYaml .Values.dnsclass.dnsConfig.searches | nindent 6 }} + options: + {{- toYaml .Values.dnsclass.dnsConfig.options | nindent 6 }} \ No newline at end of file diff --git a/chart/kubedns-shepherd/templates/mutating-webhook-configuration.yaml b/chart/kubedns-shepherd/templates/mutating-webhook-configuration.yaml index 0f4bbcf..872d51e 100644 --- a/chart/kubedns-shepherd/templates/mutating-webhook-configuration.yaml +++ b/chart/kubedns-shepherd/templates/mutating-webhook-configuration.yaml @@ -3,6 +3,8 @@ kind: MutatingWebhookConfiguration metadata: name: {{ include "chart.fullname" . }}-mutating-webhook-configuration annotations: + helm.sh/hook: post-install,post-upgrade + helm.sh/hook-weight: "5" cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ include "chart.fullname" . }}-serving-cert labels: {{- include "chart.labels" . | nindent 4 }} diff --git a/chart/kubedns-shepherd/templates/validating-webhook-configuration.yaml b/chart/kubedns-shepherd/templates/validating-webhook-configuration.yaml index 8712c12..d406cd1 100644 --- a/chart/kubedns-shepherd/templates/validating-webhook-configuration.yaml +++ b/chart/kubedns-shepherd/templates/validating-webhook-configuration.yaml @@ -3,6 +3,8 @@ kind: ValidatingWebhookConfiguration metadata: name: {{ include "chart.fullname" . }}-validating-webhook-configuration annotations: + helm.sh/hook: post-install,post-upgrade + helm.sh/hook-weight: "5" cert-manager.io/inject-ca-from: {{ .Release.Namespace }}/{{ include "chart.fullname" . }}-serving-cert labels: {{- include "chart.labels" . | nindent 4 }} diff --git a/chart/kubedns-shepherd/values.yaml b/chart/kubedns-shepherd/values.yaml index 6746c66..10c7e56 100644 --- a/chart/kubedns-shepherd/values.yaml +++ b/chart/kubedns-shepherd/values.yaml @@ -53,3 +53,24 @@ certmanager: crds: enabled: true keep: true + +dnsclass: + disabledNamespaces: + - kube-system + allowedNamespaces: + - default + allowedDNSPolicies: + - None + - ClusterFirst + - ClusterFirstWithHostNet + dnsPolicy: None + dnsConfig: + nameservers: + - 10.96.0.10 + searches: + - "svc.{{ .clusterDomain }}" + - "{{ .podNamespace }}.svc.{{ .clusterDomain }}" + options: + - name: ndots + value: "2" + - name: edns0 \ No newline at end of file