add additional config for node local dns

This commit is contained in:
Jesse Haka 2023-06-03 15:47:47 +03:00
parent da16bdfa7b
commit d7d7a55c41
11 changed files with 32 additions and 2 deletions

View File

@ -3224,6 +3224,11 @@ spec:
description: NodeLocalDNS specifies the configuration for the
node-local-dns addon
properties:
additionalConfig:
description: AdditionalConfig is used to provide additional
config for node local dns by the user - it will include
the original CoreFile made by kOps.
type: string
cpuRequest:
anyOf:
- type: integer

View File

@ -585,6 +585,8 @@ type NodeLocalDNSConfig struct {
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"`
// AdditionalConfig is used to provide additional config for node local dns by the user - it will include the original CoreFile made by kOps.
AdditionalConfig string `json:"additionalConfig,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.

View File

@ -572,6 +572,8 @@ type NodeLocalDNSConfig struct {
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"`
// AdditionalConfig is used to provide additional config for node local dns by the user - it will include the original CoreFile made by kOps.
AdditionalConfig string `json:"additionalConfig,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.

View File

@ -6277,6 +6277,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.AdditionalConfig = in.AdditionalConfig
out.Image = in.Image
out.LocalIP = in.LocalIP
out.ForwardToKubeDNS = in.ForwardToKubeDNS
@ -6294,6 +6295,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.AdditionalConfig = in.AdditionalConfig
out.Image = in.Image
out.LocalIP = in.LocalIP
out.ForwardToKubeDNS = in.ForwardToKubeDNS

View File

@ -554,6 +554,8 @@ type NodeLocalDNSConfig struct {
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"`
// AdditionalConfig is used to provide additional config for node local dns by the user - it will include the original CoreFile made by kOps.
AdditionalConfig string `json:"additionalConfig,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.

View File

@ -6496,6 +6496,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.AdditionalConfig = in.AdditionalConfig
out.Image = in.Image
out.LocalIP = in.LocalIP
out.ForwardToKubeDNS = in.ForwardToKubeDNS
@ -6513,6 +6514,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.AdditionalConfig = in.AdditionalConfig
out.Image = in.Image
out.LocalIP = in.LocalIP
out.ForwardToKubeDNS = in.ForwardToKubeDNS

View File

@ -155,6 +155,11 @@ spec:
memoryLimit: 170Mi
memoryRequest: 70Mi
nodeLocalDNS:
additionalConfig: |
googleapis.com:53 {
bind 169.254.20.10
forward . 10.238.1.130
}
cpuRequest: 25m
enabled: true
forwardToKubeDNS: false

View File

@ -41,7 +41,7 @@ spec:
version: 9.99.0
- id: k8s-1.12
manifest: nodelocaldns.addons.k8s.io/k8s-1.12.yaml
manifestHash: fabeb460a56eda2aa329fe1f932a98f60de82f54bb4baedcdf9d5b2393557d73
manifestHash: 0d1c36564e406cde717c45ea59f8a89f2990a6f1c105d97295d0e1612e570114
name: nodelocaldns.addons.k8s.io
needsRollingUpdate: all
selector:

View File

@ -44,7 +44,7 @@ spec:
apiVersion: v1
data:
Corefile: |-
Corefile: |
cluster.local:53 {
errors
cache {
@ -91,6 +91,10 @@ data:
forward . __PILLAR__UPSTREAM__SERVERS__
prometheus :9253
}
googleapis.com:53 {
bind 169.254.20.10
forward . 10.238.1.130
}
kind: ConfigMap
metadata:
creationTimestamp: null

View File

@ -38,6 +38,11 @@ spec:
kubeDNS:
nodeLocalDNS:
enabled: true
additionalConfig: |
googleapis.com:53 {
bind 169.254.20.10
forward . 10.238.1.130
}
kubernetesVersion: v1.26.0-alpha.0
masterPublicName: api.minimal.example.com
networkCIDR: 172.20.0.0/16

View File

@ -107,6 +107,7 @@ data:
{{- end }}
}
{{- end }}
{{ KubeDNS.NodeLocalDNS.AdditionalConfig | indent 4 }}
{{- end }}
---
apiVersion: apps/v1