- Install kubectl
- Download the latest
- You can use either a VM, container or existing Kubernetes cluster as bootstrap cluster.
- The CAPO provider requires an OS image (available in OpenStack), which is build like the ones in image-builder
Generate example YAML files if needed. You can use the
examples/generate.shscript as documented here.
Create a cluster:
- If you are using Minikube:
clusterctl create cluster \ --bootstrap-type minikube --bootstrap-flags kubernetes-version=v1.15.0 \ -c examples/_out/cluster.yaml \ -m examples/_out/controlplane.yaml \ -p examples/_out/provider-components.yaml \ -a examples/addons.yaml
To choose a specific Minikube driver, please use the
--bootstrap-flags vm-driver=xxxcommand line parameter. For example to use the
kvm2driver with clusterctl you would add
--bootstrap-flags vm-driver=kvm2, for linux, if you haven't installed any driver, you can add
- If you are using
clusterctl create cluster \ --bootstrap-type kind --bootstrap-cluster-cleanup=false \ -c examples/_out/cluster.yaml \ -m examples/_out/controlplane.yaml \ -p examples/_out/provider-components.yaml \ -a examples/addons.yaml
- If you are using an existing Kubernetes cluster:
clusterctl create cluster \ --bootstrap-cluster-kubeconfig ~/.kube/config \ -c examples/_out/cluster.yaml \ -m examples/_out/controlplane.yaml \ -p examples/_out/provider-components.yaml \ -a examples/addons.yaml
Interacting with your cluster
Once you have created a cluster, you can interact with the cluster and machine resources via
export KUBECONFIG=./kubeconfig kubectl get clusters kubectl get machines
Deploying additional machines
You can deploy additional machines via the
examples/_out/machinedeployment.yaml. You probably have to customize the
configuration of these machines.
Use the following command to delete a cluster and all resources it created.
clusterctl delete cluster --cluster <cluster-name> --bootstrap-type kind --kubeconfig kubeconfig --provider-components examples/_out/provider-components.yaml
Or you can manually delete all resources that were created as part of your openstack Cluster API Kubernetes cluster.
Delete all of the worker machines in the cluster. Make sure to wait for the corresponding machines to be deleted before moving onto the next step. After this step, only the control plane node(s) will remain.
kubectl --kubeconfig=kubeconfig delete machines -l set=node kubectl --kubeconfig=kubeconfig get nodes
Delete the control plane machines.
kubectl --kubeconfig=kubeconfig delete machines -l set=master
(optional) Delete the load balancer in your OpenStack cloud if one has been created.
kubeconfigfile that were created for your cluster.
Delete the ssh keypair that was created for your machines.
rm -rf $HOME/.ssh/openstack_tmp*
Please refer to Trouble shooting documentation for further info.