mirror of https://github.com/k3s-io/k3s
Merge pull request #66499 from rosti/kubedns-images
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 ```pull/8/head
commit
2755000b3e
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue