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:
|
enabled:
|
||||||
description: Enabled activates the node-local-dns addon.
|
description: Enabled activates the node-local-dns addon.
|
||||||
type: boolean
|
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:
|
forwardToKubeDNS:
|
||||||
description: If enabled, nodelocal dns will use kubedns as
|
description: If enabled, nodelocal dns will use kubedns as
|
||||||
a default upstream
|
a default upstream
|
||||||
|
|
|
||||||
|
|
@ -580,6 +580,8 @@ type KubeDNSConfig struct {
|
||||||
type NodeLocalDNSConfig struct {
|
type NodeLocalDNSConfig struct {
|
||||||
// Enabled activates the node-local-dns addon.
|
// Enabled activates the node-local-dns addon.
|
||||||
Enabled *bool `json:"enabled,omitempty"`
|
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 overrides the default docker image used for node-local-dns addon.
|
||||||
Image *string `json:"image,omitempty"`
|
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.
|
// 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 {
|
type NodeLocalDNSConfig struct {
|
||||||
// Enabled activates the node-local-dns addon.
|
// Enabled activates the node-local-dns addon.
|
||||||
Enabled *bool `json:"enabled,omitempty"`
|
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 overrides the default docker image used for node-local-dns addon.
|
||||||
Image *string `json:"image,omitempty"`
|
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.
|
// 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 {
|
func autoConvert_v1alpha2_NodeLocalDNSConfig_To_kops_NodeLocalDNSConfig(in *NodeLocalDNSConfig, out *kops.NodeLocalDNSConfig, s conversion.Scope) error {
|
||||||
out.Enabled = in.Enabled
|
out.Enabled = in.Enabled
|
||||||
|
out.ExternalCoreFile = in.ExternalCoreFile
|
||||||
out.Image = in.Image
|
out.Image = in.Image
|
||||||
out.LocalIP = in.LocalIP
|
out.LocalIP = in.LocalIP
|
||||||
out.ForwardToKubeDNS = in.ForwardToKubeDNS
|
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 {
|
func autoConvert_kops_NodeLocalDNSConfig_To_v1alpha2_NodeLocalDNSConfig(in *kops.NodeLocalDNSConfig, out *NodeLocalDNSConfig, s conversion.Scope) error {
|
||||||
out.Enabled = in.Enabled
|
out.Enabled = in.Enabled
|
||||||
|
out.ExternalCoreFile = in.ExternalCoreFile
|
||||||
out.Image = in.Image
|
out.Image = in.Image
|
||||||
out.LocalIP = in.LocalIP
|
out.LocalIP = in.LocalIP
|
||||||
out.ForwardToKubeDNS = in.ForwardToKubeDNS
|
out.ForwardToKubeDNS = in.ForwardToKubeDNS
|
||||||
|
|
|
||||||
|
|
@ -549,6 +549,8 @@ type KubeDNSConfig struct {
|
||||||
type NodeLocalDNSConfig struct {
|
type NodeLocalDNSConfig struct {
|
||||||
// Enabled activates the node-local-dns addon.
|
// Enabled activates the node-local-dns addon.
|
||||||
Enabled *bool `json:"enabled,omitempty"`
|
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 overrides the default docker image used for node-local-dns addon.
|
||||||
Image *string `json:"image,omitempty"`
|
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.
|
// 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 {
|
func autoConvert_v1alpha3_NodeLocalDNSConfig_To_kops_NodeLocalDNSConfig(in *NodeLocalDNSConfig, out *kops.NodeLocalDNSConfig, s conversion.Scope) error {
|
||||||
out.Enabled = in.Enabled
|
out.Enabled = in.Enabled
|
||||||
|
out.ExternalCoreFile = in.ExternalCoreFile
|
||||||
out.Image = in.Image
|
out.Image = in.Image
|
||||||
out.LocalIP = in.LocalIP
|
out.LocalIP = in.LocalIP
|
||||||
out.ForwardToKubeDNS = in.ForwardToKubeDNS
|
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 {
|
func autoConvert_kops_NodeLocalDNSConfig_To_v1alpha3_NodeLocalDNSConfig(in *kops.NodeLocalDNSConfig, out *NodeLocalDNSConfig, s conversion.Scope) error {
|
||||||
out.Enabled = in.Enabled
|
out.Enabled = in.Enabled
|
||||||
|
out.ExternalCoreFile = in.ExternalCoreFile
|
||||||
out.Image = in.Image
|
out.Image = in.Image
|
||||||
out.LocalIP = in.LocalIP
|
out.LocalIP = in.LocalIP
|
||||||
out.ForwardToKubeDNS = in.ForwardToKubeDNS
|
out.ForwardToKubeDNS = in.ForwardToKubeDNS
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,9 @@ metadata:
|
||||||
addonmanager.kubernetes.io/mode: Reconcile
|
addonmanager.kubernetes.io/mode: Reconcile
|
||||||
data:
|
data:
|
||||||
Corefile: |
|
Corefile: |
|
||||||
|
{{- if KubeDNS.NodeLocalDNS.ExternalCoreFile }}
|
||||||
|
{{ KubeDNS.NodeLocalDNS.ExternalCoreFile | indent 4 }}
|
||||||
|
{{- else }}
|
||||||
{{ KubeDNS.Domain }}:53 {
|
{{ KubeDNS.Domain }}:53 {
|
||||||
errors
|
errors
|
||||||
cache {
|
cache {
|
||||||
|
|
@ -104,6 +107,7 @@ data:
|
||||||
{{- end }}
|
{{- end }}
|
||||||
}
|
}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: DaemonSet
|
kind: DaemonSet
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue