{"id":25651714,"url":"https://github.com/mikejoh/capi-capo-devstack","last_synced_at":"2026-03-02T06:02:14.296Z","repository":{"id":278887052,"uuid":"937083936","full_name":"mikejoh/capi-capo-devstack","owner":"mikejoh","description":"How-to on how to run CAPI, CAPO and Devstack!","archived":false,"fork":false,"pushed_at":"2025-09-19T08:10:56.000Z","size":91,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-14T06:33:00.463Z","etag":null,"topics":["cluster-api","cluster-api-provider-openstack","devstack","openstack"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mikejoh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-22T09:45:55.000Z","updated_at":"2025-09-19T08:11:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"8bcc4573-a6d7-47cb-9fa1-482a3e50e13c","html_url":"https://github.com/mikejoh/capi-capo-devstack","commit_stats":null,"previous_names":["mikejoh/capi-capo-devstack"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mikejoh/capi-capo-devstack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikejoh%2Fcapi-capo-devstack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikejoh%2Fcapi-capo-devstack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikejoh%2Fcapi-capo-devstack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikejoh%2Fcapi-capo-devstack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikejoh","download_url":"https://codeload.github.com/mikejoh/capi-capo-devstack/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikejoh%2Fcapi-capo-devstack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29993540,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T01:47:34.672Z","status":"online","status_checked_at":"2026-03-02T02:00:07.342Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cluster-api","cluster-api-provider-openstack","devstack","openstack"],"created_at":"2025-02-23T17:28:37.329Z","updated_at":"2026-03-02T06:02:14.290Z","avatar_url":"https://github.com/mikejoh.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# CAPI, CAPO and DevStack!\n\nTry out your favourite tools and tech stack locally! :rocket:\n\nThis repository shows you step-by-step on how to run a complete environment locally to test:\n* [Cluster API](https://github.com/kubernetes-sigs/cluster-api)\n* [Cluster API Provider OpenStack](https://github.com/kubernetes-sigs/cluster-api-provider-openstack)\n* [Minikube](https://minikube.sigs.k8s.io/docs/start/?arch=%2Flinux%2Fx86-64%2Fstable%2Fbinary+download)\n* [DevStack](https://github.com/openstack/devstack)\n\n## Overview\n\nThis drawing shows a brief overview on what we're trying to achieve:\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/user-attachments/assets/f6eed09d-52fd-4e4a-83da-0d2909bff894\" alt=\"\"\u003e\n\u003c/div\u003e\n\n## Step-by-step\n\n1. Deploy Devstack locally, see this [repository](https://github.com/mikejoh/devstack-on-kvm) on how to do this on top of KVM.\n\n2. Download the OpenStack RC file via Horizon.\n\n3. Create a `minikube` cluster:\n\n_This assumes that you have a KVM network called `devstack_net` available._\n\n```bash\nminikube start --driver=kvm2 --kvm-network=devstack_net\n```\n\n4. Download `clusterctl`, change the destination directory if needed:\n\n```bash\ncurl -L https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.9.5/clusterctl-linux-amd64 -o ~/.local/bin/clusterctl\n```\n\n5. Install CAPO in the managment cluster (`minikube`):\n\n```bash\nexport CLUSTER_TOPOLOGY=true\nkubectl apply -f https://github.com/k-orc/openstack-resource-controller/releases/latest/download/install.yaml\nclusterctl init --infrastructure openstack\n```\n\nNotes:\n* `clusterctl init` is dependant on configuration, either via environment variables or a [configuration file](https://cluster-api.sigs.k8s.io/clusterctl/configuration).\n* `cert-manager` is installed during `init`, this might not be wanted if you already have one running: https://github.com/kubernetes-sigs/cluster-api/pull/7290/files\n\n* The default bootstrap providers are `kubeadm`, you can select others.\n\n6. Build an image using [`image-builder`](https://image-builder.sigs.k8s.io/capi/providers/openstack.html), used the `qemu` builder:\n\n```bash\ngit clone https://github.com/kubernetes-sigs/image-builder.git\ncd image-builder/images/capi/\nmake build-qemu-ubuntu-2404\n```\n\n7. Upload the built image to OpenStack if you built it using anything else than the OpenStack builder:\n\n```bash\nopenstack image create \"ubuntu-2204-kube-v1.31.6\" \\\n  --progress \\\n  --disk-format qcow2 \\\n  --property os_type=linux \\\n  --property os_distro=ubuntu2204 \\\n  --file output/ubuntu-2204-kube-v1.31.6/ubuntu-2204-kube-v1.31.6\n```\n\n8. Create a SSH keypair:\n\n```bash\nopenstack keypair create --type ssh k8s-devstack01\n```\n\nTake a note of that the private SSH key and store it somewhere safe.\n\n9. Install needed CAPO prerequisites and generate cluster manifests:\n\nMake sure you've prepared your `clouds.yaml` accordingly, here's an example:\n\n```bash\nclouds:\n  openstack:\n    auth:\n      auth_url: http://\u003cDevStack IP\u003e:5000//v3\n      username: \"demo\"\n      password: \"secret\"\n      project_name: \"admin\"\n      project_id: \"\u003cID\u003e\"\n      user_domain_name: \"Default\"\n    region_name: \"RegionOne\"\n    interface: \"public\"\n    identity_api_version: 3\n```\n\nUse the `env.rc` utility script to export a common set of environment variables to be used with `clusterctl init` later on.\n\n```bash\nwget https://raw.githubusercontent.com/kubernetes-sigs/cluster-api-provider-openstack/master/templates/env.rc -O /tmp/env.rc\nsource /tmp/env.rc clouds.yaml openstack\n```\n\nExport more environment variables that we'll need to define the workload cluster:\n\n```bash\nexport KUBERNETES_VERSION=v1.31.6\nexport OPENSTACK_DNS_NAMESERVERS=1.1.1.1\nexport OPENSTACK_FAILURE_DOMAIN=nova\nexport OPENSTACK_CONTROL_PLANE_MACHINE_FLAVOR=m1.medium\nexport OPENSTACK_NODE_MACHINE_FLAVOR=m1.medium\nexport OPENSTACK_IMAGE_NAME=ubuntu-2204-kube-v1.31.6\nexport OPENSTACK_SSH_KEY_NAME=k8s-devstack01\nexport OPENSTACK_EXTERNAL_NETWORK_ID=\u003cID\u003e\nexport CLUSTER_NAME=k8s-devstack01\nexport CONTROL_PLANE_MACHINE_COUNT=1\nexport WORKER_MACHINE_COUNT=0\n```\n\n_Please note that you'll need to fetch the `public` network ID and add it to the `OPENSTACK_EXTERNAL_NETWORK_ID` environment variable. Also the flavor needs to have at least 2 cores otherwise `kubeadm` will fail, this can be ignored from a `kubeadm` perspective but that's not covered here._\n\n10. Generate the cluster manifests and apply them in the `minikube` cluster:\n\n```bash\nclusterctl generate cluster k8s-devstack01 --infrastructure openstack \u003e k8s-devstack01.yaml\nkubectl apply -f k8s-devstack01.yaml\n```\n\n11. Check the status of the cluster using `clusterctl`, also check the logs of, primarily, the `capo-controller`:\n\n```bash\nclusterctl describe cluster k8s-devstack01\nNAME                                                               READY  SEVERITY  REASON  SINCE  MESSAGE\nCluster/k8s-devstack01                                             True                     14m\n├─ClusterInfrastructure - OpenStackCluster/k8s-devstack01\n└─ControlPlane - KubeadmControlPlane/k8s-devstack01-control-plane  True                     14m\n  └─Machine/k8s-devstack01-control-plane-zkjdn                     True                     15m\n```\n\n12. Download the cluster kubeconfig and test connectivity:\n\n```bash\nclusterctl get kubeconfig k8s-devstack01 \u003e k8s-devstack01.kubeconfig\nexport KUBECONFIG=k8s-devstack01.kubeconfig\n```\n\nYou should now be able to reach the cluster running within the DevStack environment! 🎉\n\n13. Install a CNI (Cilium), manually for now:\n\n```bash\nhelm repo add cilium https://helm.cilium.io/\n```\n\n```bash\nhelm upgrade --install cilium cilium/cilium --version 1.17.1 \\\n  --namespace kube-system \\\n  --set hubble.enabled=false \\\n  --set envoy.enabled=false \\\n  --set operator.replicas=1\n```\n\n14. Install the OpenStack Cloud Provider:\n\n```bash\ngit clone --depth=1 https://github.com/kubernetes-sigs/cluster-api-provider-openstack.git\n```\n\nGenerate the external cloud provider configuration with the provided helper script:\n\n```bash\n./templates/create_cloud_conf.sh ~/Downloads/clouds.yaml openstack \u003e /tmp/cloud.conf\n```\n\n_Note that if you want support for creating `Service` of `type: LoadBalancer` you'll need to configure this in the `cloud.conf` and re-create the secret._\n\nCreate the needed secret:\n\n```bash\nkubectl create secret -n kube-system generic cloud-config --from-file=/tmp/cloud.conf\n```\n\nCreate the needed Kubernetes resources for the OpenStack cloud provider:\n\n```bash\nhelm repo add cpo https://kubernetes.github.io/cloud-provider-openstack\nhelm repo update\nhelm upgrade --install \\\n  openstack-ccm cpo/openstack-cloud-controller-manager \\\n  --namespace kube-system \\\n  --values occm-values.yaml\n```\n\nIf everything went as expected pending Pods should've been scheduled and all Pods shall have IP addresses assigned to them.\n\n15. Done! 🚀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikejoh%2Fcapi-capo-devstack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikejoh%2Fcapi-capo-devstack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikejoh%2Fcapi-capo-devstack/lists"}