This repository hosts a concrete implementation of a provider for OpenStack for the cluster-api project.
Learn how to engage with the Kubernetes community on the community page.
You can reach the maintainers of this project at:
Participation in the Kubernetes community is governed by the Kubernetes Code of Conduct.
-
Install
kubectl
(see here). -
Install minikube, version <= 0.28.0 (see: cluster-api/issues/475).
-
Install a driver for minikube. For Linux, we recommend kvm2. For MacOS, we recommend VirtualBox.
-
Build the
clusterctl
toolgit clone https://github.com/kubernetes-sigs/cluster-api-provider-openstack $GOPATH/src/sigs.k8s.io/cluster-api-provider-openstack cd $GOPATH/src/sigs.k8s.io/cluster-api-provider-openstack/clusterctl go build
-
Create the
cluster.yaml
,machines.yaml
,provider-components.yaml
, andaddons.yaml
files if needed:cd examples/openstack ./generate-yaml.sh cd ../..
**Note: **When generating
provider-components.yaml
, you need input your openstack cloud provider information, which include:- user-name
- domain-name
- tenant-id
- region-name
- auth-url
- password
You can get those information from your cloud provider.
-
Create a cluster:
clusterctl create cluster --provider openstack -c examples/openstack/out/cluster.yaml -m examples/openstack/out/machines.yaml -p examples/openstack/out/provider-components.yaml
To choose a specific minikube driver, please use the --vm-driver
command line parameter. For example to use the kvm2 driver with clusterctl you woud add --vm-driver kvm2
, for linux, if you haven't installed any driver, you can add --vm-driver none
.
Additional advanced flags can be found via help.
clusterctl create cluster --help
Once you have created a cluster, you can interact with the cluster and machine resources using kubectl:
kubectl --kubeconfig=kubeconfig get clusters
kubectl --kubeconfig=kubeconfig get machines
kubectl --kubeconfig=kubeconfig get machines -o yaml
This guide explains how to delete all resources that were created as part of your openstack Cluster API Kubernetes cluster.
-
Delete all of the node Machines in the cluster. Make sure to wait for the corresponding Nodes to be deleted before moving onto the next step. After this step, the master node will be the only remaining node.
kubectl --kubeconfig=kubeconfig delete machines -l set=node kubectl --kubeconfig=kubeconfig get nodes
-
Delete the master machine.
kubectl --kubeconfig=kubeconfig delete machines -l set=master
-
Delete the ssh keypair that were created for your cluster machine.
rm -rf /root/.ssh/openstack_tmp*