Skip to content

Commit f97672e

Browse files
authored
charts: add external-gateway-config-ns option for controller (#6211)
Add configurable namespace for ovn-external-gw-config ConfigMap. By default, the controller's ConfigMap informer only watches ConfigMaps in the PodNamespace (where the controller runs). However, the default value for --external-gateway-config-ns is "kube-system", which causes the ConfigMap to never be found if the controller runs in a different namespace (e.g., "kubeovn"). This option allows users to explicitly set the namespace to match where their ovn-external-gw-config ConfigMap is located, or leave it empty to use the controller's namespace (PodNamespace). Added to both kube-ovn and kube-ovn-v2 charts. Signed-off-by: dnugmanov <damir_nug@mail.ru>
1 parent 193f231 commit f97672e

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

charts/kube-ovn-v2/templates/controller/controller-deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ spec:
135135
- --enable-lb={{- .Values.features.enableLoadbalancer }}
136136
- --enable-np={{- .Values.features.enableNetworkPolicies }}
137137
- --enable-eip-snat={{- .Values.networking.enableEipSnat }}
138+
{{- if .Values.networking.externalGatewayConfigNs }}
139+
- --external-gateway-config-ns={{- .Values.networking.externalGatewayConfigNs }}
140+
{{- end }}
138141
- --enable-external-vpc={{- .Values.features.enableExternalVpcs }}
139142
- --enable-ecmp={{- .Values.networking.enableEcmp }}
140143
- --logtostderr=false

charts/kube-ovn-v2/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ networking:
152152
# -- Enable EIP and SNAT.
153153
# @section -- Network parameters of the CNI
154154
enableEipSnat: true
155+
# -- Namespace where ovn-external-gw-config ConfigMap is located.
156+
# Empty means it will use the same namespace as the controller (PodNamespace).
157+
# @section -- Network parameters of the CNI
158+
externalGatewayConfigNs: ""
155159
# -- Comma-separated string of NodeLocal DNS IP addresses.
156160
# @section -- Network parameters of the CNI
157161
nodeLocalDnsIp: ""

charts/kube-ovn/templates/controller-deploy.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ spec:
127127
- --enable-np={{- .Values.func.ENABLE_NP }}
128128
- --np-enforcement={{- .Values.func.NP_ENFORCEMENT }}
129129
- --enable-eip-snat={{- .Values.networking.ENABLE_EIP_SNAT }}
130+
{{- if .Values.networking.EXTERNAL_GATEWAY_CONFIG_NS }}
131+
- --external-gateway-config-ns={{- .Values.networking.EXTERNAL_GATEWAY_CONFIG_NS }}
132+
{{- end }}
130133
- --enable-external-vpc={{- .Values.func.ENABLE_EXTERNAL_VPC }}
131134
- --enable-ecmp={{- .Values.networking.ENABLE_ECMP }}
132135
- --logtostderr=false

charts/kube-ovn/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ networking:
4040
VLAN_ID: "100"
4141
EXCHANGE_LINK_NAME: false
4242
ENABLE_EIP_SNAT: true
43+
# Namespace where ovn-external-gw-config ConfigMap is located.
44+
# Default is empty, which means it will use the same namespace as the controller (PodNamespace).
45+
EXTERNAL_GATEWAY_CONFIG_NS: ""
4346
DEFAULT_SUBNET: "ovn-default"
4447
DEFAULT_VPC: "ovn-cluster"
4548
NODE_SUBNET: "join"

0 commit comments

Comments
 (0)