From 888030a2d124827edee9ecd2d7ece02bdc0ebf51 Mon Sep 17 00:00:00 2001 From: Gintautas Sulskus Date: Tue, 7 Aug 2018 16:08:20 +0100 Subject: [PATCH] Coredns affinity tolerations (#7039) * added 'affinity' and 'tolerations' configuration hooks to coredns * bumped up version. No breaking changes hence the minor version increase. * Update Chart.yaml --- stable/coredns/Chart.yaml | 4 ++-- stable/coredns/templates/deployment.yaml | 8 ++++++++ stable/coredns/values.yaml | 22 ++++++++++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/stable/coredns/Chart.yaml b/stable/coredns/Chart.yaml index 40a68d36b6..f23acf52d0 100644 --- a/stable/coredns/Chart.yaml +++ b/stable/coredns/Chart.yaml @@ -1,5 +1,5 @@ name: coredns -version: 0.9.0 +version: 0.9.1 appVersion: 1.0.6 description: CoreDNS is a DNS server that chains plugins and provides Kubernetes DNS Services keywords: @@ -13,5 +13,5 @@ sources: maintainers: - name: Acaleph email: hello@acale.ph -- name: Shashidhara TD +- name: shashidharatd email: shashidhara.huawei@gmail.com diff --git a/stable/coredns/templates/deployment.yaml b/stable/coredns/templates/deployment.yaml index 24985c9c50..01bda449e9 100644 --- a/stable/coredns/templates/deployment.yaml +++ b/stable/coredns/templates/deployment.yaml @@ -43,6 +43,14 @@ spec: {{- end }} {{- if .Values.isClusterService }} dnsPolicy: Default + {{- end }} + {{- if .Values.affinity }} + affinity: +{{ toYaml .Values.affinity | indent 8 }} + {{- end }} + {{- if .Values.tolerations }} + tolerations: +{{ toYaml .Values.tolerations | indent 8 }} {{- end }} containers: - name: "coredns" diff --git a/stable/coredns/values.yaml b/stable/coredns/values.yaml index 61d83058f1..6dad8174bc 100644 --- a/stable/coredns/values.yaml +++ b/stable/coredns/values.yaml @@ -36,6 +36,28 @@ serviceType: "ClusterIP" # Can be one of three options: "UDPNTCP" (default), "UDP" or "TCP" serviceProtocol: "UDPNTCP" +# expects input structure as per specification https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/#affinity-v1-core +# for example: +# affinity: +# nodeAffinity: +# requiredDuringSchedulingIgnoredDuringExecution: +# nodeSelectorTerms: +# - matchExpressions: +# - key: foo.bar.com/role +# operator: In +# values: +# - master +affinity: {} + +# expects input structure as per specification https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/#toleration-v1-core +# for example: +# tolerations: +# - key: foo.bar.com/role +# operator: Equal +# value: master +# effect: NoSchedule +tolerations: [] + # plugn configuration of CoreDNS refer to https://github.com/coredns/coredns/tree/master/plugin # for all specific details. set enabled to true/false to enable/disable a plugin. plugins: