Skip to content

Commit 2a1db7e

Browse files
zhujian7claude
andauthored
Add documentation for AddOnDeploymentConfig namespace behavior (#522)
This commit adds documentation explaining how the agentInstallNamespace field in AddOnDeploymentConfig interacts with the namespace defined in AddOnTemplate manifests. Key points documented: - When AddOnDeploymentConfig is not used, the AddOnTemplate namespace is used - When AddOnDeploymentConfig is used with agentInstallNamespace: "", the AddOnTemplate namespace is used - When AddOnDeploymentConfig is used but agentInstallNamespace is not set, the default "open-cluster-management-agent-addon" is used - When agentInstallNamespace is set to a specific value, that value is used This addresses the behavior fix from open-cluster-management-io/ocm#1209 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: zhujian <[email protected]> Co-authored-by: Claude <[email protected]>
1 parent 127e478 commit 2a1db7e

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

content/en/docs/developer-guides/addon.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,6 +1344,32 @@ spec:
13441344

13451345
This allows you to have different variable values for different clusters while using the same addon template.
13461346

1347+
#### Namespace configuration with AddOnDeploymentConfig
1348+
1349+
When using `AddOnDeploymentConfig` with addon templates, the addon agent installation namespace is determined as follows:
1350+
1351+
* If `AddOnDeploymentConfig` is **not used**, the namespace of the manifest defined in the `AddOnTemplate` is used.
1352+
* If `AddOnDeploymentConfig` is **used** but `agentInstallNamespace: ""` (empty string), the namespace from `AddOnTemplate` is used.
1353+
* If `AddOnDeploymentConfig` is **used** but `agentInstallNamespace` is **not set**, the default namespace `open-cluster-management-agent-addon` is used.
1354+
* If `agentInstallNamespace` is set to a specific namespace, that namespace is used.
1355+
1356+
**Important:** To preserve a custom namespace from your `AddOnTemplate` when using `AddOnDeploymentConfig`, explicitly set `agentInstallNamespace: ""`.
1357+
1358+
Example:
1359+
1360+
```yaml
1361+
apiVersion: addon.open-cluster-management.io/v1alpha1
1362+
kind: AddOnDeploymentConfig
1363+
metadata:
1364+
name: hello-template-deploy-config
1365+
namespace: open-cluster-management
1366+
spec:
1367+
agentInstallNamespace: "" # Use namespace from AddOnTemplate
1368+
customizedVariables:
1369+
- name: LOG_LEVEL
1370+
value: "2"
1371+
```
1372+
13471373
#### Variable naming and validation
13481374

13491375
When defining customized variables in AddOnDeploymentConfig, please note:

content/en/docs/getting-started/installation/addon-management.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ spec:
207207
resource: addontemplates
208208
```
209209

210+
**Note on namespace configuration:** When using `AddOnDeploymentConfig` with addon templates, if you want to preserve the namespace defined in your `AddOnTemplate`, you must explicitly set `agentInstallNamespace: ""` in the `AddOnDeploymentConfig`. Otherwise, the default namespace `open-cluster-management-agent-addon` will be used. See [Namespace configuration with AddOnDeploymentConfig]({{< ref "docs/developer-guides/addon/#namespace-configuration-with-addondeploymentconfig" >}}) for details.
211+
210212
### Configurations per install strategy
211213

212214
In `ClusterManagementAddOn`, `spec.installStrategy.placements[].configs` lists the
@@ -390,4 +392,4 @@ status:
390392
lastObservedGeneration: 1
391393
name: cluster1-addon-template
392394
resource: addontemplates
393-
```
395+
```

0 commit comments

Comments
 (0)