Commit fb7ba523 authored by Rostislav M. Georgiev's avatar Rostislav M. Georgiev

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

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 Signed-off-by: 's avatarRostislav M. Georgiev <rostislavg@vmware.com>
parent 4e0a60a4
......@@ -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
}
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment