Skip to content
This repository has been archived by the owner on Sep 30, 2020. It is now read-only.

Add networking-daemonsets feature #1195

Merged
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ _book
*.mobi
*.pdf
node_modules
kube-aws
58 changes: 55 additions & 3 deletions core/controlplane/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ const (

credentialsDir = "credentials"
userDataDir = "userdata"

// Experimental SelfHosting feature default images.
kubeNetworkingSelfHostingDefaultCalicoNodeImageTag = "v3.0.3"
kubeNetworkingSelfHostingDefaultCalicoCniImageTag = "v2.0.1"
kubeNetworkingSelfHostingDefaultFlannelImageTag = "v0.9.1"
kubeNetworkingSelfHostingDefaultFlannelCniImageTag = "v0.3.0"
kubeNetworkingSelfHostingDefaultTyphaImageTag = "v0.6.2"
)

func NewDefaultCluster() *Cluster {
Expand Down Expand Up @@ -165,6 +172,20 @@ func NewDefaultCluster() *Cluster {
AdminPrivileges: true,
InsecureLogin: false,
},
Kubernetes: Kubernetes{
Networking: Networking{
SelfHosting: SelfHosting{
Enabled: false,
Type: "canal",
Typha: false,
CalicoNodeImage: model.Image{Repo: "quay.io/calico/node", Tag: kubeNetworkingSelfHostingDefaultCalicoNodeImageTag, RktPullDocker: false},
CalicoCniImage: model.Image{Repo: "quay.io/calico/cni", Tag: kubeNetworkingSelfHostingDefaultCalicoCniImageTag, RktPullDocker: false},
FlannelImage: model.Image{Repo: "quay.io/coreos/flannel", Tag: kubeNetworkingSelfHostingDefaultFlannelImageTag, RktPullDocker: false},
FlannelCniImage: model.Image{Repo: "quay.io/coreos/flannel-cni", Tag: kubeNetworkingSelfHostingDefaultFlannelCniImageTag, RktPullDocker: false},
TyphaImage: model.Image{Repo: "quay.io/calico/typha", Tag: kubeNetworkingSelfHostingDefaultTyphaImageTag, RktPullDocker: false},
},
},
},
CloudFormationStreaming: true,
HyperkubeImage: model.Image{Repo: "k8s.gcr.io/hyperkube-amd64", Tag: k8sVer, RktPullDocker: true},
AWSCliImage: model.Image{Repo: "quay.io/coreos/awscli", Tag: "master", RktPullDocker: false},
Expand Down Expand Up @@ -458,9 +479,11 @@ type DeploymentSettings struct {
KubeDns `yaml:"kubeDns,omitempty"`
KubernetesDashboard `yaml:"kubernetesDashboard,omitempty"`
// Images repository
HyperkubeImage model.Image `yaml:"hyperkubeImage,omitempty"`
AWSCliImage model.Image `yaml:"awsCliImage,omitempty"`
CalicoNodeImage model.Image `yaml:"calicoNodeImage,omitempty"`
HyperkubeImage model.Image `yaml:"hyperkubeImage,omitempty"`
AWSCliImage model.Image `yaml:"awsCliImage,omitempty"`

CalicoNodeImage model.Image `yaml:"calicoNodeImage,omitempty"`

CalicoCniImage model.Image `yaml:"calicoCniImage,omitempty"`
CalicoCtlImage model.Image `yaml:"calicoCtlImage,omitempty"`
CalicoKubeControllersImage model.Image `yaml:"calicoKubeControllersImage,omitempty"`
Expand All @@ -482,6 +505,7 @@ type DeploymentSettings struct {
PauseImage model.Image `yaml:"pauseImage,omitempty"`
FlannelImage model.Image `yaml:"flannelImage,omitempty"`
JournaldCloudWatchLogsImage model.Image `yaml:"journaldCloudWatchLogsImage,omitempty"`
Kubernetes Kubernetes `yaml:"kubernetes,omitempty"`
}

// Part of configuration which is specific to worker nodes
Expand Down Expand Up @@ -675,6 +699,25 @@ type LocalStreaming struct {
interval int `yaml:"interval"`
}

type Kubernetes struct {
Networking Networking `yaml:"networking,omitempty"`
}

type Networking struct {
SelfHosting SelfHosting `yaml:"selfHosting"`
}

type SelfHosting struct {
Enabled bool `yaml:"enabled"`
Type string `yaml:"type"`
Typha bool `yaml:"typha"`
CalicoNodeImage model.Image `yaml:"calicoNodeImage"`
CalicoCniImage model.Image `yaml:"calicoCniImage"`
FlannelImage model.Image `yaml:"flannelImage"`
FlannelCniImage model.Image `yaml:"flannelCniImage"`
TyphaImage model.Image `yaml:"typhaImage"`
}

func (c *LocalStreaming) Interval() int64 {
// Convert from seconds to milliseconds (and return as int64 type)
return int64(c.interval * 1000)
Expand Down Expand Up @@ -1184,6 +1227,15 @@ func (c Cluster) validate() error {
}
}

if c.Kubernetes.Networking.SelfHosting.Enabled {
if (c.Kubernetes.Networking.SelfHosting.Type != "canal") && (c.Kubernetes.Networking.SelfHosting.Type != "flannel") {
return fmt.Errorf("networkingdaemonsets - style must be either 'canal' or 'flannel'")
}
if c.Kubernetes.Networking.SelfHosting.Typha && c.Kubernetes.Networking.SelfHosting.Type != "canal" {
return fmt.Errorf("networkingdaemonsets - you can only enable typha when deploying type 'canal'")
}
}

return nil
}

Expand Down
2 changes: 1 addition & 1 deletion core/controlplane/config/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package config

// This file was generated by files_gen.go. DO NOT EDIT by hand.
//
// Last generated at 2018-03-16 15:08:20.735697488 +0000 UTC.
// Last generated at 2018-03-29 16:22:22.612645919 +0000 UTC.

var (
Etcdadm = _Etcdadm
Expand Down
Loading