mirror of https://github.com/kubernetes/kops.git
Remove k8s GTE 1.20 checks as it is always true
This commit is contained in:
parent
22687c48c2
commit
e5d33401dc
|
@ -499,7 +499,7 @@ func (b *ContainerdBuilder) buildContainerdConfig() (string, error) {
|
|||
}
|
||||
config.SetPath([]string{"plugins", "io.containerd.grpc.v1.cri", "containerd", "runtimes", "runc", "runtime_type"}, "io.containerd.runc.v2")
|
||||
// only enable systemd cgroups for kubernetes >= 1.20
|
||||
config.SetPath([]string{"plugins", "io.containerd.grpc.v1.cri", "containerd", "runtimes", "runc", "options", "SystemdCgroup"}, cluster.IsKubernetesGTE("1.20"))
|
||||
config.SetPath([]string{"plugins", "io.containerd.grpc.v1.cri", "containerd", "runtimes", "runc", "options", "SystemdCgroup"}, true)
|
||||
if components.UsesKubenet(cluster.Spec.Networking) {
|
||||
// Using containerd with Kubenet requires special configuration.
|
||||
// This is a temporary backwards-compatible solution for kubenet users and will be deprecated when Kubenet is deprecated:
|
||||
|
|
|
@ -2,7 +2,7 @@ file: /usr/bin/docker-runc
|
|||
mode: +i
|
||||
---
|
||||
contents: |-
|
||||
DOCKER_OPTS=--ip-masq=false --iptables=false --log-driver=json-file --log-level=info --log-opt=max-file=5 --log-opt=max-size=10m --storage-driver=overlay2,overlay,aufs
|
||||
DOCKER_OPTS=--exec-opt=native.cgroupdriver=systemd --ip-masq=false --iptables=false --log-driver=json-file --log-level=info --log-opt=max-file=5 --log-opt=max-size=10m --storage-driver=overlay2,overlay,aufs
|
||||
DOCKER_NOFILE=1000000
|
||||
path: /etc/sysconfig/docker
|
||||
type: file
|
||||
|
|
|
@ -660,11 +660,10 @@ func validateKubeAPIServer(v *kops.KubeAPIServerConfig, c *kops.Cluster, fldPath
|
|||
|
||||
if v.InsecurePort != nil {
|
||||
insecurePort := *v.InsecurePort
|
||||
if c.IsKubernetesGTE("1.20") && insecurePort != 0 {
|
||||
field.Forbidden(fldPath.Child("insecurePort"), "insecurePort can only be 0 as of Kubernetes 1.20")
|
||||
}
|
||||
if c.IsKubernetesGTE("1.24") {
|
||||
field.Forbidden(fldPath.Child("insecurePort"), "insecurePort must not be set as of Kubernetes 1.24")
|
||||
} else if insecurePort != 0 {
|
||||
field.Forbidden(fldPath.Child("insecurePort"), "insecurePort can only be 0 or nil")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -748,9 +747,7 @@ func validateKubelet(k *kops.KubeletConfigSpec, c *kops.Cluster, kubeletPath *fi
|
|||
}
|
||||
|
||||
if k.CPUCFSQuotaPeriod != nil {
|
||||
if c.IsKubernetesGTE("1.20") {
|
||||
allErrs = append(allErrs, field.Forbidden(kubeletPath.Child("cpuCFSQuotaPeriod"), "cpuCFSQuotaPeriod has been removed on Kubernetes >=1.20"))
|
||||
}
|
||||
allErrs = append(allErrs, field.Forbidden(kubeletPath.Child("cpuCFSQuotaPeriod"), "cpuCFSQuotaPeriod has been removed on Kubernetes >=1.20"))
|
||||
}
|
||||
|
||||
if c.IsKubernetesGTE("1.24") {
|
||||
|
@ -1683,9 +1680,6 @@ func validateWarmPool(warmPool *kops.WarmPoolSpec, fldPath *field.Path) (allErrs
|
|||
|
||||
func validateSnapshotController(cluster *kops.Cluster, spec *kops.SnapshotControllerConfig, fldPath *field.Path) (allErrs field.ErrorList) {
|
||||
if spec != nil && fi.BoolValue(spec.Enabled) {
|
||||
if !cluster.IsKubernetesGTE("1.20") {
|
||||
allErrs = append(allErrs, field.Forbidden(fldPath.Child("enabled"), "Snapshot controller requires kubernetes 1.20+"))
|
||||
}
|
||||
if !components.IsCertManagerEnabled(cluster) {
|
||||
allErrs = append(allErrs, field.Forbidden(fldPath.Child("enabled"), "Snapshot controller requires that cert manager is enabled"))
|
||||
}
|
||||
|
|
|
@ -165,11 +165,7 @@ func (b *KubeAPIServerOptionsBuilder) BuildOptions(o interface{}) error {
|
|||
|
||||
// We query via the kube-apiserver-healthcheck proxy, which listens on port 3990
|
||||
c.InsecureBindAddress = ""
|
||||
if b.IsKubernetesGTE("1.20") {
|
||||
c.InsecurePort = nil
|
||||
} else {
|
||||
c.InsecurePort = fi.Int32(0)
|
||||
}
|
||||
c.InsecurePort = nil
|
||||
|
||||
// If metrics-server is enabled, we want aggregator routing enabled so that requests are load balanced.
|
||||
metricsServer := clusterSpec.MetricsServer
|
||||
|
|
|
@ -72,7 +72,7 @@ func (b *DockerOptionsBuilder) BuildOptions(o interface{}) error {
|
|||
docker.Storage = fi.String("overlay2,overlay,aufs")
|
||||
|
||||
// Set systemd as the default cgroup driver in docker from k8s 1.20.
|
||||
if b.IsKubernetesGTE("1.20") && getDockerCgroupDriver(docker.ExecOpt) == "" {
|
||||
if getDockerCgroupDriver(docker.ExecOpt) == "" {
|
||||
docker.ExecOpt = append(docker.ExecOpt, "native.cgroupdriver=systemd")
|
||||
}
|
||||
|
||||
|
|
|
@ -204,8 +204,8 @@ func (b *KubeletOptionsBuilder) BuildOptions(o interface{}) error {
|
|||
}
|
||||
}
|
||||
|
||||
// Set systemd as the default cgroup driver for kubelet from k8s 1.20
|
||||
if b.IsKubernetesGTE("1.20") && clusterSpec.Kubelet.CgroupDriver == "" {
|
||||
// Set systemd as the default cgroup driver for kubelet
|
||||
if clusterSpec.Kubelet.CgroupDriver == "" {
|
||||
clusterSpec.Kubelet.CgroupDriver = "systemd"
|
||||
}
|
||||
|
||||
|
|
|
@ -1166,7 +1166,7 @@ func (b *BootstrapChannelBuilder) buildAddons(c *fi.ModelBuilderContext) (*Addon
|
|||
}
|
||||
}
|
||||
|
||||
if b.IsKubernetesGTE("1.20") && b.Cluster.Spec.SnapshotController != nil && fi.BoolValue(b.Cluster.Spec.SnapshotController.Enabled) {
|
||||
if b.Cluster.Spec.SnapshotController != nil && fi.BoolValue(b.Cluster.Spec.SnapshotController.Enabled) {
|
||||
key := "snapshot-controller.addons.k8s.io"
|
||||
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue