1
0
mirror of https://github.com/rancher/rke.git synced 2025-07-19 01:36:32 +00:00

Change MTU from string to int

This commit is contained in:
Brenda Rearden 2019-12-22 17:22:13 -07:00
parent b578588376
commit 078f11b8a6
13 changed files with 168 additions and 28 deletions

View File

@ -70,7 +70,7 @@ func validateNetworkOptions(c *Cluster) error {
if c.Network.Plugin != NoNetworkPlugin && c.Network.Plugin != FlannelNetworkPlugin && c.Network.Plugin != CalicoNetworkPlugin && c.Network.Plugin != CanalNetworkPlugin && c.Network.Plugin != WeaveNetworkPlugin {
return fmt.Errorf("Network plugin [%s] is not supported", c.Network.Plugin)
}
if c.Network.Plugin == FlannelNetworkPlugin && c.Network.MTU != "" {
if c.Network.Plugin == FlannelNetworkPlugin && c.Network.MTU != 0 {
return fmt.Errorf("Network plugin [%s] does not support configuring MTU", FlannelNetworkPlugin)
}
return nil

6
go.mod
View File

@ -47,9 +47,9 @@ require (
github.com/mattn/go-colorable v0.1.0
github.com/mcuadros/go-version v0.0.0-20180611085657-6d5863ca60fa
github.com/pkg/errors v0.8.1
github.com/rancher/kontainer-driver-metadata v0.0.0-20191219221041-278e61bd811a
github.com/rancher/norman v0.0.0-20191126011629-6269ccdbeace
github.com/rancher/types v0.0.0-20191212174249-7f4ca1e45ee0
github.com/rancher/kontainer-driver-metadata v0.0.0-20191221002039-8e3994417ca3
github.com/rancher/norman v0.0.0-20191209163739-5b9227fe3222
github.com/rancher/types v0.0.0-20191217214229-b0c77ca09648
github.com/sirupsen/logrus v1.4.2
github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337 // indirect
github.com/stretchr/testify v1.4.0

10
go.sum
View File

@ -517,17 +517,19 @@ github.com/prometheus/tsdb v0.8.0/go.mod h1:fSI0j+IUQrDd7+ZtR9WKIGtoYAYAJUKcKhYL
github.com/quobyte/api v0.1.2/go.mod h1:jL7lIHrmqQ7yh05OJ+eEEdHr0u/kmT1Ff9iHd+4H6VI=
github.com/rancher/client-go v1.16.0-rancher.3 h1:bOA0zwtJi8wUeldqfrCGyDRuN6oW+zJ092i/OhWP2nU=
github.com/rancher/client-go v1.16.0-rancher.3/go.mod h1:J69/JveO6XESwVgG53q3Uz5OSfgsv4uxpScmmyYOOlk=
github.com/rancher/kontainer-driver-metadata v0.0.0-20191219221041-278e61bd811a h1:rUNhXhQHCGgMddgksIQtM8K0YFqFt+mvSEVxoVaQBR0=
github.com/rancher/kontainer-driver-metadata v0.0.0-20191219221041-278e61bd811a/go.mod h1:VBeI/67gB2g/zn1R3Tu7VvCCKTiYCX0HfsFVvnm7v2I=
github.com/rancher/kontainer-driver-metadata v0.0.0-20191221002039-8e3994417ca3 h1:sWSTmG+4hQB12QRTtNTj4FP8zcvswvtmRYlkpNr7wKs=
github.com/rancher/kontainer-driver-metadata v0.0.0-20191221002039-8e3994417ca3/go.mod h1:VBeI/67gB2g/zn1R3Tu7VvCCKTiYCX0HfsFVvnm7v2I=
github.com/rancher/norman v0.0.0-20191003174345-0ac7dd6ccb36 h1:N0ZUBJRq/ydy2ULiuqKhmiKShmEtpDOWXxKzVZxTzHk=
github.com/rancher/norman v0.0.0-20191003174345-0ac7dd6ccb36/go.mod h1:kVWc1OyHK9decIY90IYExSHedI5a5qze7IfLiEOTmXQ=
github.com/rancher/norman v0.0.0-20191126010027-3afadb987c81 h1:40IyRSjbSj/jNHpJFOHGOlUvOCIQKUMF6p8Tcc/w1vs=
github.com/rancher/norman v0.0.0-20191126010027-3afadb987c81/go.mod h1:kVWc1OyHK9decIY90IYExSHedI5a5qze7IfLiEOTmXQ=
github.com/rancher/norman v0.0.0-20191209163739-5b9227fe3222 h1:D67/BzFruRD+qtqS0qSa/alyZpIEaAaDuLgM3W+j7kw=
github.com/rancher/norman v0.0.0-20191209163739-5b9227fe3222/go.mod h1:kVWc1OyHK9decIY90IYExSHedI5a5qze7IfLiEOTmXQ=
github.com/rancher/pkg v0.0.0-20190514055449-b30ab9de040e h1:j6+HqCET/NLPBtew2m5apL7jWw/PStQ7iGwXjgAqdvo=
github.com/rancher/pkg v0.0.0-20190514055449-b30ab9de040e/go.mod h1:XbYHTPaXuw8ZY9bylhYKQh/nJxDaTKk3YhAxPl4Qy/k=
github.com/rancher/types v0.0.0-20191115181915-fa1ec441252a/go.mod h1:K5zlxVpe7bY2QgOs1YUcU8dVXtzKncxpGEcvxGMgr0k=
github.com/rancher/types v0.0.0-20191212174249-7f4ca1e45ee0 h1:L/lkhui+jMBxuCV5d8LqRS2iDf42R/60eHyDD4mPKlo=
github.com/rancher/types v0.0.0-20191212174249-7f4ca1e45ee0/go.mod h1:yYtjxRexsviS9aPO0qp1gqnMSLRRoe0JW6Mqu1EbJZM=
github.com/rancher/types v0.0.0-20191217214229-b0c77ca09648 h1:EE6TYL4w7h00rJ/OOi8HwY86+cjtSWKAanPtDrPIlAI=
github.com/rancher/types v0.0.0-20191217214229-b0c77ca09648/go.mod h1:bNhE/LSlF1urIf8XDdHyTe43J2YsHvuUeqWmKmrs8wg=
github.com/rancher/wrangler v0.1.5 h1:HiXOeP6Kci2DK+e04D1g6INT77xAYpAr54zmTTe0Spk=
github.com/rancher/wrangler v0.1.5/go.mod h1:EYP7cqpg42YqElaCm+U9ieSrGQKAXxUH5xsr+XGpWyE=
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=

View File

@ -1655,6 +1655,37 @@ func loadK8sRKESystemImages() map[string]v3.RKESystemImages {
CoreDNSAutoscaler: m("gcr.io/google_containers/cluster-proportional-autoscaler:1.3.0"),
WindowsPodInfraContainer: m("rancher/kubelet-pause:v0.1.3"),
},
// Enabled in Rancher v2.3.4
"v1.15.7-rancher1-1": {
Etcd: m("quay.io/coreos/etcd:v3.3.10-rancher1"),
Kubernetes: m("rancher/hyperkube:v1.15.7-rancher1"),
Alpine: m("rancher/rke-tools:v0.1.51"),
NginxProxy: m("rancher/rke-tools:v0.1.51"),
CertDownloader: m("rancher/rke-tools:v0.1.51"),
KubernetesServicesSidecar: m("rancher/rke-tools:v0.1.51"),
KubeDNS: m("gcr.io/google_containers/k8s-dns-kube-dns:1.15.0"),
DNSmasq: m("gcr.io/google_containers/k8s-dns-dnsmasq-nanny:1.15.0"),
KubeDNSSidecar: m("gcr.io/google_containers/k8s-dns-sidecar:1.15.0"),
KubeDNSAutoscaler: m("gcr.io/google_containers/cluster-proportional-autoscaler:1.3.0"),
Flannel: m("quay.io/coreos/flannel:v0.11.0-rancher1"),
FlannelCNI: m("rancher/flannel-cni:v0.3.0-rancher5"),
CalicoNode: m("quay.io/calico/node:v3.7.4"),
CalicoCNI: m("quay.io/calico/cni:v3.7.4"),
CalicoCtl: m("quay.io/calico/ctl:v2.0.0"),
CalicoControllers: m("quay.io/calico/kube-controllers:v3.7.4"),
CanalNode: m("quay.io/calico/node:v3.7.4"),
CanalCNI: m("quay.io/calico/cni:v3.7.4"),
CanalFlannel: m("quay.io/coreos/flannel:v0.11.0"),
WeaveNode: m("weaveworks/weave-kube:2.5.2"),
WeaveCNI: m("weaveworks/weave-npc:2.5.2"),
PodInfraContainer: m("gcr.io/google_containers/pause:3.1"),
Ingress: m("rancher/nginx-ingress-controller:nginx-0.25.1-rancher1"),
IngressBackend: m("k8s.gcr.io/defaultbackend:1.5-rancher1"),
MetricsServer: m("gcr.io/google_containers/metrics-server:v0.3.3"),
CoreDNS: m("coredns/coredns:1.3.1"),
CoreDNSAutoscaler: m("gcr.io/google_containers/cluster-proportional-autoscaler:1.3.0"),
WindowsPodInfraContainer: m("rancher/kubelet-pause:v0.1.3"),
},
// Experimental in Rancher v2.3.0
"v1.16.1-rancher1-1": {
Etcd: m("quay.io/coreos/etcd:v3.3.15-rancher1"),
@ -1783,6 +1814,38 @@ func loadK8sRKESystemImages() map[string]v3.RKESystemImages {
CoreDNSAutoscaler: m("gcr.io/google_containers/cluster-proportional-autoscaler:1.7.1"),
WindowsPodInfraContainer: m("rancher/kubelet-pause:v0.1.3"),
},
// Enabled in Rancher v2.3.4
"v1.16.4-rancher1-1": {
Etcd: m("quay.io/coreos/etcd:v3.3.15-rancher1"),
Kubernetes: m("rancher/hyperkube:v1.16.4-rancher1"),
Alpine: m("rancher/rke-tools:v0.1.51"),
NginxProxy: m("rancher/rke-tools:v0.1.51"),
CertDownloader: m("rancher/rke-tools:v0.1.51"),
KubernetesServicesSidecar: m("rancher/rke-tools:v0.1.51"),
KubeDNS: m("gcr.io/google_containers/k8s-dns-kube-dns:1.15.0"),
DNSmasq: m("gcr.io/google_containers/k8s-dns-dnsmasq-nanny:1.15.0"),
KubeDNSSidecar: m("gcr.io/google_containers/k8s-dns-sidecar:1.15.0"),
KubeDNSAutoscaler: m("gcr.io/google_containers/cluster-proportional-autoscaler:1.7.1"),
Flannel: m("quay.io/coreos/flannel:v0.11.0-rancher1"),
FlannelCNI: m("rancher/flannel-cni:v0.3.0-rancher5"),
CalicoNode: m("quay.io/calico/node:v3.10.2"),
CalicoCNI: m("quay.io/calico/cni:v3.10.2"),
CalicoControllers: m("quay.io/calico/kube-controllers:v3.10.2"),
CalicoFlexVol: m("quay.io/calico/pod2daemon-flexvol:v3.10.2"),
CanalNode: m("quay.io/calico/node:v3.10.2"),
CanalCNI: m("quay.io/calico/cni:v3.10.2"),
CanalFlannel: m("quay.io/coreos/flannel:v0.11.0"),
CanalFlexVol: m("quay.io/calico/pod2daemon-flexvol:v3.10.2"),
WeaveNode: m("weaveworks/weave-kube:2.5.2"),
WeaveCNI: m("weaveworks/weave-npc:2.5.2"),
PodInfraContainer: m("gcr.io/google_containers/pause:3.1"),
Ingress: m("rancher/nginx-ingress-controller:nginx-0.25.1-rancher1"),
IngressBackend: m("k8s.gcr.io/defaultbackend:1.5-rancher1"),
MetricsServer: m("gcr.io/google_containers/metrics-server:v0.3.4"),
CoreDNS: m("coredns/coredns:1.6.2"),
CoreDNSAutoscaler: m("gcr.io/google_containers/cluster-proportional-autoscaler:1.7.1"),
WindowsPodInfraContainer: m("rancher/kubelet-pause:v0.1.3"),
},
//Experimental out of band
"v1.17.0-rancher1-1": {
Etcd: m("quay.io/coreos/etcd:v3.4.3-rancher1"),

View File

@ -13,16 +13,8 @@ const (
func loadK8sVersionServiceOptions() map[string]v3.KubernetesServicesOptions {
return map[string]v3.KubernetesServicesOptions{
"v1.17.0-rancher1-2": {
Etcd: getETCDOptions(),
KubeAPI: getKubeAPIOptions116(),
Kubelet: getKubeletOptions116(),
KubeController: getKubeControllerOptions(),
Kubeproxy: getKubeProxyOptions(),
Scheduler: getSchedulerOptions(),
},
"v1.17.0-rancher1-1": {
Etcd: getETCDOptions(),
"v1.17": {
Etcd: getETCDOptions117(),
KubeAPI: getKubeAPIOptions116(),
Kubelet: getKubeletOptions116(),
KubeController: getKubeControllerOptions(),
@ -37,6 +29,14 @@ func loadK8sVersionServiceOptions() map[string]v3.KubernetesServicesOptions {
Kubeproxy: getKubeProxyOptions(),
Scheduler: getSchedulerOptions(),
},
"v1.16.4-rancher1-1": {
Etcd: getETCDOptions(),
KubeAPI: getKubeAPIOptions116(),
Kubelet: getKubeletOptions116(),
KubeController: getKubeControllerOptions(),
Kubeproxy: getKubeProxyOptions(),
Scheduler: getSchedulerOptions(),
},
"v1.16": {
KubeAPI: getKubeAPIOptions116(),
Kubelet: getKubeletOptions116(),
@ -52,6 +52,14 @@ func loadK8sVersionServiceOptions() map[string]v3.KubernetesServicesOptions {
Kubeproxy: getKubeProxyOptions(),
Scheduler: getSchedulerOptions(),
},
"v1.15.7-rancher1-1": {
Etcd: getETCDOptions(),
KubeAPI: getKubeAPIOptions115(),
Kubelet: getKubeletOptions115(),
KubeController: getKubeControllerOptions(),
Kubeproxy: getKubeProxyOptions(),
Scheduler: getSchedulerOptions(),
},
"v1.15": {
KubeAPI: getKubeAPIOptions115(),
Kubelet: getKubeletOptions115(),
@ -239,3 +247,11 @@ func getETCDOptions() map[string]string {
"peer-client-cert-auth": "true",
}
}
func getETCDOptions117() map[string]string {
return map[string]string{
"client-cert-auth": "true",
"peer-client-cert-auth": "true",
"enable-v2": "true",
}
}

View File

@ -21,7 +21,7 @@ func loadRKEDefaultK8sVersions() map[string]string {
return map[string]string{
"0.3": "v1.16.3-rancher1-1",
// rke will use default if its version is absent
"default": "v1.16.3-rancher1-1",
"default": "v1.16.4-rancher1-1",
}
}

View File

@ -3,14 +3,17 @@ package v3
import (
"github.com/rancher/norman/condition"
"github.com/rancher/norman/types"
typescond "github.com/rancher/types/condition"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
const (
ClusterScanConditionCreated condition.Cond = "Created"
ClusterScanConditionCompleted condition.Cond = "Completed"
ClusterScanConditionCreated condition.Cond = typescond.Created
ClusterScanConditionRunCompleted condition.Cond = typescond.RunCompleted
ClusterScanConditionCompleted condition.Cond = typescond.Completed
ClusterScanConditionFailed condition.Cond = typescond.Failed
ClusterScanTypeCis = "cis"
DefaultNamespaceForCis = "security-scan"
@ -24,7 +27,9 @@ const (
type CisScanConfig struct {
// IDs of the checks that need to be skipped in the final report
Skip []string `json:"skip"`
OverrideSkip []string `json:"overrideSkip"`
// Override the CIS benchmark version to use for the scan (instead of latest)
OverrideBenchmarkVersion string `json:"overrideBenchmarkVersion,omitempty"`
// Internal flag for debugging master component of the scan
DebugMaster bool `json:"debugMaster"`
// Internal flag for debugging worker component of the scan

View File

@ -128,6 +128,7 @@ type ClusterStatus struct {
// https://kubernetes.io/docs/api-reference/v1.8/#componentstatus-v1-core
Driver string `json:"driver"`
AgentImage string `json:"agentImage"`
AgentImageOverride string `json:"agentImageOverride"`
AuthImage string `json:"authImage"`
ComponentStatuses []ClusterComponentStatus `json:"componentStatuses,omitempty"`
APIEndpoint string `json:"apiEndpoint,omitempty"`

View File

@ -114,6 +114,8 @@ type RKESystemImages struct {
CoreDNS string `yaml:"coredns" json:"coredns,omitempty"`
// CoreDNS autoscaler image
CoreDNSAutoscaler string `yaml:"coredns_autoscaler" json:"corednsAutoscaler,omitempty"`
// Nodelocal image
Nodelocal string `yaml:"nodelocal" json:"nodelocal,omitempty"`
// Kubernetes image
Kubernetes string `yaml:"kubernetes" json:"kubernetes,omitempty"`
// Flannel image
@ -818,6 +820,12 @@ type DNSConfig struct {
StubDomains map[string][]string `yaml:"stubdomains" json:"stubdomains,omitempty"`
// NodeSelector key pair
NodeSelector map[string]string `yaml:"node_selector" json:"nodeSelector,omitempty"`
// Nodelocal DNS
Nodelocal *Nodelocal `yaml:"nodelocal" json:"nodelocal,omitempy"`
}
type Nodelocal struct {
IPAddress string `yaml:"ipaddress" json:"ipAddress,omitempy"`
}
type RKETaint struct {

View File

@ -927,8 +927,8 @@ func (in *ChangePasswordInput) DeepCopy() *ChangePasswordInput {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *CisScanConfig) DeepCopyInto(out *CisScanConfig) {
*out = *in
if in.Skip != nil {
in, out := &in.Skip, &out.Skip
if in.OverrideSkip != nil {
in, out := &in.OverrideSkip, &out.OverrideSkip
*out = make([]string, len(*in))
copy(*out, *in)
}
@ -2697,6 +2697,11 @@ func (in *DNSConfig) DeepCopyInto(out *DNSConfig) {
(*out)[key] = val
}
}
if in.Nodelocal != nil {
in, out := &in.Nodelocal, &out.Nodelocal
*out = new(Nodelocal)
**out = **in
}
return
}
@ -6098,6 +6103,22 @@ func (in *NodeTemplateStatus) DeepCopy() *NodeTemplateStatus {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Nodelocal) DeepCopyInto(out *Nodelocal) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Nodelocal.
func (in *Nodelocal) DeepCopy() *Nodelocal {
if in == nil {
return nil
}
out := new(Nodelocal)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Notification) DeepCopyInto(out *Notification) {
*out = *in

21
vendor/github.com/rancher/types/condition/constants.go generated vendored Normal file
View File

@ -0,0 +1,21 @@
package condition
import (
cond "github.com/rancher/norman/condition"
)
const (
// transition type
Created cond.Cond = "Created"
RunCompleted cond.Cond = "RunCompleted"
// done type
Completed cond.Cond = "Completed"
Ready cond.Cond = "Ready"
// error type
Failed cond.Cond = "Failed"
)

View File

@ -13,7 +13,9 @@ func Mirror(image string) string {
image = strings.Replace(image, "gcr.io/google_containers", "rancher", 1)
image = strings.Replace(image, "quay.io/coreos/", "rancher/coreos-", 1)
image = strings.Replace(image, "quay.io/calico/", "rancher/calico-", 1)
image = strings.Replace(image, "k8s.gcr.io/", "rancher/nginx-ingress-controller-", 1)
image = strings.Replace(image, "plugins/docker", "rancher/plugins-docker", 1)
image = strings.Replace(image, "k8s.gcr.io/defaultbackend", "rancher/nginx-ingress-controller-", 1)
image = strings.Replace(image, "k8s.gcr.io/k8s-dns-node-cache", "rancher/k8s-dns-node-cache", 1)
image = strings.Replace(image, "plugins/docker", "rancher/plugins-docker", 1)
image = strings.Replace(image, "kibana", "rancher/kibana", 1)
image = strings.Replace(image, "jenkins/", "rancher/jenkins-", 1)

7
vendor/modules.txt vendored
View File

@ -129,10 +129,10 @@ github.com/prometheus/procfs
github.com/prometheus/procfs/internal/util
github.com/prometheus/procfs/nfs
github.com/prometheus/procfs/xfs
# github.com/rancher/kontainer-driver-metadata v0.0.0-20191219221041-278e61bd811a
# github.com/rancher/kontainer-driver-metadata v0.0.0-20191221002039-8e3994417ca3
github.com/rancher/kontainer-driver-metadata/rke
github.com/rancher/kontainer-driver-metadata/rke/templates
# github.com/rancher/norman v0.0.0-20191126010027-3afadb987c81
# github.com/rancher/norman v0.0.0-20191209163739-5b9227fe3222
github.com/rancher/norman/condition
github.com/rancher/norman/controller
github.com/rancher/norman/httperror
@ -147,9 +147,10 @@ github.com/rancher/norman/types/convert
github.com/rancher/norman/types/definition
github.com/rancher/norman/types/slice
github.com/rancher/norman/types/values
# github.com/rancher/types v0.0.0-20191209180830-cd2fb5538623
# github.com/rancher/types v0.0.0-20191217214229-b0c77ca09648
github.com/rancher/types/apis/management.cattle.io/v3
github.com/rancher/types/apis/project.cattle.io/v3
github.com/rancher/types/condition
github.com/rancher/types/image
# github.com/rancher/wrangler v0.1.5
github.com/rancher/wrangler/pkg/name