From 99ff00df61a7d45502bfca552d5454b31f292fc6 Mon Sep 17 00:00:00 2001 From: Moshe Vayner Date: Tue, 9 May 2023 21:50:36 -0400 Subject: [PATCH] Support Cilium operator pod annotations --- pkg/apis/kops/networking.go | 3 +++ pkg/apis/kops/v1alpha2/networking.go | 3 +++ pkg/apis/kops/v1alpha3/networking.go | 3 +++ .../integration/update_cluster/privatecilium/in-v1alpha2.yaml | 4 ++++ .../addons/networking.cilium.io/k8s-1.16-v1.12.yaml.template | 4 ++++ 5 files changed, 17 insertions(+) diff --git a/pkg/apis/kops/networking.go b/pkg/apis/kops/networking.go index fd139c7806..0f202ae918 100644 --- a/pkg/apis/kops/networking.go +++ b/pkg/apis/kops/networking.go @@ -391,6 +391,9 @@ type CiliumNetworkingSpec struct { // AgentPodAnnotations makes possible to add additional annotations to cilium agent. // Default: none AgentPodAnnotations map[string]string `json:"agentPodAnnotations,omitempty"` + // OperatorPodAnnotations makes possible to add additional annotations to cilium operator. + // Default: none + OperatorPodAnnotations map[string]string `json:"operatorPodAnnotations,omitempty"` // Tunnel specifies the Cilium tunnelling mode. Possible values are "vxlan", "geneve", or "disabled". // Default: vxlan Tunnel string `json:"tunnel,omitempty"` diff --git a/pkg/apis/kops/v1alpha2/networking.go b/pkg/apis/kops/v1alpha2/networking.go index 829e24f470..cea7b43bda 100644 --- a/pkg/apis/kops/v1alpha2/networking.go +++ b/pkg/apis/kops/v1alpha2/networking.go @@ -464,6 +464,9 @@ type CiliumNetworkingSpec struct { // AgentPodAnnotations makes possible to add additional annotations to the cilium agent. // Default: none AgentPodAnnotations map[string]string `json:"agentPodAnnotations,omitempty"` + // OperatorPodAnnotations makes possible to add additional annotations to cilium operator. + // Default: none + OperatorPodAnnotations map[string]string `json:"operatorPodAnnotations,omitempty"` // Pprof is unused. // +k8s:conversion-gen=false Pprof bool `json:"pprof,omitempty"` diff --git a/pkg/apis/kops/v1alpha3/networking.go b/pkg/apis/kops/v1alpha3/networking.go index 15ab8ef1f6..c85a13a819 100644 --- a/pkg/apis/kops/v1alpha3/networking.go +++ b/pkg/apis/kops/v1alpha3/networking.go @@ -354,6 +354,9 @@ type CiliumNetworkingSpec struct { // AgentPodAnnotations makes possible to add additional annotations to the cilium agent. // Default: none AgentPodAnnotations map[string]string `json:"agentPodAnnotations,omitempty"` + // OperatorPodAnnotations makes possible to add additional annotations to cilium operator. + // Default: none + OperatorPodAnnotations map[string]string `json:"operatorPodAnnotations,omitempty"` // Tunnel specifies the Cilium tunnelling mode. Possible values are "vxlan", "geneve", or "disabled". // Default: vxlan Tunnel string `json:"tunnel,omitempty"` diff --git a/tests/integration/update_cluster/privatecilium/in-v1alpha2.yaml b/tests/integration/update_cluster/privatecilium/in-v1alpha2.yaml index f3d1b5dac9..52681f71cc 100644 --- a/tests/integration/update_cluster/privatecilium/in-v1alpha2.yaml +++ b/tests/integration/update_cluster/privatecilium/in-v1alpha2.yaml @@ -30,6 +30,10 @@ spec: test1: "true" test2: "123" test3: awesome + operatorPodAnnotations: + test1: "true" + test2: "123" + test3: cilium-operator nonMasqueradeCIDR: 100.64.0.0/10 sshAccess: - 0.0.0.0/0 diff --git a/upup/models/cloudup/resources/addons/networking.cilium.io/k8s-1.16-v1.12.yaml.template b/upup/models/cloudup/resources/addons/networking.cilium.io/k8s-1.16-v1.12.yaml.template index 0938022fc4..9ef77e333d 100644 --- a/upup/models/cloudup/resources/addons/networking.cilium.io/k8s-1.16-v1.12.yaml.template +++ b/upup/models/cloudup/resources/addons/networking.cilium.io/k8s-1.16-v1.12.yaml.template @@ -964,6 +964,10 @@ spec: type: RollingUpdate template: metadata: + annotations: + {{- range $key, $value := .OperatorPodAnnotations }} + {{ $key }}: "{{ $value }}" + {{- end }} labels: io.cilium/app: operator name: cilium-operator