Skip to content

Commit

Permalink
Add correct CNI mounts and also weave bin support for kubelet-wraper
Browse files Browse the repository at this point in the history
  • Loading branch information
lewismarshall committed May 26, 2017
1 parent 02e7866 commit 539fc5f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ package constants
const (
// DefaultKubeVersion specifies a default kubernetes version.
DefaultKubeVersion = "v1.6.4"
// DefaultNetworkProvider specifies what CNI provider to install
DefaultNetworkProvider = "canal"
// DefaultKetoK8Image specifies the image to use for keto-k8 container
DefaultKetoK8Image = "quay.io/ukhomeofficedigital/keto-k8:v0.0.1"
DefaultKetoK8Image = "quay.io/ukhomeofficedigital/keto-k8:v0.0.2"
// DefaultComputePoolSize specifies a default number of machines in a single compute pool.
DefaultComputePoolSize = 1
// DefaultDiskSizeInGigabytes specifies a default node disk size in gigabytes.
Expand Down
13 changes: 13 additions & 0 deletions pkg/userdata/userdata.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ coreos:
update:
reboot-strategy: "off"
units:
- name: flanneld.service
mask: true
- name: systemd-sysctl.service
command: restart
- name: systemd-resolved.service
Expand Down Expand Up @@ -197,6 +199,7 @@ coreos:
--kube-ca-cert=/data/ca/kube/ca.crt \
--kube-ca-key=/data/ca/kube/ca.key \
--cloud-provider={{ .CloudProviderName }} \
--network-provider={{ .NetworkProvider }} \
--etcd-endpoints=https://127.0.0.1:2379
ExecStart=/usr/bin/bash -c "while true; do sleep 1000; done"
Restart=always
Expand All @@ -215,11 +218,14 @@ coreos:
Environment="RKT_OPTS=\
--uuid-file-save=/var/run/kubelet-pod.uuid \
--volume etc-resolv,kind=host,source=/etc/resolv.conf --mount volume=etc-resolv,target=/etc/resolv.conf \
--volume etc-cni,kind=host,source=/etc/cni --mount volume=etc-cni,target=/etc/cni \
--volume opt-cni,kind=host,source=/opt/cni,readOnly=true --mount volume=opt-cni,target=/opt/weave-net \
--volume var-log,kind=host,source=/var/log --mount volume=var-log,target=/var/log \
--volume var-lib-cni,kind=host,source=/var/lib/cni --mount volume=var-lib-cni,target=/var/lib/cni"
EnvironmentFile=/etc/environment
ExecStartPre=/bin/mkdir -p /etc/kubernetes/manifests
ExecStartPre=/bin/mkdir -p /etc/cni/net.d
ExecStartPre=/bin/mkdir -p /opt/cni
ExecStartPre=/bin/mkdir -p /etc/kubernetes/checkpoint-secrets
ExecStartPre=/bin/mkdir -p /srv/kubernetes/manifests
ExecStartPre=/bin/mkdir -p /var/lib/cni
Expand Down Expand Up @@ -303,12 +309,14 @@ write_files:
KubeVersion string
KetoK8Image string
MasterPersistentNodeIDIP map[string]string
NetworkProvider string
}{
CloudProviderName: cloudProviderName,
ClusterName: clusterName,
KubeVersion: kubeVersion,
KetoK8Image: constants.DefaultKetoK8Image,
MasterPersistentNodeIDIP: masterPersistentNodeIDIP,
NetworkProvider: constants.DefaultNetworkProvider,
}

t := template.Must(template.New("master-cloud-config").Parse(masterTemplate))
Expand All @@ -327,6 +335,8 @@ coreos:
update:
reboot-strategy: "off"
units:
- name: flanneld.service
mask: true
- name: docker.service
drop-ins:
- name: 10-opts.conf
Expand Down Expand Up @@ -385,12 +395,15 @@ coreos:
Environment="RKT_OPTS=\
--uuid-file-save=/var/run/kubelet-pod.uuid \
--volume etc-resolv,kind=host,source=/etc/resolv.conf --mount volume=etc-resolv,target=/etc/resolv.conf \
--volume etc-cni,kind=host,source=/etc/cni,readOnly=true --mount volume=etc-cni,target=/etc/cni \
--volume opt-cni,kind=host,source=/opt/cni,readOnly=true --mount volume=opt-cni,target=/opt/weave-net \
--volume var-log,kind=host,source=/var/log --mount volume=var-log,target=/var/log \
--volume var-lib-cni,kind=host,source=/var/lib/cni --mount volume=var-lib-cni,target=/var/lib/cni"
EnvironmentFile=/etc/environment
EnvironmentFile=/etc/kubernetes/keto-token.env
ExecStartPre=/bin/mkdir -p /etc/kubernetes/manifests
ExecStartPre=/bin/mkdir -p /etc/cni/net.d
ExecStartPre=/bin/mkdir -p /opt/cni
ExecStartPre=/bin/mkdir -p /etc/kubernetes/checkpoint-secrets
ExecStartPre=/bin/mkdir -p /srv/kubernetes/manifests
ExecStartPre=/bin/mkdir -p /var/lib/cni
Expand Down

0 comments on commit 539fc5f

Please sign in to comment.