mirror of https://github.com/kubernetes/kops.git
Merge pull request #17315 from rsicart/rsi/coredns-pod-annotations
Allow to setup CoreDNS pod annotations
This commit is contained in:
commit
c95d2dc2b8
|
@ -3681,6 +3681,13 @@ spec:
|
|||
Default: none
|
||||
type: object
|
||||
type: object
|
||||
podAnnotations:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: |-
|
||||
PodAnnotations makes possible to add additional annotations to CoreDNS Pods.
|
||||
Default: none
|
||||
type: object
|
||||
provider:
|
||||
description: Provider indicates whether CoreDNS or kube-dns will
|
||||
be the default service discovery.
|
||||
|
|
|
@ -599,6 +599,9 @@ type KubeDNSConfig struct {
|
|||
MemoryLimit *resource.Quantity `json:"memoryLimit,omitempty"`
|
||||
// NodeLocalDNS specifies the configuration for the node-local-dns addon
|
||||
NodeLocalDNS *NodeLocalDNSConfig `json:"nodeLocalDNS,omitempty"`
|
||||
// PodAnnotations makes possible to add additional annotations to CoreDNS Pods.
|
||||
// Default: none
|
||||
PodAnnotations map[string]string `json:"podAnnotations,omitempty"`
|
||||
}
|
||||
|
||||
// NodeLocalDNSConfig are options of the node-local-dns
|
||||
|
|
|
@ -578,6 +578,9 @@ type KubeDNSConfig struct {
|
|||
MemoryLimit *resource.Quantity `json:"memoryLimit,omitempty"`
|
||||
// NodeLocalDNS specifies the configuration for the node-local-dns addon
|
||||
NodeLocalDNS *NodeLocalDNSConfig `json:"nodeLocalDNS,omitempty"`
|
||||
// PodAnnotations makes possible to add additional annotations to CoreDNS Pods.
|
||||
// Default: none
|
||||
PodAnnotations map[string]string `json:"podAnnotations,omitempty"`
|
||||
}
|
||||
|
||||
// NodeLocalDNSConfig are options of the node-local-dns
|
||||
|
|
|
@ -5437,6 +5437,7 @@ func autoConvert_v1alpha2_KubeDNSConfig_To_kops_KubeDNSConfig(in *KubeDNSConfig,
|
|||
} else {
|
||||
out.NodeLocalDNS = nil
|
||||
}
|
||||
out.PodAnnotations = in.PodAnnotations
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -5470,6 +5471,7 @@ func autoConvert_kops_KubeDNSConfig_To_v1alpha2_KubeDNSConfig(in *kops.KubeDNSCo
|
|||
} else {
|
||||
out.NodeLocalDNS = nil
|
||||
}
|
||||
out.PodAnnotations = in.PodAnnotations
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -3881,6 +3881,13 @@ func (in *KubeDNSConfig) DeepCopyInto(out *KubeDNSConfig) {
|
|||
*out = new(NodeLocalDNSConfig)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.PodAnnotations != nil {
|
||||
in, out := &in.PodAnnotations, &out.PodAnnotations
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -564,6 +564,9 @@ type KubeDNSConfig struct {
|
|||
MemoryLimit *resource.Quantity `json:"memoryLimit,omitempty"`
|
||||
// NodeLocalDNS specifies the configuration for the node-local-dns addon
|
||||
NodeLocalDNS *NodeLocalDNSConfig `json:"nodeLocalDNS,omitempty"`
|
||||
// PodAnnotations makes possible to add additional annotations to CoreDNS Pods.
|
||||
// Default: none
|
||||
PodAnnotations map[string]string `json:"podAnnotations,omitempty"`
|
||||
}
|
||||
|
||||
// NodeLocalDNSConfig are options of the node-local-dns
|
||||
|
|
|
@ -5832,6 +5832,7 @@ func autoConvert_v1alpha3_KubeDNSConfig_To_kops_KubeDNSConfig(in *KubeDNSConfig,
|
|||
} else {
|
||||
out.NodeLocalDNS = nil
|
||||
}
|
||||
out.PodAnnotations = in.PodAnnotations
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -5865,6 +5866,7 @@ func autoConvert_kops_KubeDNSConfig_To_v1alpha3_KubeDNSConfig(in *kops.KubeDNSCo
|
|||
} else {
|
||||
out.NodeLocalDNS = nil
|
||||
}
|
||||
out.PodAnnotations = in.PodAnnotations
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -3860,6 +3860,13 @@ func (in *KubeDNSConfig) DeepCopyInto(out *KubeDNSConfig) {
|
|||
*out = new(NodeLocalDNSConfig)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.PodAnnotations != nil {
|
||||
in, out := &in.PodAnnotations, &out.PodAnnotations
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -3963,6 +3963,13 @@ func (in *KubeDNSConfig) DeepCopyInto(out *KubeDNSConfig) {
|
|||
*out = new(NodeLocalDNSConfig)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.PodAnnotations != nil {
|
||||
in, out := &in.PodAnnotations, &out.PodAnnotations
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -122,6 +122,12 @@ spec:
|
|||
metadata:
|
||||
labels:
|
||||
k8s-app: kube-dns
|
||||
{{- if KubeDNS.PodAnnotations }}
|
||||
annotations:
|
||||
{{- range $key, $value := KubeDNS.PodAnnotations }}
|
||||
{{ $key }}: "{{ $value }}"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
priorityClassName: system-cluster-critical
|
||||
serviceAccountName: coredns
|
||||
|
|
Loading…
Reference in New Issue