Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix coredns image name with custom image repository #12411

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pkg/minikube/bootstrapper/bsutil/ktmpl/v1beta2.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ certificatesDir: {{.CertDir}}
clusterName: mk
controlPlaneEndpoint: {{.ControlPlaneAddress}}:{{.APIServerPort}}
dns:
type: CoreDNS
type: CoreDNS{{ if .CoreDNSImageRepository}}
imageRepository: {{.CoreDNSImageRepository}}{{end}}
etcd:
local:
dataDir: {{.EtcdDataDir}}
Expand Down
51 changes: 29 additions & 22 deletions pkg/minikube/bootstrapper/bsutil/kubeadm.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,28 +87,29 @@ func GenerateKubeadmYAML(cc config.ClusterConfig, n config.Node, r cruntime.Mana
klog.Infof("Using pod CIDR: %s", podCIDR)

opts := struct {
CertDir string
ServiceCIDR string
PodSubnet string
AdvertiseAddress string
APIServerPort int
KubernetesVersion string
EtcdDataDir string
EtcdExtraArgs map[string]string
ClusterName string
NodeName string
DNSDomain string
CRISocket string
ImageRepository string
ComponentOptions []componentOptions
FeatureArgs map[string]bool
NoTaintMaster bool
NodeIP string
CgroupDriver string
ClientCAFile string
StaticPodPath string
ControlPlaneAddress string
KubeProxyOptions map[string]string
CertDir string
ServiceCIDR string
PodSubnet string
AdvertiseAddress string
APIServerPort int
KubernetesVersion string
EtcdDataDir string
EtcdExtraArgs map[string]string
ClusterName string
NodeName string
DNSDomain string
CRISocket string
ImageRepository string
CoreDNSImageRepository string
ComponentOptions []componentOptions
FeatureArgs map[string]bool
NoTaintMaster bool
NodeIP string
CgroupDriver string
ClientCAFile string
StaticPodPath string
ControlPlaneAddress string
KubeProxyOptions map[string]string
}{
CertDir: vmpath.GuestKubernetesCertsDir,
ServiceCIDR: constants.DefaultServiceCIDR,
Expand Down Expand Up @@ -150,6 +151,12 @@ func GenerateKubeadmYAML(cc config.ClusterConfig, n config.Node, r cruntime.Mana
if version.GTE(semver.MustParse("1.17.0")) {
configTmpl = ktmpl.V1Beta2
}
// handle the renaming of the coredns image from "coredns" to "coredns/coredns"
if version.GTE(semver.MustParse("1.21.0-alpha.1")) &&
opts.ImageRepository != "" &&
opts.CoreDNSImageRepository == "" {
opts.CoreDNSImageRepository = opts.ImageRepository + "/coredns"
}
klog.Infof("kubeadm options: %+v", opts)
if err := configTmpl.Execute(&b, opts); err != nil {
return nil, err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ clusterName: mk
controlPlaneEndpoint: control-plane.minikube.internal:8443
dns:
type: CoreDNS
imageRepository: test/repo/coredns
etcd:
local:
dataDir: /var/lib/minikube/etcd
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ clusterName: mk
controlPlaneEndpoint: control-plane.minikube.internal:8443
dns:
type: CoreDNS
imageRepository: test/repo/coredns
etcd:
local:
dataDir: /var/lib/minikube/etcd
Expand Down