mirror of https://github.com/kubernetes/kops.git
Merge pull request #3869 from chrislovecnm/calico-2.6-update
Automatic merge from submit-queue. Updating Calico manifests to Calico release 2.6.2 Renamed the k8s-1.8 manifest to a k8s-1.7. This is required because of config change that occurs between k8s 1.6 and k8s 1.7. This refactor will also be re-used when Calico Kubernetes data source support is added to kops. Updated bootstrapchannelbuilder with the new Calico version numbers. The diffs for the k8s-1.6 version is pretty rough, tried to make it cleaner, but nada. FIXES: https://github.com/kubernetes/kops/issues/3866 FIXES: https://github.com/kubernetes/kops/issues/3867 Line: https://github.com/kubernetes/kops/compare/master...chrislovecnm:calico-2.6-update?expand=1#diff-891cbc61587adb202b66b7c9bc6896daR209 is why Calico would not start on k8s 1.6 - thanks @caseydavenport **TODO** Testing K8s versions - [x] test 1.5 - [x] test 1.6 - [x] test 1.7 - [x] test 1.8 /cc @blakebarnett @itajaja
This commit is contained in:
commit
8eac358795
|
@ -5,7 +5,7 @@ metadata:
|
||||||
name: calico-config
|
name: calico-config
|
||||||
namespace: kube-system
|
namespace: kube-system
|
||||||
data:
|
data:
|
||||||
# The calico-etcd PetSet service IP:port
|
# etcd servers
|
||||||
etcd_endpoints: "{{ $cluster := index .EtcdClusters 0 -}}
|
etcd_endpoints: "{{ $cluster := index .EtcdClusters 0 -}}
|
||||||
{{- range $j, $member := $cluster.Members -}}
|
{{- range $j, $member := $cluster.Members -}}
|
||||||
{{- if $j }},{{ end -}}
|
{{- if $j }},{{ end -}}
|
||||||
|
@ -18,33 +18,22 @@ data:
|
||||||
# The CNI network configuration to install on each node.
|
# The CNI network configuration to install on each node.
|
||||||
cni_network_config: |-
|
cni_network_config: |-
|
||||||
{
|
{
|
||||||
"name": "k8s-pod-network",
|
"name": "k8s-pod-network",
|
||||||
"cniVersion": "0.3.0",
|
"type": "calico",
|
||||||
"plugins": [
|
"etcd_endpoints": "__ETCD_ENDPOINTS__",
|
||||||
{
|
"log_level": "info",
|
||||||
"type": "calico",
|
"ipam": {
|
||||||
"etcd_endpoints": "__ETCD_ENDPOINTS__",
|
|
||||||
"log_level": "info",
|
|
||||||
"ipam": {
|
|
||||||
"type": "calico-ipam"
|
"type": "calico-ipam"
|
||||||
},
|
|
||||||
"policy": {
|
|
||||||
"type": "k8s",
|
|
||||||
"k8s_api_root": "https://__KUBERNETES_SERVICE_HOST__:__KUBERNETES_SERVICE_PORT__",
|
|
||||||
"k8s_auth_token": "__SERVICEACCOUNT_TOKEN__"
|
|
||||||
},
|
|
||||||
"kubernetes": {
|
|
||||||
"kubeconfig": "/etc/cni/net.d/__KUBECONFIG_FILENAME__"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
"policy": {
|
||||||
"type": "portmap",
|
"type": "k8s",
|
||||||
"snat": true,
|
"k8s_api_root": "https://__KUBERNETES_SERVICE_HOST__:__KUBERNETES_SERVICE_PORT__",
|
||||||
"capabilities": {"portMappings": true}
|
"k8s_auth_token": "__SERVICEACCOUNT_TOKEN__"
|
||||||
|
},
|
||||||
|
"kubernetes": {
|
||||||
|
"kubeconfig": "/etc/cni/net.d/__KUBECONFIG_FILENAME__"
|
||||||
}
|
}
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
kind: ClusterRole
|
kind: ClusterRole
|
||||||
|
@ -133,12 +122,15 @@ spec:
|
||||||
operator: Exists
|
operator: Exists
|
||||||
- effect: NoSchedule
|
- effect: NoSchedule
|
||||||
operator: Exists
|
operator: Exists
|
||||||
|
# Minimize downtime during a rolling upgrade or deletion; tell Kubernetes to do a "force
|
||||||
|
# deletion": https://kubernetes.io/docs/concepts/workloads/pods/pod/#termination-of-pods.
|
||||||
|
terminationGracePeriodSeconds: 0
|
||||||
containers:
|
containers:
|
||||||
# Runs calico/node container on each Kubernetes node. This
|
# Runs calico/node container on each Kubernetes node. This
|
||||||
# container programs network policy and routes on each
|
# container programs network policy and routes on each
|
||||||
# host.
|
# host.
|
||||||
- name: calico-node
|
- name: calico-node
|
||||||
image: quay.io/calico/node:v2.4.1
|
image: quay.io/calico/node:v2.6.2
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 10m
|
cpu: 10m
|
||||||
|
@ -169,6 +161,14 @@ spec:
|
||||||
# Auto-detect the BGP IP address.
|
# Auto-detect the BGP IP address.
|
||||||
- name: IP
|
- name: IP
|
||||||
value: ""
|
value: ""
|
||||||
|
# Disable IPv6 on Kubernetes.
|
||||||
|
- name: FELIX_IPV6SUPPORT
|
||||||
|
value: "false"
|
||||||
|
# Set Felix logging to "info"
|
||||||
|
- name: FELIX_LOGSEVERITYSCREEN
|
||||||
|
value: "info"
|
||||||
|
- name: FELIX_HEALTHENABLED
|
||||||
|
value: "true"
|
||||||
securityContext:
|
securityContext:
|
||||||
privileged: true
|
privileged: true
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
|
@ -185,7 +185,7 @@ spec:
|
||||||
# This container installs the Calico CNI binaries
|
# This container installs the Calico CNI binaries
|
||||||
# and CNI network config file on each node.
|
# and CNI network config file on each node.
|
||||||
- name: install-cni
|
- name: install-cni
|
||||||
image: quay.io/calico/cni:v1.10.0
|
image: quay.io/calico/cni:v1.11.0
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 10m
|
cpu: 10m
|
||||||
|
@ -194,7 +194,7 @@ spec:
|
||||||
env:
|
env:
|
||||||
# The name of calico config file
|
# The name of calico config file
|
||||||
- name: CNI_CONF_NAME
|
- name: CNI_CONF_NAME
|
||||||
value: 10-calico.conflist
|
value: 10-calico.conf
|
||||||
# The location of the Calico etcd cluster.
|
# The location of the Calico etcd cluster.
|
||||||
- name: ETCD_ENDPOINTS
|
- name: ETCD_ENDPOINTS
|
||||||
valueFrom:
|
valueFrom:
|
||||||
|
@ -237,8 +237,8 @@ spec:
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
# This manifest deploys the Calico policy controller on Kubernetes.
|
# This deployment turns off the old "policy-controller". It should remain at 0 replicas, and then
|
||||||
# See https://github.com/projectcalico/k8s-policy
|
# be removed entirely once the new kube-controllers deployment has been deployed above.
|
||||||
apiVersion: extensions/v1beta1
|
apiVersion: extensions/v1beta1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -246,35 +246,23 @@ metadata:
|
||||||
namespace: kube-system
|
namespace: kube-system
|
||||||
labels:
|
labels:
|
||||||
k8s-app: calico-policy
|
k8s-app: calico-policy
|
||||||
role.kubernetes.io/networking: "1"
|
|
||||||
spec:
|
spec:
|
||||||
# The policy controller can only have a single active instance.
|
# Turn this deployment off in favor of the kube-controllers deployment above.
|
||||||
replicas: 1
|
replicas: 0
|
||||||
|
strategy:
|
||||||
|
type: Recreate
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
name: calico-policy-controller
|
name: calico-policy-controller
|
||||||
namespace: kube-system
|
namespace: kube-system
|
||||||
labels:
|
labels:
|
||||||
k8s-app: calico-policy-controller
|
k8s-app: calico-policy
|
||||||
role.kubernetes.io/networking: "1"
|
|
||||||
annotations:
|
|
||||||
scheduler.alpha.kubernetes.io/critical-pod: ''
|
|
||||||
spec:
|
spec:
|
||||||
# The policy controller must run in the host network namespace so that
|
|
||||||
# it isn't governed by policy that would prevent it from working.
|
|
||||||
hostNetwork: true
|
hostNetwork: true
|
||||||
serviceAccountName: calico
|
serviceAccountName: calico
|
||||||
tolerations:
|
|
||||||
- key: node-role.kubernetes.io/master
|
|
||||||
effect: NoSchedule
|
|
||||||
- key: CriticalAddonsOnly
|
|
||||||
operator: Exists
|
|
||||||
containers:
|
containers:
|
||||||
- name: calico-policy-controller
|
- name: calico-policy-controller
|
||||||
image: quay.io/calico/kube-policy-controller:v0.7.0
|
image: quay.io/calico/kube-controllers:v1.0.0
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
cpu: 10m
|
|
||||||
env:
|
env:
|
||||||
# The location of the Calico etcd cluster.
|
# The location of the Calico etcd cluster.
|
||||||
- name: ETCD_ENDPOINTS
|
- name: ETCD_ENDPOINTS
|
||||||
|
@ -282,15 +270,6 @@ spec:
|
||||||
configMapKeyRef:
|
configMapKeyRef:
|
||||||
name: calico-config
|
name: calico-config
|
||||||
key: etcd_endpoints
|
key: etcd_endpoints
|
||||||
# The location of the Kubernetes API. Use the default Kubernetes
|
|
||||||
# service for API access.
|
|
||||||
- name: K8S_API
|
|
||||||
value: "https://kubernetes.default:443"
|
|
||||||
# Since we're running in the host namespace and might not have KubeDNS
|
|
||||||
# access, configure the container's /etc/hosts to resolve
|
|
||||||
# kubernetes.default to the correct service clusterIP.
|
|
||||||
- name: CONFIGURE_ETC_HOSTS
|
|
||||||
value: "true"
|
|
||||||
|
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
# Necessary for gossip based DNS
|
# Necessary for gossip based DNS
|
||||||
|
@ -301,6 +280,55 @@ spec:
|
||||||
- name: etc-hosts
|
- name: etc-hosts
|
||||||
hostPath:
|
hostPath:
|
||||||
path: /etc/hosts
|
path: /etc/hosts
|
||||||
|
---
|
||||||
|
|
||||||
|
# This manifest deploys the Calico Kubernetes controllers.
|
||||||
|
# See https://github.com/projectcalico/kube-controllers
|
||||||
|
apiVersion: extensions/v1beta1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: calico-kube-controllers
|
||||||
|
namespace: kube-system
|
||||||
|
labels:
|
||||||
|
k8s-app: calico-kube-controllers
|
||||||
|
role.kubernetes.io/networking: "1"
|
||||||
|
spec:
|
||||||
|
# The controllers can only have a single active instance.
|
||||||
|
replicas: 1
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
name: calico-kube-controllers
|
||||||
|
namespace: kube-system
|
||||||
|
labels:
|
||||||
|
k8s-app: calico-kube-controllers
|
||||||
|
role.kubernetes.io/networking: "1"
|
||||||
|
annotations:
|
||||||
|
scheduler.alpha.kubernetes.io/critical-pod: ''
|
||||||
|
spec:
|
||||||
|
# The controllers must run in the host network namespace so that
|
||||||
|
# it isn't governed by policy that would prevent it from working.
|
||||||
|
hostNetwork: true
|
||||||
|
serviceAccountName: calico
|
||||||
|
tolerations:
|
||||||
|
- key: node-role.kubernetes.io/master
|
||||||
|
effect: NoSchedule
|
||||||
|
- key: CriticalAddonsOnly
|
||||||
|
operator: Exists
|
||||||
|
containers:
|
||||||
|
- name: calico-kube-controllers
|
||||||
|
image: quay.io/calico/kube-controllers:v1.0.0
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 10m
|
||||||
|
env:
|
||||||
|
# The location of the Calico etcd cluster.
|
||||||
|
- name: ETCD_ENDPOINTS
|
||||||
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
name: calico-config
|
||||||
|
key: etcd_endpoints
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{{ if and (eq .CloudProvider "aws") (.Networking.Calico.CrossSubnet) -}}
|
{{ if and (eq .CloudProvider "aws") (.Networking.Calico.CrossSubnet) -}}
|
||||||
# This manifest installs the k8s-ec2-srcdst container, which disables
|
# This manifest installs the k8s-ec2-srcdst container, which disables
|
||||||
|
|
|
@ -16,11 +16,10 @@ data:
|
||||||
calico_backend: "bird"
|
calico_backend: "bird"
|
||||||
|
|
||||||
# The CNI network configuration to install on each node.
|
# The CNI network configuration to install on each node.
|
||||||
# cniVersion should be 0.1.0 on k8s: https://github.com/projectcalico/calico/issues/742
|
|
||||||
cni_network_config: |-
|
cni_network_config: |-
|
||||||
{
|
{
|
||||||
"name": "k8s-pod-network",
|
"name": "k8s-pod-network",
|
||||||
"cniVersion": "0.1.0",
|
"cniVersion": "0.3.0",
|
||||||
"plugins": [
|
"plugins": [
|
||||||
{
|
{
|
||||||
"type": "calico",
|
"type": "calico",
|
|
@ -468,11 +468,10 @@ func (b *BootstrapChannelBuilder) buildManifest() (*channelsapi.Addons, map[stri
|
||||||
|
|
||||||
if b.cluster.Spec.Networking.Calico != nil {
|
if b.cluster.Spec.Networking.Calico != nil {
|
||||||
key := "networking.projectcalico.org"
|
key := "networking.projectcalico.org"
|
||||||
// 2.6.3-kops.1 = 2.6.2 with kops manifest tweaks. This should go away with the next version bump.
|
|
||||||
versions := map[string]string{
|
versions := map[string]string{
|
||||||
"pre-k8s-1.6": "2.4.1",
|
"pre-k8s-1.6": "2.4.1",
|
||||||
"k8s-1.6": "2.4.2-kops.1",
|
"k8s-1.6": "2.6.2",
|
||||||
"k8s-1.8": "2.6.3-kops.1",
|
"k8s-1.7": "2.6.2",
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -499,14 +498,14 @@ func (b *BootstrapChannelBuilder) buildManifest() (*channelsapi.Addons, map[stri
|
||||||
Version: fi.String(versions[id]),
|
Version: fi.String(versions[id]),
|
||||||
Selector: networkingSelector,
|
Selector: networkingSelector,
|
||||||
Manifest: fi.String(location),
|
Manifest: fi.String(location),
|
||||||
KubernetesVersion: ">=1.6.0 <1.8.0",
|
KubernetesVersion: ">=1.6.0 <1.7.0",
|
||||||
Id: id,
|
Id: id,
|
||||||
})
|
})
|
||||||
manifests[key+"-"+id] = "addons/" + location
|
manifests[key+"-"+id] = "addons/" + location
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
id := "k8s-1.8"
|
id := "k8s-1.7"
|
||||||
location := key + "/" + id + ".yaml"
|
location := key + "/" + id + ".yaml"
|
||||||
|
|
||||||
addons.Spec.Addons = append(addons.Spec.Addons, &channelsapi.AddonSpec{
|
addons.Spec.Addons = append(addons.Spec.Addons, &channelsapi.AddonSpec{
|
||||||
|
@ -514,7 +513,7 @@ func (b *BootstrapChannelBuilder) buildManifest() (*channelsapi.Addons, map[stri
|
||||||
Version: fi.String(versions[id]),
|
Version: fi.String(versions[id]),
|
||||||
Selector: networkingSelector,
|
Selector: networkingSelector,
|
||||||
Manifest: fi.String(location),
|
Manifest: fi.String(location),
|
||||||
KubernetesVersion: ">=1.8.0",
|
KubernetesVersion: ">=1.7.0",
|
||||||
Id: id,
|
Id: id,
|
||||||
})
|
})
|
||||||
manifests[key+"-"+id] = "addons/" + location
|
manifests[key+"-"+id] = "addons/" + location
|
||||||
|
|
Loading…
Reference in New Issue