Skip to content

Commit

Permalink
operator: Fix IPAM default flag
Browse files Browse the repository at this point in the history
Unless the user explicitly specifies the IPAM in use, fall back to the
default cilium-operator image and use the legacy host-scope IPAM to
ensure that during upgrade from a previous release that Cilium is not
automatically migrated to the new IPAM model; that should be an explicit
opt-in step that the user performs subsequently.

Signed-off-by: André Martins <andre@cilium.io>
Signed-off-by: Joe Stringer <joe@cilium.io>
  • Loading branch information
aanm authored and joestringer committed Jun 13, 2020
1 parent 5ef27cc commit be76441
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Documentation/cmdref/cilium-operator-generic.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ cilium-operator-generic [flags]
--identity-allocation-mode string Method to use for identity allocation (default "kvstore")
--identity-gc-interval duration GC interval for security identities (default 15m0s)
--identity-heartbeat-timeout duration Timeout after which identity expires on lack of heartbeat (default 30m0s)
--ipam string Backend to use for IPAM (default "cluster-pool")
--ipam string Backend to use for IPAM (default "hostscope-legacy")
--k8s-api-server string Kubernetes API server URL
--k8s-client-burst int Burst value allowed for the K8s client
--k8s-client-qps float32 Queries per second limit for the K8s client
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ spec:
- cilium-operator-aws
{{- else if .Values.global.azure.enabled }}
- cilium-operator-azure
{{- else }}
{{- else if .Values.global.ipam.operator }}
- cilium-operator-generic
{{- else }}
- cilium-operator
{{- end }}
env:
- name: K8S_NODE_NAME
Expand Down Expand Up @@ -114,8 +116,10 @@ spec:
image: "{{ .Values.global.registry }}/{{ .Values.image }}-aws:{{ .Values.global.tag }}"
{{- else if .Values.global.azure.enabled }}
image: "{{ .Values.global.registry }}/{{ .Values.image }}-azure:{{ .Values.global.tag }}"
{{- else }}
{{- else if .Values.global.ipam.operator }}
image: "{{ .Values.global.registry }}/{{ .Values.image }}-generic:{{ .Values.global.tag }}"
{{- else }}
image: "{{ .Values.global.registry }}/{{ .Values.image }}:{{ .Values.global.tag }}"
{{- end }}
{{- end }}
imagePullPolicy: {{ .Values.global.pullPolicy }}
Expand Down
4 changes: 3 additions & 1 deletion operator/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ func init() {
case "cilium-operator-azure":
defaultIPAM = ipamOption.IPAMAzure
case "cilium-operator-generic":
defaultIPAM = ipamOption.IPAMOperator
// Default to Legacy for upgrade paths; new users should
// explicitly override the IPAM flag.
defaultIPAM = ipamOption.IPAMHostScopeLegacy
}

flags.String(option.IPAM, defaultIPAM, "Backend to use for IPAM")
Expand Down

0 comments on commit be76441

Please sign in to comment.