-
Install kubectl.
-
Install minikube and a minikube driver. It is recommended to use KVM2 driver for Linux and VirtualBox for MacOS.
-
Install kustomize.
-
Build the
clusterctltoolcd $(go env GOPATH)/src/platform9/azure-provider make clusterctl
An Azure Service Principal is needed for usage by the clusterctl tool and for populating the controller manifests. This utilizes environment-based authentication. The following environment variables should be set: AZURE_SUBSCRIPTION_ID, AZURE_TENANT_ID, AZURE_CLIENT_ID and AZURE_CLIENT_SECRET.
An alternative is to install Azure CLI and have the project's script create the service principal automatically. Not that the service prinicpals created by the scripts will not be deleted automatically.
-
Generate the
cluster.yaml,machines.yaml, andaddons.yamlfiles, and create the service principal if needed.cd cmd/clusterctl/examples/azure CREATE_SP=FALSE ./generate-yaml.sh # set to TRUE if creating a new Service Principal is desired cd ../../../.. # If CREATE_SP=TRUE source cmd/clusterctl/examples/out/credentials.sh -
Generate the
provider-components.yamlfile.kustomize build config/default/ > cmd/clusterctl/examples/azure/out/provider-components.yaml echo "---" >> cmd/clusterctl/examples/azure/out/provider-components.yaml kustomize build vendor/sigs.k8s.io/cluster-api/config/default/ >> cmd/clusterctl/examples/azure/out/provider-components.yaml -
Create the cluster. Kubernetes Version >= 1.11 is required to enable CRD subresources without needing a feature gate.
./bin/clusterctl create cluster --provider azure \ -m cmd/clusterctl/examples/azure/out/machines.yaml \ -c cmd/clusterctl/examples/azure/out/cluster.yaml \ -p cmd/clusterctl/examples/azure/out/provider-components.yaml \--vm-driver kvm2 --minikube kubernetes-version=v1.12.2
Once the cluster is created succesfully, you can interact with the cluster using kubectl and the kubeconfig downloaded by the clusterctl tool.
kubectl --kubeconfig=kubeconfig get clusters
kubectl --kubeconfig=kubeconfig get machines
TODO
TODO