Azure: Create a Managed Cluster Using the DKP CLI
In the previous step, the new cluster was created as Self-managed which allows it to be a Management cluster. Subsequent new clusters are not self-managed as they will likely be Managed or Attached clusters to this Management Cluster.
When creating Managed clusters, you do not need to create and move CAPI objects, or install the Kommander component. Those tasks are only done on Management clusters!
Choose a Workspace for the New Cluster
If you have an existing Workspace name, run this command to find the name:
⚠️ NOTE: If you need to create a new Workspace, follow the instructions to Create a Workspace.kubectl get workspace -A
CODEWhen you have the Workspace name, set the
WORKSPACE_NAMESPACE
environment variable:export WORKSPACE_NAMESPACE=<workspace_namespace>
CODE
Name your cluster
Give your cluster a unique name suitable for your environment.
Set the environment variable:
export CLUSTER_NAME=<azure-additional>
CODE
Use DKP CLI
Execute this command to create an additional cluster without self-managed
flag:
dkp create cluster azure --cluster-name=${CLUSTER_NAME} --namespace=${WORKSPACE_NAMESPACE}
Manually Attach a DKP CLI Cluster to the Management Cluster
Find out the
name
of the createdCluster
, so you can reference it later:kubectl -n <workspace_namespace> get clusters
CODEAttach the cluster by creating a
KommanderCluster
:cat << EOF | kubectl apply -f - apiVersion: kommander.mesosphere.io/v1beta1 kind: KommanderCluster metadata: name: <cluster_name> namespace: <workspace_namespace> spec: kubeconfigRef: name: <cluster_name>-kubeconfig clusterRef: capiCluster: name: <cluster_name> EOF
CODE
You can also Create a new Azure Cluster Using the DKP UI.