Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump Cilium to 1.7 for k8s 1.12+ #8589

Merged
merged 1 commit into from
Feb 19, 2020
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
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of baking the logic in the templates, this could have picked the default version by doing check on the Kubernetes version. That would allow other Go code to do Cilium version checks. But we don't have any such Cilium version checks, so not a blocker.

}
// 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 @@ -215,6 +223,8 @@ rules:
resources:
- ciliumnetworkpolicies
- ciliumnetworkpolicies/status
- ciliumclusterwidenetworkpolicies
- ciliumclusterwidenetworkpolicies/status
- ciliumendpoints
- ciliumendpoints/status
- ciliumnodes
Expand Down Expand Up @@ -242,6 +252,14 @@ rules:
- list
- watch
- delete
- apiGroups:
- discovery.k8s.io
resources:
- endpointslices
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
Expand All @@ -263,6 +281,8 @@ rules:
resources:
- ciliumnetworkpolicies
- ciliumnetworkpolicies/status
- ciliumclusterwidenetworkpolicies
- ciliumclusterwidenetworkpolicies/status
- ciliumendpoints
- ciliumendpoints/status
- ciliumnodes
Expand Down Expand Up @@ -324,7 +344,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 +399,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 +452,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 +494,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 +680,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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use something like this here?

versions := map[string]string{
"k8s-1.8": "1.5.0-kops.1",
"k8s-1.10": "1.5.0-kops.2",
"k8s-1.12": "1.5.5-kops.1",
"k8s-1.16": "1.6.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: b01164cd1ba9d9bda7b4c9c22deda9bb6408aae9
name: networking.cilium.io
selector:
role.kubernetes.io/networking: "1"
version: 1.6.6-kops.0
version: 1.7.0-kops.1