Skip to content

Commit

Permalink
[addons/nodelocaldns] Bump image to latest stable v1.20.0
Browse files Browse the repository at this point in the history
As per
kubernetes/dns@3b17e06,
node-local-dns addon is now builded with latest coreDNS base v1.8 and
that brings great consistency between cache and upstream servers in a
manner of configuration, metrics name convention, etc.

So in this commit, we bump node-local-dns image to latest v1.20.0 which
is build upon latest coreDNS and also add support for overriding this
field.

Signed-off-by: dntosas <ntosas@gmail.com>
  • Loading branch information
dntosas committed Aug 29, 2021
1 parent 44c07e2 commit a55989c
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 2 deletions.
4 changes: 4 additions & 0 deletions k8s/crds/kops.k8s.io_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2110,6 +2110,10 @@ spec:
description: If enabled, nodelocal dns will use kubedns as
a default upstream
type: boolean
image:
description: Image overrides the default docker image used
for node-local-dns addon.
type: string
localIP:
description: Local listen IP address. It can be any IP in
the 169.254.20.0/16 space or any other IP address that can
Expand Down
4 changes: 3 additions & 1 deletion pkg/apis/kops/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,10 @@ type KubeDNSConfig struct {

// NodeLocalDNSConfig are options of the node-local-dns
type NodeLocalDNSConfig struct {
// Enabled activates the node-local-dns addon
// Enabled activates the node-local-dns addon.
Enabled *bool `json:"enabled,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.
LocalIP string `json:"localIP,omitempty"`
// If enabled, nodelocal dns will use kubedns as a default upstream
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/v1alpha2/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,8 @@ type KubeDNSConfig struct {
type NodeLocalDNSConfig struct {
// Enabled activates the node-local-dns addon
Enabled *bool `json:"enabled,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.
LocalIP string `json:"localIP,omitempty"`
// If enabled, nodelocal dns will use kubedns as a default upstream
Expand Down
3 changes: 3 additions & 0 deletions pkg/apis/kops/v1alpha2/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/apis/kops/v1alpha2/zz_generated.defaults.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions pkg/apis/kops/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions pkg/model/components/kubedns.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,9 @@ func (b *KubeDnsOptionsBuilder) BuildOptions(o interface{}) error {
nodeLocalDNS.CPURequest = &defaultCPURequest
}

if nodeLocalDNS.Image == nil {
nodeLocalDNS.Image = fi.String("k8s.gcr.io/dns/k8s-dns-node-cache:1.20.0")
}

return nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ spec:
operator: "Exists"
containers:
- name: node-cache
image: k8s.gcr.io/dns/k8s-dns-node-cache:1.17.4
image: {{ KubeDNS.NodeLocalDNS.Image }}
resources:
requests:
cpu: {{ KubeDNS.NodeLocalDNS.CPURequest }}
Expand Down

0 comments on commit a55989c

Please sign in to comment.