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

Bump to Kubernetes v1.6.1 #492

Merged
merged 18 commits into from
Apr 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions contrib/bump-version
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

if [ $# -ne 1 ] || [ `expr $1 : ".*_.*"` == 0 ]; then
echo "USAGE: $0 <target-version>"
echo " example: $0 'v1.5.5_coreos.0'"
echo " example: $0 'v1.6.1_coreos.0'"
exit 1
fi

CURRENT_VERSION=${CURRENT_VERSION:-"v1.5.5_coreos.0"}
CURRENT_VERSION=${CURRENT_VERSION:-"v1.6.1_coreos.0"}
TARGET_VERSION=${1}

CURRENT_VERSION_BASE=${CURRENT_VERSION%%_*}
Expand Down
4 changes: 2 additions & 2 deletions core/controlplane/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
)

const (
k8sVer = "v1.5.5_coreos.0"
k8sVer = "v1.6.1_coreos.0"

credentialsDir = "credentials"
userDataDir = "userdata"
Expand Down Expand Up @@ -105,7 +105,7 @@ func NewDefaultCluster() *Cluster {
HyperkubeImage: model.Image{Repo: "quay.io/coreos/hyperkube", Tag: k8sVer, RktPullDocker: false},
AWSCliImage: model.Image{Repo: "quay.io/coreos/awscli", Tag: "master", RktPullDocker: false},
CalicoNodeImage: model.Image{Repo: "quay.io/calico/node", Tag: "v1.1.0", RktPullDocker: false},
CalicoCniImage: model.Image{Repo: "quay.io/calico/cni", Tag: "v1.6.1", RktPullDocker: false},
CalicoCniImage: model.Image{Repo: "quay.io/calico/cni", Tag: "v1.6.2", RktPullDocker: false},
CalicoPolicyControllerImage: model.Image{Repo: "quay.io/calico/kube-policy-controller", Tag: "v0.5.4", RktPullDocker: false},
ClusterAutoscalerImage: model.Image{Repo: "gcr.io/google_containers/cluster-proportional-autoscaler-amd64", Tag: "1.0.0", RktPullDocker: false},
KubeDnsImage: model.Image{Repo: "gcr.io/google_containers/kubedns-amd64", Tag: "1.9", RktPullDocker: false},
Expand Down
88 changes: 53 additions & 35 deletions core/controlplane/config/templates/cloud-config-controller
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,14 @@ coreos:
cluster-health

ExecStartPre=/bin/sh -ec "find /etc/kubernetes/manifests /srv/kubernetes/manifests -maxdepth 1 -type f | xargs --no-run-if-empty sed -i 's|#ETCD_ENDPOINTS#|${ETCD_ENDPOINTS}|'"
{{if .UseCalico -}}
ExecStartPre=/usr/bin/docker run --rm -e SLEEP=false -v /opt/cni/bin:/host/opt/cni/bin {{ .CalicoCniImage.RepoWithTag }} /install-cni.sh
{{end -}}
ExecStart=/usr/lib/coreos/kubelet-wrapper \
--api-servers=http://localhost:8080 \
--cni-conf-dir=/etc/kubernetes/cni/net.d \
{{/* Work-around until https://github.com/kubernetes/kubernetes/issues/43967 is fixed via https://github.com/kubernetes/kubernetes/pull/43995 */ -}}
--cni-bin-dir=/opt/cni/bin \
--network-plugin={{.K8sNetworkPlugin}} \
--container-runtime={{.ContainerRuntime}} \
--rkt-path=/usr/bin/rkt \
Expand Down Expand Up @@ -628,10 +633,14 @@ write_files:
k8s-app: calico-node
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''
scheduler.alpha.kubernetes.io/tolerations: |
[{"key": "node.alpha.kubernetes.io/role", "value": "master", "effect": "NoSchedule" },
{"key":"CriticalAddonsOnly", "operator":"Exists"}]
spec:
tolerations:
- key: "node.alpha.kubernetes.io/role"
operator: "Equal"
value: "master"
effect: "NoSchedule"
- key: "CriticalAddonsOnly"
operator: "Exists"
hostNetwork: true
containers:
- name: calico-node
Expand Down Expand Up @@ -677,30 +686,6 @@ write_files:
- mountPath: /etc/resolv.conf
name: dns
readOnly: true
- name: install-cni
image: {{ .CalicoCniImage.RepoWithTag }}
imagePullPolicy: Always
command: ["/install-cni.sh"]
env:
- name: ETCD_ENDPOINTS
valueFrom:
configMapKeyRef:
name: calico-config
key: etcd_endpoints
- name: CNI_NETWORK_CONFIG
valueFrom:
configMapKeyRef:
name: calico-config
key: cni_network_config
- name: CNI_NET_DIR
value: "/etc/kubernetes/cni/net.d"
volumeMounts:
- mountPath: /host/opt/cni/bin
name: cni-bin-dir
- mountPath: /host/etc/cni/net.d
name: cni-net-dir
- mountPath: /calico-secrets
name: etcd-certs
volumes:
- name: lib-modules
hostPath:
Expand Down Expand Up @@ -732,9 +717,6 @@ write_files:
k8s-app: calico-policy
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''
scheduler.alpha.kubernetes.io/tolerations: |
[{"key": "node.alpha.kubernetes.io/role", "value": "master", "effect": "NoSchedule" },
{"key":"CriticalAddonsOnly", "operator":"Exists"}]

spec:
replicas: 1
Expand All @@ -745,6 +727,13 @@ write_files:
labels:
k8s-app: calico-policy
spec:
tolerations:
- key: "node.alpha.kubernetes.io/role"
operator: "Equal"
value: "master"
effect: "NoSchedule"
- key: "CriticalAddonsOnly"
operator: "Exists"
hostNetwork: true
containers:
- name: calico-policy-controller
Expand Down Expand Up @@ -1262,8 +1251,10 @@ write_files:
k8s-app: kube-rescheduler
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''
scheduler.alpha.kubernetes.io/tolerations: '[{"key":"CriticalAddonsOnly", "operator":"Exists"}]'
spec:
tolerations:
- key: "CriticalAddonsOnly"
operator: "Exists"
hostNetwork: true
containers:
- name: kube-rescheduler
Expand Down Expand Up @@ -1291,8 +1282,10 @@ write_files:
k8s-app: kube-dns-autoscaler
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''
scheduler.alpha.kubernetes.io/tolerations: '[{"key":"CriticalAddonsOnly", "operator":"Exists"}]'
spec:
tolerations:
- key: "CriticalAddonsOnly"
operator: "Exists"
containers:
- name: autoscaler
image: {{ .ClusterAutoscalerImage.RepoWithTag }}
Expand Down Expand Up @@ -1338,8 +1331,10 @@ write_files:
k8s-app: kube-dns
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''
scheduler.alpha.kubernetes.io/tolerations: '[{"key":"CriticalAddonsOnly", "operator":"Exists"}]'
spec:
tolerations:
- key: "CriticalAddonsOnly"
operator: "Exists"
containers:
- name: kubedns
image: {{ .KubeDnsImage.RepoWithTag }}
Expand Down Expand Up @@ -1501,8 +1496,10 @@ write_files:
version: v1.3.0
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''
scheduler.alpha.kubernetes.io/tolerations: '[{"key":"CriticalAddonsOnly", "operator":"Exists"}]'
spec:
tolerations:
- key: "CriticalAddonsOnly"
operator: "Exists"
containers:
- image: {{ .HeapsterImage.RepoWithTag }}
name: heapster
Expand Down Expand Up @@ -1594,8 +1591,10 @@ write_files:
kubernetes.io/cluster-service: "true"
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''
scheduler.alpha.kubernetes.io/tolerations: '[{"key":"CriticalAddonsOnly", "operator":"Exists"}]'
spec:
tolerations:
- key: "CriticalAddonsOnly"
operator: "Exists"
containers:
- name: kubernetes-dashboard
image: {{ .KubeDashboardImage.RepoWithTag }}
Expand Down Expand Up @@ -1680,6 +1679,25 @@ write_files:

{{ else }}

- path: /etc/kubernetes/cni/net.d/10-calico.conf
content: |
{
"name": "calico",
"type": "flannel",
"delegate": {
"type": "calico",
"etcd_endpoints": "#ETCD_ENDPOINTS#",
"etcd_key_file": "/etc/kubernetes/ssl/etcd-client-key.pem",
"etcd_cert_file": "/etc/kubernetes/ssl/etcd-client.pem",
"etcd_ca_cert_file": "/etc/kubernetes/ssl/ca.pem",
"log_level": "info",
"policy": {
"type": "k8s",
"k8s_api_root": "http://127.0.0.1:8080/api/v1/"
}
}
}

# http://docs.projectcalico.org/v2.0/usage/configuration/
- path: /etc/modules-load.d/nf.conf
content: |
Expand Down
6 changes: 6 additions & 0 deletions core/controlplane/config/templates/cloud-config-etcd
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,12 @@ coreos:
ExecStartPre=/usr/bin/systemctl is-active decrypt-assets.service
{{- end}}
ExecStartPre=/usr/bin/chown -R etcd:etcd /var/lib/etcd2
{{if .Etcd.Version.Is3 }}
- name: 40-version.conf
content: |
[Service]
Environment="ETCD_IMAGE_TAG=v{{.Etcd.Version}}"
{{end}}
enable: true
command: start

Expand Down
29 changes: 28 additions & 1 deletion core/controlplane/config/templates/cloud-config-worker
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,14 @@ coreos:
--cert-file /etc/kubernetes/ssl/etcd-client.pem \
--endpoints "${ETCD_ENDPOINTS}" \
cluster-health
{{if .UseCalico -}}
ExecStartPre=/usr/bin/docker run --rm -e SLEEP=false -v /opt/cni/bin:/host/opt/cni/bin {{ .CalicoCniImage.RepoWithTag }} /install-cni.sh
{{end -}}
ExecStart=/usr/lib/coreos/kubelet-wrapper \
--api-servers={{.APIServerEndpoint}} \
--network-plugin-dir=/etc/kubernetes/cni/net.d \
--cni-conf-dir=/etc/kubernetes/cni/net.d \
{{/* Work-around until https://github.com/kubernetes/kubernetes/issues/43967 is fixed via https://github.com/kubernetes/kubernetes/pull/43995 */ -}}
--cni-bin-dir=/opt/cni/bin \
--network-plugin={{.K8sNetworkPlugin}} \
--container-runtime={{.ContainerRuntime}} \
--rkt-path=/usr/bin/rkt \
Expand Down Expand Up @@ -811,6 +816,28 @@ write_files:

{{ else }}

- path: /etc/kubernetes/cni/net.d/10-calico.conf
content: |
{
"name": "calico",
"type": "flannel",
"delegate": {
"type": "calico",
"etcd_endpoints": "#ETCD_ENDPOINTS#",
"etcd_key_file": "/etc/kubernetes/ssl/etcd-client-key.pem",
"etcd_cert_file": "/etc/kubernetes/ssl/etcd-client.pem",
"etcd_ca_cert_file": "/etc/kubernetes/ssl/ca.pem",
"log_level": "info",
"policy": {
"type": "k8s",
"k8s_api_root": "https://{{.APIEndpoint.DNSName}}/api/v1/",
"k8s_client_key": "/etc/kubernetes/ssl/worker-key.pem",
"k8s_client_certificate": "/etc/kubernetes/ssl/worker.pem",
"k8s_certificate_authority": "/etc/kubernetes/ssl/ca.pem"
}
}
}

# http://docs.projectcalico.org/v2.0/usage/configuration/
- path: /etc/modules-load.d/nf.conf
content: |
Expand Down
2 changes: 1 addition & 1 deletion core/controlplane/config/templates/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ worker:
# and pulling from quay or dockerhub is slow and you get many timeouts.

# Version of hyperkube image to use. This is the tag for the hyperkube image repository.
# kubernetesVersion: v1.5.5_coreos.0
# kubernetesVersion: v1.6.1_coreos.0

# Hyperkube image repository to use.
# hyperkubeImage:
Expand Down
17 changes: 17 additions & 0 deletions core/controlplane/config/templates/stack-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,23 @@
},
"Type": "AWS::EC2::SecurityGroup"
},
{{if $.UseCalico -}}
{{/* Required by calico-policy-controller when calico is enabled. See https://github.com/kubernetes-incubator/kube-aws/issues/494#issuecomment-291687137 */}}
"SecurityGroupControllerIngressFromControllerToController": {
"Properties": {
"FromPort": 443,
"GroupId": {
"Ref": "SecurityGroupController"
},
"IpProtocol": "tcp",
"SourceSecurityGroupId": {
"Ref": "SecurityGroupController"
},
"ToPort": 443
},
"Type": "AWS::EC2::SecurityGroupIngress"
},
{{end -}}
"SecurityGroupControllerIngressFromControllerToKubelet": {
"Properties": {
"FromPort": 10250,
Expand Down
1 change: 1 addition & 0 deletions core/nodepool/config/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ func (c DeploymentSettings) WithDefaultsFrom(main cfg.DeploymentSettings) Deploy
c.HyperkubeImage.Tag = c.K8sVer
c.AWSCliImage.MergeIfEmpty(main.AWSCliImage)
c.CalicoCtlImage.MergeIfEmpty(main.CalicoCtlImage)
c.CalicoCniImage.MergeIfEmpty(main.CalicoCniImage)
c.PauseImage.MergeIfEmpty(main.PauseImage)
c.FlannelImage.MergeIfEmpty(main.FlannelImage)

Expand Down
2 changes: 1 addition & 1 deletion e2e/kubernetes/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM golang:1.7.1

ARG KUBERNETES_VERSION=${KUBERNETES_VERSION:-v1.5.5+coreos.0}
ARG KUBERNETES_VERSION=${KUBERNETES_VERSION:-v1.6.1+coreos.0}

RUN apt-get update && \
apt-get install -y rsync && \
Expand Down
2 changes: 1 addition & 1 deletion e2e/kubernetes/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
KUBERNETES_VERSION ?= v1.5.5+coreos.0
KUBERNETES_VERSION ?= v1.6.1+coreos.0
DOCKER_REPO ?=
DOCKER_TAG ?= $(DOCKER_REPO)kube-e2e:$(KUBERNETES_VERSION)
DOCKER_TAG_SANITIZED ?= $(shell echo $(DOCKER_TAG) | sed -e 's/+/_/')
Expand Down
4 changes: 2 additions & 2 deletions e2e/run
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SRC_DIR=$(cd $(dirname $0); cd ..; pwd)
KUBECONFIG=${WORK_DIR}/kubeconfig
ETCD_COUNT=${ETCD_COUNT:-3}
CONTROLLER_COUNT=${CONTROLLER_COUNT:-2}
ETCD_VERSION=${ETCD_VERSION:-3}
ETCD_VERSION=${ETCD_VERSION:-}

export KUBECONFIG

Expand Down Expand Up @@ -234,7 +234,7 @@ etcd:
count: $ETCD_COUNT" >> cluster.yaml

if [ "${ETCD_VERSION}" != "" ]; then
echo -e " version: 3" >> cluster.yaml
echo -e " version: ${ETCD_VERSION}" >> cluster.yaml
fi

if [ "${ETCD_DISASTER_RECOVERY_AUTOMATED}" != "" ]; then
Expand Down
7 changes: 2 additions & 5 deletions model/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,12 @@ func (e Etcd) SystemdUnitName() string {
return "etcd2.service"
}

// Version returns the version of etcd (e.g. `2`, `3`, `3.1.3`) to be used for this etcd cluster
// Version returns the version of etcd (e.g. `3.1.5`) to be used for this etcd cluster
func (e Etcd) Version() EtcdVersion {
if e.Cluster.Version != "" {
return e.Cluster.Version
}
if e.Cluster.Version == "3" {
return "3.1.3"
}
return "2"
return "3.1.5"
}

func (v EtcdVersion) Is3() bool {
Expand Down