Skip to content

Commit 858df38

Browse files
authored
Merge pull request #18285 from hakman/cilium-extra-config
cilium: allow setting arbitrary cilium-config entries
2 parents bb023a3 + 45b2d21 commit 858df38

10 files changed

Lines changed: 49 additions & 2 deletions

File tree

k8s/crds/kops.k8s.io_clusters.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5687,6 +5687,13 @@ spec:
56875687
The cluster is operated by cilium-etcd-operator.
56885688
Default: false
56895689
type: boolean
5690+
extraConfig:
5691+
additionalProperties:
5692+
type: string
5693+
description: |-
5694+
ExtraConfig is appended to the cilium-config ConfigMap. Keys here override any value
5695+
rendered by kops. All values must be strings (e.g. "true", not true).
5696+
type: object
56905697
gatewayAPI:
56915698
description: GatewayAPI specifies the configuration for Cilium
56925699
Gateway API settings.

pkg/apis/kops/networking.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,10 @@ type CiliumNetworkingSpec struct {
531531

532532
// GatewayAPI specifies the configuration for Cilium Gateway API settings.
533533
GatewayAPI *CiliumGatewayAPISpec `json:"gatewayAPI,omitempty"`
534+
535+
// ExtraConfig is appended to the cilium-config ConfigMap. Keys here override any value
536+
// rendered by kops. All values must be strings (e.g. "true", not true).
537+
ExtraConfig map[string]string `json:"extraConfig,omitempty"`
534538
}
535539

536540
// CiliumIngressSpec configures Cilium Ingress settings.

pkg/apis/kops/v1alpha2/networking.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,10 @@ type CiliumNetworkingSpec struct {
648648

649649
// GatewayAPI specifies the configuration for Cilium Gateway API settings.
650650
GatewayAPI *CiliumGatewayAPISpec `json:"gatewayAPI,omitempty"`
651+
652+
// ExtraConfig is appended to the cilium-config ConfigMap. Keys here override any value
653+
// rendered by kops. All values must be strings (e.g. "true", not true).
654+
ExtraConfig map[string]string `json:"extraConfig,omitempty"`
651655
}
652656

653657
// CiliumIngressSpec configures Cilium Ingress settings.

pkg/apis/kops/v1alpha2/zz_generated.conversion.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apis/kops/v1alpha3/networking.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,10 @@ type CiliumNetworkingSpec struct {
479479

480480
// GatewayAPI specifies the configuration for Cilium Gateway API settings.
481481
GatewayAPI *CiliumGatewayAPISpec `json:"gatewayAPI,omitempty"`
482+
483+
// ExtraConfig is appended to the cilium-config ConfigMap. Keys here override any value
484+
// rendered by kops. All values must be strings (e.g. "true", not true).
485+
ExtraConfig map[string]string `json:"extraConfig,omitempty"`
482486
}
483487

484488
// CiliumIngressSpec configures Cilium Ingress settings.

pkg/apis/kops/v1alpha3/zz_generated.conversion.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apis/kops/v1alpha3/zz_generated.deepcopy.go

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apis/kops/zz_generated.deepcopy.go

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

upup/models/cloudup/resources/addons/networking.cilium.io/k8s-1.16-v1.15.yaml.template

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,8 +474,11 @@ data:
474474
enable-non-default-deny-policies: "true"
475475
enable-source-ip-verification: "true"
476476

477-
# Extra config allows adding arbitrary properties to the cilium config.
478-
# By putting it at the end of the ConfigMap, it's also possible to override existing properties.
477+
# Extra config allows adding arbitrary properties to the cilium config.
478+
# By putting it at the end of the ConfigMap, it's also possible to override existing properties.
479+
{{- range $k, $v := .ExtraConfig }}
480+
{{ $k }}: {{ printf "%q" $v }}
481+
{{- end }}
479482

480483
{{ if WithDefaultBool .Hubble.Enabled false }}
481484
---

0 commit comments

Comments
 (0)