Skip to content

Commit

Permalink
Bump Cilium to 1.7 for k8s 1.12+
Browse files Browse the repository at this point in the history
Cilium 1.7 requires K8s 1.12 minimum. Changed the templates so that we
can have different cilium versions for different k8s versions.

This also mean that this addon will behave similar to other addons wrt
upgrades. Cilium used to add a fixed version to the cluster spec on cluster creation so
upgrades were slightly more manual. Now, for new clusters, upgrades will
happen implicitly with kops updates unless the .Version is added
manually to the cluster spec.
  • Loading branch information
Ole Markus With committed Feb 19, 2020
1 parent e9550a9 commit 8dc28e0
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 24 deletions.
3 changes: 0 additions & 3 deletions pkg/apis/kops/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -593,9 +593,6 @@ func (c *Cluster) FillDefaults() error {
} else if c.Spec.Networking.AmazonVPC != nil {
// OK
} else if c.Spec.Networking.Cilium != nil {
if c.Spec.Networking.Cilium.Version == "" {
c.Spec.Networking.Cilium.Version = CiliumDefaultVersion
}
// OK
} else if c.Spec.Networking.LyftVPC != nil {
// OK
Expand Down
1 change: 0 additions & 1 deletion pkg/apis/kops/networking.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ type AmazonVPCNetworkingSpec struct {
ImageName string `json:"imageName,omitempty"`
}

const CiliumDefaultVersion = "v1.6.6"
const CiliumIpamEni = "eni"

// CiliumNetworkingSpec declares that we want Cilium networking
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,14 @@ rules:
- get
- list
- watch
- apiGroups:
- discovery.k8s.io
resources:
- endpointslices
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
Expand Down Expand Up @@ -191,15 +199,6 @@ rules:
- nodes/status
verbs:
- patch
- apiGroups:
- extensions
resources:
- ingresses
verbs:
- create
- get
- list
- watch
- apiGroups:
- apiextensions.k8s.io
resources:
Expand All @@ -215,6 +214,8 @@ rules:
resources:
- ciliumnetworkpolicies
- ciliumnetworkpolicies/status
- ciliumclusterwidenetworkpolicies
- ciliumclusterwidenetworkpolicies/status
- ciliumendpoints
- ciliumendpoints/status
- ciliumnodes
Expand Down Expand Up @@ -242,6 +243,14 @@ rules:
- list
- watch
- delete
- apiGroups:
- discovery.k8s.io
resources:
- endpointslices
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
Expand All @@ -263,6 +272,8 @@ rules:
resources:
- ciliumnetworkpolicies
- ciliumnetworkpolicies/status
- ciliumclusterwidenetworkpolicies
- ciliumclusterwidenetworkpolicies/status
- ciliumendpoints
- ciliumendpoints/status
- ciliumnodes
Expand Down Expand Up @@ -324,7 +335,6 @@ spec:
# gets priority scheduling.
# https://kubernetes.io/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/
scheduler.alpha.kubernetes.io/critical-pod: ""
scheduler.alpha.kubernetes.io/tolerations: '[{"key":"dedicated","operator":"Equal","value":"master","effect":"NoSchedule"}]'
labels:
k8s-app: cilium
kubernetes.io/cluster-service: "true"
Expand Down Expand Up @@ -380,7 +390,7 @@ spec:
value: {{ . }}
{{ end }}
{{ with .Networking.Cilium }}
image: "docker.io/cilium/cilium:{{ .Version }}"
image: "docker.io/cilium/cilium:{{- or .Version "v.1.7.0" }}"
imagePullPolicy: IfNotPresent
lifecycle:
postStart:
Expand Down Expand Up @@ -433,6 +443,7 @@ spec:
volumeMounts:
- mountPath: /sys/fs/bpf
name: bpf-maps
mountPropagation: HostToContainer
- mountPath: /var/run/cilium
name: cilium-run
- mountPath: /host/opt/cni/bin
Expand Down Expand Up @@ -474,7 +485,7 @@ spec:
key: wait-bpf-mount
name: cilium-config
optional: true
image: "docker.io/cilium/cilium:{{ .Version }}"
image: "docker.io/cilium/cilium:{{- or .Version "v1.7.0" }}"
## end of `with .Networking.Cilium`
#{{ end }}
imagePullPolicy: IfNotPresent
Expand Down Expand Up @@ -660,7 +671,7 @@ spec:
- name: KUBERNETES_SERVICE_PORT
value: "443"
{{ with .Networking.Cilium }}
image: "docker.io/cilium/operator:{{ .Version }}"
image: "docker.io/cilium/operator:{{- if eq .Version "" -}}v1.7.0{{- else -}}{{ .Version }}{{- end -}}"
imagePullPolicy: IfNotPresent
name: cilium-operator
{{ if .EnablePrometheusMetrics }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ spec:
value: {{ . }}
{{ end }}
{{ with .Networking.Cilium }}
image: "docker.io/cilium/cilium:{{ .Version }}"
image: "docker.io/cilium/cilium:{{- or .Version "v1.6.6" }}"
imagePullPolicy: IfNotPresent
lifecycle:
postStart:
Expand Down Expand Up @@ -652,7 +652,7 @@ spec:
- name: KUBERNETES_SERVICE_PORT
value: "443"
{{ with .Networking.Cilium }}
image: "docker.io/cilium/operator:{{ .Version }}"
image: "docker.io/cilium/operator:{{- or .Version "v1.6.6" }}"
imagePullPolicy: IfNotPresent
name: cilium-operator
{{ if .EnablePrometheusMetrics }}
Expand Down
2 changes: 1 addition & 1 deletion upup/pkg/fi/cloudup/bootstrapchannelbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ func (b *BootstrapChannelBuilder) buildAddons() *channelsapi.Addons {

if b.cluster.Spec.Networking.Cilium != nil {
key := "networking.cilium.io"
version := "1.6.6-kops.0"
version := "1.7.0-kops.1"

{
id := "k8s-1.7"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,16 @@ spec:
- id: k8s-1.7
kubernetesVersion: <1.12.0
manifest: networking.cilium.io/k8s-1.7.yaml
manifestHash: 48b2e968039622b7dd5941497d0cda203334b508
manifestHash: e6670d455bcd03c5b85ccb6ff6bbe6e068aa7674
name: networking.cilium.io
selector:
role.kubernetes.io/networking: "1"
version: 1.6.6-kops.0
version: 1.7.0-kops.1
- id: k8s-1.12
kubernetesVersion: '>=1.12.0'
manifest: networking.cilium.io/k8s-1.12.yaml
manifestHash: f52e9593af72a8caa8b8230f120594344f8418f1
manifestHash: 12d32ae472f96f2e69501888ea9e1d2d429cfb06
name: networking.cilium.io
selector:
role.kubernetes.io/networking: "1"
version: 1.6.6-kops.0
version: 1.7.0-kops.1

0 comments on commit 8dc28e0

Please sign in to comment.