fix ingress for k8s v1.19
parent
ed82194171
commit
a2d27892f0
deploy/addons/ingress
pkg/minikube/assets
|
@ -299,7 +299,7 @@ metadata:
|
||||||
namespace: ingress-nginx
|
namespace: ingress-nginx
|
||||||
spec:
|
spec:
|
||||||
type: NodePort
|
type: NodePort
|
||||||
{{- if eq .IngressAPIVersion "v1"}}
|
{{- if and (eq .IngressAPIVersion "v1") (not .LegacyKubernetesVersion)}}
|
||||||
ipFamilyPolicy: SingleStack
|
ipFamilyPolicy: SingleStack
|
||||||
ipFamilies:
|
ipFamilies:
|
||||||
- IPv4
|
- IPv4
|
||||||
|
|
|
@ -239,7 +239,7 @@ var Addons = map[string]*Addon{
|
||||||
"0640"),
|
"0640"),
|
||||||
}, false, "ingress", "", map[string]string{
|
}, false, "ingress", "", map[string]string{
|
||||||
// https://github.com/kubernetes/ingress-nginx/blob/14f6b32032b709d3e0f614ca85954c3583c5fe3d/deploy/static/provider/kind/deploy.yaml#L330
|
// https://github.com/kubernetes/ingress-nginx/blob/14f6b32032b709d3e0f614ca85954c3583c5fe3d/deploy/static/provider/kind/deploy.yaml#L330
|
||||||
"IngressController": "ingress-nginx/controller:v1.0.4@sha256:545cff00370f28363dad31e3b59a94ba377854d3a11f18988f5f9e56841ef9ef",
|
"IngressController": "ingress-nginx/controller:v1.1.0@sha256:f766669fdcf3dc26347ed273a55e754b427eb4411ee075a53f30718b4499076a",
|
||||||
// https://github.com/kubernetes/ingress-nginx/blob/14f6b32032b709d3e0f614ca85954c3583c5fe3d/deploy/static/provider/kind/deploy.yaml#L620
|
// https://github.com/kubernetes/ingress-nginx/blob/14f6b32032b709d3e0f614ca85954c3583c5fe3d/deploy/static/provider/kind/deploy.yaml#L620
|
||||||
"KubeWebhookCertgenCreate": "k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.1.1@sha256:64d8c73dca984af206adf9d6d7e46aa550362b1d7a01f3a0a91b20cc67868660",
|
"KubeWebhookCertgenCreate": "k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.1.1@sha256:64d8c73dca984af206adf9d6d7e46aa550362b1d7a01f3a0a91b20cc67868660",
|
||||||
// https://github.com/kubernetes/ingress-nginx/blob/14f6b32032b709d3e0f614ca85954c3583c5fe3d/deploy/static/provider/kind/deploy.yaml#L670
|
// https://github.com/kubernetes/ingress-nginx/blob/14f6b32032b709d3e0f614ca85954c3583c5fe3d/deploy/static/provider/kind/deploy.yaml#L670
|
||||||
|
@ -790,31 +790,33 @@ func GenerateTemplateData(addon *Addon, cfg config.KubernetesConfig, netInfo Net
|
||||||
}
|
}
|
||||||
|
|
||||||
opts := struct {
|
opts := struct {
|
||||||
Arch string
|
LegacyKubernetesVersion bool
|
||||||
ExoticArch string
|
Arch string
|
||||||
ImageRepository string
|
ExoticArch string
|
||||||
LoadBalancerStartIP string
|
ImageRepository string
|
||||||
LoadBalancerEndIP string
|
LoadBalancerStartIP string
|
||||||
CustomIngressCert string
|
LoadBalancerEndIP string
|
||||||
IngressAPIVersion string
|
CustomIngressCert string
|
||||||
ContainerRuntime string
|
IngressAPIVersion string
|
||||||
Images map[string]string
|
ContainerRuntime string
|
||||||
Registries map[string]string
|
Images map[string]string
|
||||||
CustomRegistries map[string]string
|
Registries map[string]string
|
||||||
NetworkInfo map[string]string
|
CustomRegistries map[string]string
|
||||||
|
NetworkInfo map[string]string
|
||||||
}{
|
}{
|
||||||
Arch: a,
|
LegacyKubernetesVersion: false,
|
||||||
ExoticArch: ea,
|
Arch: a,
|
||||||
ImageRepository: cfg.ImageRepository,
|
ExoticArch: ea,
|
||||||
LoadBalancerStartIP: cfg.LoadBalancerStartIP,
|
ImageRepository: cfg.ImageRepository,
|
||||||
LoadBalancerEndIP: cfg.LoadBalancerEndIP,
|
LoadBalancerStartIP: cfg.LoadBalancerStartIP,
|
||||||
CustomIngressCert: cfg.CustomIngressCert,
|
LoadBalancerEndIP: cfg.LoadBalancerEndIP,
|
||||||
IngressAPIVersion: "v1", // api version for ingress (eg, "v1beta1"; defaults to "v1" for k8s 1.19+)
|
CustomIngressCert: cfg.CustomIngressCert,
|
||||||
ContainerRuntime: cfg.ContainerRuntime,
|
IngressAPIVersion: "v1", // api version for ingress (eg, "v1beta1"; defaults to "v1" for k8s 1.19+)
|
||||||
Images: images,
|
ContainerRuntime: cfg.ContainerRuntime,
|
||||||
Registries: addon.Registries,
|
Images: images,
|
||||||
CustomRegistries: customRegistries,
|
Registries: addon.Registries,
|
||||||
NetworkInfo: make(map[string]string),
|
CustomRegistries: customRegistries,
|
||||||
|
NetworkInfo: make(map[string]string),
|
||||||
}
|
}
|
||||||
if opts.ImageRepository != "" && !strings.HasSuffix(opts.ImageRepository, "/") {
|
if opts.ImageRepository != "" && !strings.HasSuffix(opts.ImageRepository, "/") {
|
||||||
opts.ImageRepository += "/"
|
opts.ImageRepository += "/"
|
||||||
|
@ -832,6 +834,9 @@ func GenerateTemplateData(addon *Addon, cfg config.KubernetesConfig, netInfo Net
|
||||||
if semver.MustParseRange("<1.19.0")(v) {
|
if semver.MustParseRange("<1.19.0")(v) {
|
||||||
opts.IngressAPIVersion = "v1beta1"
|
opts.IngressAPIVersion = "v1beta1"
|
||||||
}
|
}
|
||||||
|
if semver.MustParseRange("<1.20.0")(v) {
|
||||||
|
opts.LegacyKubernetesVersion = true
|
||||||
|
}
|
||||||
|
|
||||||
// Network info for generating template
|
// Network info for generating template
|
||||||
opts.NetworkInfo["ControlPlaneNodeIP"] = netInfo.ControlPlaneNodeIP
|
opts.NetworkInfo["ControlPlaneNodeIP"] = netInfo.ControlPlaneNodeIP
|
||||||
|
|
Loading…
Reference in New Issue