Skip to content

Commit 33723b0

Browse files
committed
Always deploy BGP auth secrets in the configured secrets namespace
We adjust the BGP auth secret generation to always set `metadata.namespace` of the resulting secrets to the configured BGP control plane secrets namespace by reading `cilium_helm_values.bgpControlPlane.secretsNamespace.name`.
1 parent 1d8165d commit 33723b0

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

component/bgp-control-plane.jsonnet

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ local validate_auth_secret(name, config) =
5353
assert
5454
std.objectHas(data, 'password') || std.objectHas(sdata, 'password')
5555
: "Cilium BGP auth secret `%s` doesn't have key `password`" % name;
56-
config;
56+
config {
57+
metadata+: {
58+
namespace: params.cilium_helm_values.bgpControlPlane.secretsNamespace.name,
59+
},
60+
};
5761

5862
local authsecrets = com.generateResources(
5963
std.mapWithKey(validate_auth_secret, params.bgp.auth_secrets),

docs/modules/ROOT/pages/references/parameters.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -857,6 +857,11 @@ The key is used as `metadata.name` of the resulting object.
857857
The component expects that each value in this parameter is a valid partial `Secret` resource.
858858
The component validates that each secret has field `password`, which is required by the BGP control plane for auth secrets.
859859

860+
By default, the component configures Cilium to look for BGP auth secrets in namespace `cilium`.
861+
The namespace can be changed by setting Helm value `bgpControlPlane.secretsNamespace.name`.
862+
863+
The component sets `metadata.namespace` to the configured `bgpControlPlane.secretsNamspace.name` for secrets defined through this parameter.
864+
860865
See the https://docs.cilium.io/en/v1.16/network/bgp-control-plane/bgp-control-plane-v2/#md5-password[upstream documentation] for details.
861866

862867
=== `bgp.node_config_overrides`

tests/golden/bgp-control-plane/cilium/cilium/40_bgp_auth_secrets.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ metadata:
77
labels:
88
name: test
99
name: test
10+
namespace: cilium
1011
type: Opaque
1112
---
1213
apiVersion: v1
@@ -17,6 +18,7 @@ metadata:
1718
labels:
1819
name: test2
1920
name: test2
21+
namespace: cilium
2022
stringData:
2123
password: foobar
2224
type: Opaque

0 commit comments

Comments
 (0)