Skip to content

Commit

Permalink
Allow override of registry and tag for Calico images
Browse files Browse the repository at this point in the history
  • Loading branch information
Ciprian Hacman committed Nov 24, 2020
1 parent 8b9fb1f commit 00711df
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 12 deletions.
6 changes: 6 additions & 0 deletions k8s/crds/kops.k8s.io_clusters.yaml
Expand Up @@ -2238,6 +2238,9 @@ spec:
prometheusProcessMetricsEnabled:
description: PrometheusProcessMetricsEnabled enables Prometheus process metrics collection
type: boolean
registry:
description: Version overrides the Calico container image registry.
type: string
typhaPrometheusMetricsEnabled:
description: 'TyphaPrometheusMetricsEnabled enables Prometheus metrics collection from Typha (default: false)'
type: boolean
Expand All @@ -2249,6 +2252,9 @@ spec:
description: TyphaReplicas is the number of replicas of Typha to deploy
format: int32
type: integer
version:
description: Version overrides the Calico container image tag.
type: string
wireguardEnabled:
description: 'WireguardEnabled enables WireGuard encryption for all on-the-wire pod-to-pod traffic (default: false)'
type: boolean
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/kops/networking.go
Expand Up @@ -103,6 +103,11 @@ type FlannelNetworkingSpec struct {

// CalicoNetworkingSpec declares that we want Calico networking
type CalicoNetworkingSpec struct {
// Version overrides the Calico container image registry.
Registry string `json:"registry,omitempty"`
// Version overrides the Calico container image tag.
Version string `json:"version,omitempty"`

// BpfEnabled enables the eBPF dataplane mode.
BPFEnabled bool `json:"bpfEnabled,omitempty"`
// BPFExternalServiceMode controls how traffic from outside the cluster to NodePorts and ClusterIPs is handled.
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/kops/v1alpha2/networking.go
Expand Up @@ -103,6 +103,11 @@ type FlannelNetworkingSpec struct {

// CalicoNetworkingSpec declares that we want Calico networking
type CalicoNetworkingSpec struct {
// Version overrides the Calico container image registry.
Registry string `json:"registry,omitempty"`
// Version overrides the Calico container image tag.
Version string `json:"version,omitempty"`

// BpfEnabled enables the eBPF dataplane mode.
BPFEnabled bool `json:"bpfEnabled,omitempty"`
// BPFExternalServiceMode controls how traffic from outside the cluster to NodePorts and ClusterIPs is handled.
Expand Down
4 changes: 4 additions & 0 deletions pkg/apis/kops/v1alpha2/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions upup/models/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -3625,7 +3625,7 @@ spec:
securityContext:
fsGroup: 65534
containers:
- image: docker.io/calico/typha:v3.17.0
- image: {{ or .Networking.Calico.Registry "docker.io" }}/calico/typha:v{{ or .Networking.Calico.Version "3.17.0" }}
name: calico-typha
ports:
- containerPort: 5473
Expand Down Expand Up @@ -3742,7 +3742,7 @@ spec:
# It can be deleted if this is a fresh installation, or if you have already
# upgraded to use calico-ipam.
- name: upgrade-ipam
image: docker.io/calico/cni:v3.17.0
image: {{ or .Networking.Calico.Registry "docker.io" }}/calico/cni:v{{ or .Networking.Calico.Version "3.17.0" }}
command: ["/opt/cni/bin/calico-ipam", "-upgrade"]
envFrom:
- configMapRef:
Expand All @@ -3769,7 +3769,7 @@ spec:
# This container installs the CNI binaries
# and CNI network config file on each node.
- name: install-cni
image: docker.io/calico/cni:v3.17.0
image: {{ or .Networking.Calico.Registry "docker.io" }}/calico/cni:v{{ or .Networking.Calico.Version "3.17.0" }}
command: ["/opt/cni/bin/install"]
envFrom:
- configMapRef:
Expand Down Expand Up @@ -3810,7 +3810,7 @@ spec:
# Adds a Flex Volume Driver that creates a per-pod Unix Domain Socket to allow Dikastes
# to communicate with Felix over the Policy Sync API.
- name: flexvol-driver
image: docker.io/calico/pod2daemon-flexvol:v3.17.0
image: {{ or .Networking.Calico.Registry "docker.io" }}/calico/pod2daemon-flexvol:v{{ or .Networking.Calico.Version "3.17.0" }}
volumeMounts:
- name: flexvol-driver-host
mountPath: /host/driver
Expand All @@ -3821,7 +3821,7 @@ spec:
# container programs network policy and routes on each
# host.
- name: calico-node
image: docker.io/calico/node:v3.17.0
image: {{ or .Networking.Calico.Registry "docker.io" }}/calico/node:v{{ or .Networking.Calico.Version "3.17.0" }}
envFrom:
- configMapRef:
# Allow KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT to be overridden for eBPF mode.
Expand Down Expand Up @@ -4085,7 +4085,8 @@ spec:
priorityClassName: system-cluster-critical
containers:
- name: calico-kube-controllers
image: docker.io/calico/kube-controllers:v3.17.0
image: {{ or .Networking.Calico.Registry "docker.io" }}/calico/kube-controllers:v{{ or .Networking.Calico.Version "3.17.0" }}
image: {{ or .Networking.Calico.Registry "docker.io" }}/calico/kube-controllers:v{{ or .Networking.Calico.Version "3.17.0" }}
env:
# Choose which controllers to run.
- name: ENABLED_CONTROLLERS
Expand Down

0 comments on commit 00711df

Please sign in to comment.