mirror of https://github.com/kubernetes/kops.git
feat(nodelocaldns): Add possibility to set an ExternalCoreFile
Allow users to provide entirely custom CoreFile for NodeLocalDNS to provide improved flexibility.
This commit is contained in:
parent
d50995ece3
commit
cc47bd278c
|
|
@ -3220,6 +3220,11 @@ spec:
|
|||
enabled:
|
||||
description: Enabled activates the node-local-dns addon.
|
||||
type: boolean
|
||||
externalCoreFile:
|
||||
description: ExternalCoreFile is used to provide a complete
|
||||
NodeLocalDNS CoreFile by the user - ignores other provided
|
||||
flags which modify the CoreFile.
|
||||
type: string
|
||||
forwardToKubeDNS:
|
||||
description: If enabled, nodelocal dns will use kubedns as
|
||||
a default upstream
|
||||
|
|
|
|||
|
|
@ -580,6 +580,8 @@ type KubeDNSConfig struct {
|
|||
type NodeLocalDNSConfig struct {
|
||||
// Enabled activates the node-local-dns addon.
|
||||
Enabled *bool `json:"enabled,omitempty"`
|
||||
// ExternalCoreFile is used to provide a complete NodeLocalDNS CoreFile by the user - ignores other provided flags which modify the CoreFile.
|
||||
ExternalCoreFile string `json:"externalCoreFile,omitempty"`
|
||||
// Image overrides the default docker image used for node-local-dns addon.
|
||||
Image *string `json:"image,omitempty"`
|
||||
// Local listen IP address. It can be any IP in the 169.254.20.0/16 space or any other IP address that can be guaranteed to not collide with any existing IP.
|
||||
|
|
|
|||
|
|
@ -570,6 +570,8 @@ type KubeDNSConfig struct {
|
|||
type NodeLocalDNSConfig struct {
|
||||
// Enabled activates the node-local-dns addon.
|
||||
Enabled *bool `json:"enabled,omitempty"`
|
||||
// ExternalCoreFile is used to provide a complete NodeLocalDNS CoreFile by the user - ignores other provided flags which modify the CoreFile.
|
||||
ExternalCoreFile string `json:"externalCoreFile,omitempty"`
|
||||
// Image overrides the default docker image used for node-local-dns addon.
|
||||
Image *string `json:"image,omitempty"`
|
||||
// Local listen IP address. It can be any IP in the 169.254.20.0/16 space or any other IP address that can be guaranteed to not collide with any existing IP.
|
||||
|
|
|
|||
|
|
@ -6270,6 +6270,7 @@ func Convert_kops_NodeAuthorizerSpec_To_v1alpha2_NodeAuthorizerSpec(in *kops.Nod
|
|||
|
||||
func autoConvert_v1alpha2_NodeLocalDNSConfig_To_kops_NodeLocalDNSConfig(in *NodeLocalDNSConfig, out *kops.NodeLocalDNSConfig, s conversion.Scope) error {
|
||||
out.Enabled = in.Enabled
|
||||
out.ExternalCoreFile = in.ExternalCoreFile
|
||||
out.Image = in.Image
|
||||
out.LocalIP = in.LocalIP
|
||||
out.ForwardToKubeDNS = in.ForwardToKubeDNS
|
||||
|
|
@ -6286,6 +6287,7 @@ func Convert_v1alpha2_NodeLocalDNSConfig_To_kops_NodeLocalDNSConfig(in *NodeLoca
|
|||
|
||||
func autoConvert_kops_NodeLocalDNSConfig_To_v1alpha2_NodeLocalDNSConfig(in *kops.NodeLocalDNSConfig, out *NodeLocalDNSConfig, s conversion.Scope) error {
|
||||
out.Enabled = in.Enabled
|
||||
out.ExternalCoreFile = in.ExternalCoreFile
|
||||
out.Image = in.Image
|
||||
out.LocalIP = in.LocalIP
|
||||
out.ForwardToKubeDNS = in.ForwardToKubeDNS
|
||||
|
|
|
|||
|
|
@ -549,6 +549,8 @@ type KubeDNSConfig struct {
|
|||
type NodeLocalDNSConfig struct {
|
||||
// Enabled activates the node-local-dns addon.
|
||||
Enabled *bool `json:"enabled,omitempty"`
|
||||
// ExternalCoreFile is used to provide a complete NodeLocalDNS CoreFile by the user - ignores other provided flags which modify the CoreFile.
|
||||
ExternalCoreFile string `json:"externalCoreFile,omitempty"`
|
||||
// Image overrides the default docker image used for node-local-dns addon.
|
||||
Image *string `json:"image,omitempty"`
|
||||
// Local listen IP address. It can be any IP in the 169.254.20.0/16 space or any other IP address that can be guaranteed to not collide with any existing IP.
|
||||
|
|
|
|||
|
|
@ -6487,6 +6487,7 @@ func Convert_kops_NetworkingSpec_To_v1alpha3_NetworkingSpec(in *kops.NetworkingS
|
|||
|
||||
func autoConvert_v1alpha3_NodeLocalDNSConfig_To_kops_NodeLocalDNSConfig(in *NodeLocalDNSConfig, out *kops.NodeLocalDNSConfig, s conversion.Scope) error {
|
||||
out.Enabled = in.Enabled
|
||||
out.ExternalCoreFile = in.ExternalCoreFile
|
||||
out.Image = in.Image
|
||||
out.LocalIP = in.LocalIP
|
||||
out.ForwardToKubeDNS = in.ForwardToKubeDNS
|
||||
|
|
@ -6503,6 +6504,7 @@ func Convert_v1alpha3_NodeLocalDNSConfig_To_kops_NodeLocalDNSConfig(in *NodeLoca
|
|||
|
||||
func autoConvert_kops_NodeLocalDNSConfig_To_v1alpha3_NodeLocalDNSConfig(in *kops.NodeLocalDNSConfig, out *NodeLocalDNSConfig, s conversion.Scope) error {
|
||||
out.Enabled = in.Enabled
|
||||
out.ExternalCoreFile = in.ExternalCoreFile
|
||||
out.Image = in.Image
|
||||
out.LocalIP = in.LocalIP
|
||||
out.ForwardToKubeDNS = in.ForwardToKubeDNS
|
||||
|
|
|
|||
|
|
@ -41,6 +41,9 @@ metadata:
|
|||
addonmanager.kubernetes.io/mode: Reconcile
|
||||
data:
|
||||
Corefile: |
|
||||
{{- if KubeDNS.NodeLocalDNS.ExternalCoreFile }}
|
||||
{{ KubeDNS.NodeLocalDNS.ExternalCoreFile | indent 4 }}
|
||||
{{- else }}
|
||||
{{ KubeDNS.Domain }}:53 {
|
||||
errors
|
||||
cache {
|
||||
|
|
@ -104,6 +107,7 @@ data:
|
|||
{{- end }}
|
||||
}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
|
|
|
|||
Loading…
Reference in New Issue