This role allows to perform multiple management operations on a given spoke cluster.
Tasks must be executed on the hub cluster that is controlling/going to control the given spoke cluster.
The following variable controls the action that can be performed within this role:
Name | Type | Required | Default | Description |
---|---|---|---|---|
asm_action | string | yes | - | Action to be performed. Accepted values are detach and attach . |
This action allows to detach a spoke cluster from a given hub cluster.
This is based on the following OCP documentation.
- Spoke cluster running in a given hub cluster.
Name | Type | Required | Default | Description |
---|---|---|---|---|
asm_cluster_name | string | yes | - | Cluster name, used for identifying the ManagedCluster and the Namespace |
- name: Detach spoke cluster from hub cluster
ansible.builtin.include_role:
name: redhatci.ocp.acm_spoke_mgmt
vars:
asm_action: "detach"
asm_cluster_name: "mycluster"
This action allows to attach a spoke cluster to a given hub cluster.
This is based on the following OCP documentation.
Three resources are created in this role:
- ManagedCluster resource (and related Namespace is automatically created after its creation).
- Autoimport Secret.
- KlusterletAddonConfig.
- Active spoke cluster already created, having access to its kubeconfig.
Name | Type | Required | Default | Description |
---|---|---|---|---|
asm_cluster_kubeconfig_path | string | yes | - | Path to spoke cluster's kubeconfig file |
asm_cluster_name | string | yes | - | Cluster name, used for identifying the ManagedCluster and the Namespace |
- name: Attach spoke cluster to hub cluster
ansible.builtin.include_role:
name: redhatci.ocp.acm_spoke_mgmt
vars:
asm_action: "attach"
asm_cluster_kubeconfig_path: "/path/to/spoke/kubeconfig"
asm_cluster_name: "mycluster"