Managed-Cluster#
Importing a K8s cluster as a RHACM Instance
This directory contains scripts to automate the importing of a K8s cluster (1.16.0 or above) to a RHACM Instance.
Set environment variables before importing:#
Set the
ACM_KUBECONFIG
variable to hold the file path for kubernetes configuration of the RHACM cluster:export ACM_KUBECONFIG=...
Set the
CLUSTER_NAME
variable to hold the name to be assigned to the managed-cluster (the name should be informative!):export CLUSTER_NAME=...
Set the
REMOTE_CONNECTION_TYPE
variable to eitherkubeconfig
orssh
to configure whether the deployment of the ACM managed-cluster addons should be done through kubectl directly or kubectl over ssh:If you choose
kubeconfig
:Set the
EDGE_KUBECONFIG
variable to hold the file path for kubernetes configuration of the edge cluster:export EDGE_KUBECONFIG=...
If you choose
ssh
:Set the
SHELL_ADDR
variable to hold the user@address to connect to your edge cluster over ssh:export SHELL_ADDR=...
Set the
SSH_KEY
variable to hold the file path for the key to use to connect to the machine addressed bySHELL_ADDR
:export SSH_KEY=...
— ## Importing The K8s Cluster After configuring the environment variables, execute the attach_managed_cluster.sh script:
.resources/attach_managed_cluster.sh
Assigning Labels on The Managed-Cluster
Execute:
kubectl label managedcluster $CLUSTER_NAME key=val
(Replace
key
andval
with the values you want. E.g.,env=dev
)
Removing an Imported Cluster#
Execute:
kubectl delete managedcluster $CLUSTER_NAME