Skip to content

Commit 3f7ed43

Browse files
committed
feat: Configure namespace sync in helm chart
- Adds configuration fields and passes them to manager as flags. - Documents configuration fields and their default values.
1 parent 6a7baab commit 3f7ed43

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

charts/cluster-api-runtime-extensions-nutanix/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ A Helm chart for cluster-api-runtime-extensions-nutanix
7373
| image.repository | string | `"ghcr.io/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix"` | |
7474
| image.tag | string | `""` | |
7575
| imagePullSecrets | list | `[]` | Optional secrets used for pulling the container image |
76+
| namespaceSync.enabled | bool | `true` | |
77+
| namespaceSync.sourceNamespace | string | `""` | |
78+
| namespaceSync.targetNamespaceLabelKey | string | `"caren.nutanix.com/namespace-sync"` | |
7679
| nodeSelector | object | `{}` | |
7780
| priorityClassName | string | `"system-cluster-critical"` | Priority class to be used for the pod. |
7881
| resources.limits.cpu | string | `"100m"` | |

charts/cluster-api-runtime-extensions-nutanix/templates/deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ spec:
3030
args:
3131
- --webhook-cert-dir=/runtimehooks-certs/
3232
- --defaults-namespace=$(POD_NAMESPACE)
33+
- --namespacesync-enabled={{ .Values.namespaceSync.enabled }}
34+
- --namespacesync-source-namespace={{ .Values.namespaceSync.sourceNamespace | default .Release.Namespace }}
35+
- --namespacesync-target-namespace-label-key={{ .Values.namespaceSync.targetNamespaceLabelKey }}
3336
- --helm-addons-configmap={{ .Values.helmAddonsConfigMap }}
3437
- --cni.cilium.helm-addon.default-values-template-configmap-name={{ .Values.hooks.cni.cilium.helmAddonStrategy.defaultValueTemplateConfigMap.name }}
3538
- --nfd.helm-addon.default-values-template-configmap-name={{ .Values.hooks.nfd.helmAddonStrategy.defaultValueTemplateConfigMap.name }}

charts/cluster-api-runtime-extensions-nutanix/values.schema.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,20 @@
401401
"imagePullSecrets": {
402402
"type": "array"
403403
},
404+
"namespaceSync": {
405+
"properties": {
406+
"enabled": {
407+
"type": "boolean"
408+
},
409+
"sourceNamespace": {
410+
"type": "string"
411+
},
412+
"targetNamespaceLabelKey": {
413+
"type": "string"
414+
}
415+
},
416+
"type": "object"
417+
},
404418
"nodeSelector": {
405419
"properties": {},
406420
"type": "object"

charts/cluster-api-runtime-extensions-nutanix/values.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,16 @@ selfHostedRegistry: true
8989

9090
deployDefaultClusterClasses: true
9191

92+
# The ClusterClass and the Templates it references must be in the same namespace
93+
# as the Cluster. To enable cluster creation in user-defined namespaces, CAREN
94+
# will copy all ClusterClasses and Templates from the source namespace to every
95+
# target namespace, i.e., every namespace that has a label with a matching key.
96+
namespaceSync:
97+
enabled: true
98+
targetNamespaceLabelKey: caren.nutanix.com/namespace-sync
99+
# By default, sourceNamespace is the helm release namespace.
100+
sourceNamespace: ""
101+
92102
deployment:
93103
replicas: 1
94104

0 commit comments

Comments
 (0)