Skip to content

Commit

Permalink
Merge pull request kubernetes#66499 from rosti/kubedns-images
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue (batch tested with PRs 66291, 66471, 66499). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubeadm: Pull sidecar and dnsmasq-nanny images when using kube-dns

**What this PR does / why we need it**:

It appears that sidecar and dnsmasq-nanny images are now required for
kube-dns deployment to work correctly. Thus the following default kube-dns
images are used now:

- k8s.gcr.io/k8s-dns-kube-dns-amd64:1.14.10
- k8s.gcr.io/k8s-dns-sidecar-amd64:1.14.10
- k8s.gcr.io/k8s-dns-dnsmasq-nanny-amd64:1.14.10

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes kubernetes/kubeadm#1016

**Special notes for your reviewer**:

/cc @kubernetes/sig-cluster-lifecycle-pr-reviews
/area kubeadm
/assign @luxas
/assign @timothysc
/kind bug

**Release note**:

```release-note
kubeadm: Pull sidecar and dnsmasq-nanny images when using kube-dns
```
  • Loading branch information
Kubernetes Submit Queue committed Jul 24, 2018
2 parents 4dbcf32 + fb7ba52 commit 2755000
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cmd/kubeadm/app/images/images.go
Expand Up @@ -80,10 +80,14 @@ func GetAllImages(cfg *kubeadmapi.InitConfiguration) []string {
imgs = append(imgs, GetEtcdImage(cfg))
}

dnsImage := GetGenericArchImage(cfg.ImageRepository, "k8s-dns-kube-dns", constants.KubeDNSVersion)
// Append the appropriate DNS images
if features.Enabled(cfg.FeatureGates, features.CoreDNS) {
dnsImage = fmt.Sprintf("%s/%s:%s", cfg.ImageRepository, constants.CoreDNS, constants.CoreDNSVersion)
imgs = append(imgs, GetGenericImage(cfg.ImageRepository, constants.CoreDNS, constants.CoreDNSVersion))
} else {
imgs = append(imgs, GetGenericArchImage(cfg.ImageRepository, "k8s-dns-kube-dns", constants.KubeDNSVersion))
imgs = append(imgs, GetGenericArchImage(cfg.ImageRepository, "k8s-dns-sidecar", constants.KubeDNSVersion))
imgs = append(imgs, GetGenericArchImage(cfg.ImageRepository, "k8s-dns-dnsmasq-nanny", constants.KubeDNSVersion))
}
imgs = append(imgs, dnsImage)

return imgs
}
36 changes: 36 additions & 0 deletions cmd/kubeadm/app/images/images_test.go
Expand Up @@ -211,6 +211,42 @@ func TestGetAllImages(t *testing.T) {
},
expect: constants.Etcd,
},
{
name: "CoreDNS image is returned",
cfg: &kubeadmapi.InitConfiguration{
FeatureGates: map[string]bool{
"CoreDNS": true,
},
},
expect: constants.CoreDNS,
},
{
name: "main kube-dns image is returned",
cfg: &kubeadmapi.InitConfiguration{
FeatureGates: map[string]bool{
"CoreDNS": false,
},
},
expect: "k8s-dns-kube-dns",
},
{
name: "kube-dns sidecar image is returned",
cfg: &kubeadmapi.InitConfiguration{
FeatureGates: map[string]bool{
"CoreDNS": false,
},
},
expect: "k8s-dns-sidecar",
},
{
name: "kube-dns dnsmasq-nanny image is returned",
cfg: &kubeadmapi.InitConfiguration{
FeatureGates: map[string]bool{
"CoreDNS": false,
},
},
expect: "k8s-dns-dnsmasq-nanny",
},
}
for _, tc := range testcases {
t.Run(tc.name, func(t *testing.T) {
Expand Down

0 comments on commit 2755000

Please sign in to comment.