DKP version 2.4 and below cannot create a bootstrap cluster on a Mac that uses Apple Processors. This document covers the process for building an aws cluster on a Mac with and M1/M2 processor
1. Setup the authentication using the steps below:
export AWS_PROFILE=337834004759_Mesosphere-PowerUser
maws configure set account $AWS_PROFILE
maws li -r 337834004759_Mesosphere-PowerUser &
2. Set the cluster name and region
export CLUSTER_NAME=$(whoami)-$(date '+%s')
export AWS_REGION=us-west-2
3. Install kind if it is not already installed
brew update && brew install kind
4. Create a local cluster running kind
kind create cluster
5. Create the capi components
./dkp create capi-components
6. Refresh the aws credentials:
eval $(maws li 337834004759_Mesosphere-PowerUser) && ./dkp update bootstrap credentials aws
7. Create the cluster. Please note that you must not remove the –self-managed flag. This flag will delete the boot strap cluster:
./dkp create cluster aws \
--cluster-name=${CLUSTER_NAME} \
--additional-tags=owner=$(whoami),expiration=8h \
--with-aws-bootstrap-credentials=true
8. Check the status of the cluster by running the following command:
./dkp describe cluster -c $CLUSTER_NAME
If the cluster is not ready and does not progress then check the logs of the capa-controller-manager. Open a new terminal and run the following commands to monitor the install process:
#Set the kubectl context to kind
kubectl cluster-info --context kind-kind
#Get the name of capa-controller-manager
user@MacBook-Pro ~ % kubectl get pods -n capa-system
NAME READY STATUS RESTARTS AGE
capa-controller-manager-xxxxxxxxxx-xxxxx 1/1 Running 0 7m52s
#Get the logs of the capa-controller-manager
kubectl logs capa-controller-manager-xxxxxxxxxx-xxxxx -n capa-system -f
Check for the following message:
E0518 06:22:18.056600 1 awscluster_controller.go:281] controller/awscluster "msg"="failed to reconcile network" "error"="failed to create new vpc: failed to create vpc: NoCredentialProviders: no valid providers in chain. Deprecated.\n\tFor verbose messaging see aws.Config.CredentialsChainVerboseErrors" "cluster"="mkamsika-1684389903" "name"="mkamsika-1684389903" "namespace"="default" "reconciler group"="infrastructure.cluster.x-k8s.io" "reconciler kind"="AWSCluster"
Launch the following command to refresh the credentials in the bootstrap cluster:
eval $(maws li 337834004759_Mesosphere-PowerUser) && ./dkp update bootstrap credentials aws
You may need to refresh the credentials more than once. There is no need to run the create cluster command again.
9. Once the logs stop appending to the cluster check its status.
./dkp describe cluster -c $CLUSTER_NAME
10. Make the cluster self managed:
#Create the kubeconfig file
./dkp get kubeconfig -c ${CLUSTER_NAME} > ${CLUSTER_NAME}.conf
#Create the capi components on the cluster with the correct credentials
./dkp create capi-components --with-aws-bootstrap-credentials=false --kubeconfig ${CLUSTER_NAME}.conf
#Move the capi resources to the aws cluster
./dkp move capi-resources --to-kubeconfig ${CLUSTER_NAME}.conf
11. Once the AWS cluster is self managed you can delete the local cluster
kind delete cluster
12. Install Kommander
./dkp install kommander --kubeconfig=${CLUSTER_NAME}.conf