### Development Workflow with Tilt Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/development/development.md A quick start guide for developing CAPO using Tilt. This involves setting up a devstack, running Tilt, installing ORC, configuring cloud credentials, and adding necessary images. ```bash # Create Devstack export RESOURCE_TYPE=... ./hack/ci/create_devstack.sh # Start tilt (separate terminal in cluster-api repo) # NOTE: Configure tilt-settings.yaml first! See below. make tilt-up # Back in CAPO repo # Install ORC kubectl apply -f https://github.com/k-orc/openstack-resource-controller/releases/latest/download/install.yaml # Create secret with clouds.yaml (the file is created by create_devstack.sh) kubectl create secret generic dev-test-cloud-config --from-file=clouds.yaml # Add images to use in the tests clusterctl generate yaml --from templates/image-template-node.yaml | kubectl apply -f - clusterctl generate yaml --from templates/image-template-bastion.yaml | kubectl apply -f - ``` -------------------------------- ### Install ORC using Kustomize Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/clusteropenstack/configuration.md Install ORC via its Kustomize module. The ORC_VERSION environment variable must be set. ```bash kubectl apply --server-side -k "https://github.com/k-orc/openstack-resource-controller/dist?ref=${ORC_VERSION}" ``` -------------------------------- ### Install OpenStack Resource Controller (ORC) Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/clusteropenstack/configuration.md Install ORC using the provided release YAML. Ensure the ORC_VERSION environment variable is set. ```bash ORC_VERSION=v2.0.3 kubectl apply -f "https://github.com/k-orc/openstack-resource-controller/releases/download/${ORC_VERSION}/install.yaml" ``` -------------------------------- ### Update Dependencies Example Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/AGENTS.md Example of updating a specific dependency, like cluster-api, to a new version. Always follow this with `make modules` and `make generate`. ```bash go get sigs.k8s.io/cluster-api@v1.x.x ``` -------------------------------- ### Specify Multiple Networks and Subnets Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/clusteropenstack/configuration.md This example demonstrates how to connect a server to multiple networks or subnets by providing different network identifiers or fixed IP configurations. ```yaml apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 kind: OpenStackMachineTemplate metadata: name: -controlplane namespace: spec: template: spec: ports: - network: name: myNetwork tags: myTag - network: id: your_network_id - fixedIPs: - subnet: id: your_subnet_id ``` -------------------------------- ### Example clouds.yaml for CAPO Secret Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/development/development.md This is an example of a clouds.yaml file that can be used to configure CAPO's interaction with your OpenStack environment. It includes authentication details and region information. ```yaml clouds: capo-e2e: auth: username: demo password: secretadmin # If using application credentials you would have something like this instead: # auth_type: v3applicationcredential # application_credential_id: abc123 # application_credential_secret: 456def user_domain_id: default auth_url: https://example.com/identity domain_id: default project_name: demo verify: false region_name: RegionOne ``` -------------------------------- ### DevStack Local Configuration Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/development/development.md Customize DevStack installation by creating a local.conf file. This example enables essential OpenStack services and plugins for CAPI-OpenStack development. ```bash [[local|localrc]] ADMIN_PASSWORD=!!! CHANGE ME !!! DATABASE_PASSWORD=$ADMIN_PASSWORD RABBIT_PASSWORD=$ADMIN_PASSWORD SERVICE_PASSWORD=$ADMIN_PASSWORD GIT_BASE=https://opendev.org # Enable Logging LOGFILE=$DEST/logs/stack.sh.log VERBOSE=True LOG_COLOR=True enable_service rabbit enable_plugin neutron $GIT_BASE/openstack/neutron # Octavia supports using QoS policies on the VIP port: enable_service q-qos enable_service placement-api placement-client # Octavia services enable_plugin octavia $GIT_BASE/openstack/octavia master enable_plugin octavia-dashboard $GIT_BASE/openstack/octavia-dashboard enable_plugin ovn-octavia-provider $GIT_BASE/openstack/ovn-octavia-provider enable_plugin octavia-tempest-plugin $GIT_BASE/openstack/octavia-tempest-plugin enable_service octavia o-api o-cw o-hm o-hk o-da ``` -------------------------------- ### SSH into Instance via Bastion Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/development/development.md Connects to an instance by proxying through a bastion host. This example uses specific paths for SSH keys and instance details. ```bash ssh -J cirros@172.24.4.229 -i ./_artifacts/ssh/cluster-api-provider-openstack-sigs-k8s-io core@10.6.0.145 ``` -------------------------------- ### Clone Repository Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/RELEASE.md Clone the repository to start the release process. Ensure your remote is set up correctly with origin pointing to your fork and upstream to the main repository. ```bash git clone git@github.com:kubernetes-sigs/cluster-api-provider-openstack.git ``` -------------------------------- ### Establish SSHuttle Connection Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/development/development.md Connects the host to the DevStack instance using sshuttle for network setup. Ensure the IP address and subnet are correct for your environment. ```bash sshuttle -r stack@ 172.24.4.0/24 -l 0.0.0.0 ``` -------------------------------- ### Install OpenStack Cluster API Provider Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/topics/mover.md Installs the necessary Cluster API providers, including the OpenStack infrastructure provider, into the target cluster. Ensure `clusterctl` is configured with the correct kubeconfig. ```bash clusterctl --kubeconfig capi-openstack-3.kubeconfig init --infrastructure openstack ``` -------------------------------- ### Port Configuration: Network and Subnet by Filter Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/clusteropenstack/configuration.md Example of specifying network and subnet using their names as filters. This is less efficient and reliable than using IDs. ```yaml ports: - tags: - storage network: name: storage-network fixedIPs: - subnet: name: storage-subnet ``` -------------------------------- ### CAPO Trunk Support Check Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/proposals/20230525-openstack-microversion-support.md This code snippet demonstrates checking for trunk support in CAPO before issuing an API call. It's an example of feature detection at the point of creation. ```go func (s *InstanceService) CreateInstance(ctx context.Context, instance *infrav1.OpenStackInstance, ...) error { // ... other setup ... // Check for trunk support before creating the client and issuing the API call if instance.Spec.TrunkSupport { // Logic to ensure trunk support is enabled or handled // This might involve checking the OpenStack API version or specific capabilities // For example, ensuring the network driver supports trunks or the API version is sufficient // ... } // Obtain client and issue API call client, err := s.clientMgr.NewClient(ctx, instance.Namespace, instance.Spec.CloudName) if err != nil { return fmt.Errorf("failed to create OpenStack client: %v", err) } // ... proceed with instance creation using the client ... return nil } ``` -------------------------------- ### Port Configuration: Default Network and Subnet Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/clusteropenstack/configuration.md Example of a port configuration where no network or fixed IPs are specified, relying on cluster defaults. ```yaml ports: - tags: - control-plane ``` -------------------------------- ### Port Configuration: Explicit Network and Subnet Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/clusteropenstack/configuration.md Example of defining a port with an explicitly specified network ID and subnet ID. ```yaml ports: - tags: - control-plane network: id: 0686143b-f0a7-481a-86f5-cc1f8ccde692 fixedIPs: - subnet: id: a5e50a9c-58f9-4b6f-b8ee-2e7b4e4414ee ``` -------------------------------- ### Build and Serve Documentation Locally Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/AGENTS.md Build the project's documentation using mdBook and serve it locally for preview. This allows you to review documentation changes before committing. ```bash make -C docs/book serve ``` -------------------------------- ### Create Kind Cluster and Initialize CAPO Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/development/development.md Steps to create a local Kind cluster and initialize Cluster API Provider OpenStack (CAPO). Ensure CLUSTER_TOPOLOGY is exported and use local artifacts if necessary. ```bash kind create cluster export CLUSTER_TOPOLOGY=true clusterctl init --infrastructure openstack ``` -------------------------------- ### Install ORC Dependency Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/development/development.md Installs the OpenStack Resource Controller (ORC), a prerequisite for CAPO functionality. Apply this manifest to your Kubernetes cluster. ```bash kubectl apply -f https://github.com/k-orc/openstack-resource-controller/releases/latest/download/install.yaml ``` -------------------------------- ### Build Docker Image for All Architectures Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/AGENTS.md Builds the project's Docker image for all supported architectures. ```bash make docker-build-all ``` -------------------------------- ### Build All Binaries Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/AGENTS.md Builds all executable binaries for the project. ```bash make binaries ``` -------------------------------- ### Get Bastion Host Floating IP Address Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/clusteropenstack/configuration.md Use `kubectl get openstackcluster` to retrieve the floating IP address of the bastion host after the cluster is operational. Ensure your kubectl context is set to the management cluster. ```bash $ kubectl get openstackcluster NAME CLUSTER READY NETWORK SUBNET BASTION nonha nonha true 2e2a2fad-28c0-4159-8898-c0a2241a86a7 53cb77ab-86a6-4f2c-8d87-24f8411f15de 10.0.0.213 ``` -------------------------------- ### Build Flatcar QEMU Image for OpenStack Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/clusteropenstack/configuration.md Build a Flatcar QEMU image specifically for OpenStack using the image-builder project. ```bash make OEM_ID=openstack build-qemu-flatcar ``` -------------------------------- ### Enable Ignition Experimental Feature Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/clusteropenstack/configuration.md Enable the Ignition experimental feature for OS provisioning. ```bash export EXP_KUBEADM_BOOTSTRAP_FORMAT_IGNITION=true ``` -------------------------------- ### v1beta1 FailureDomains Representation Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/topics/crd-changes/v1beta1-to-v1beta2.md Example of the FailureDomains field in OpenStackCluster status in v1beta1, represented as a map. ```yaml status: failureDomains: az-1: controlPlane: true attributes: region: us-east-1 az-2: controlPlane: false ``` -------------------------------- ### Enable Experimental Features with clusterctl init Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/experimental-features/experimental-features.md Set OS environment variables to true before running 'clusterctl init' to enable experimental features. Ensure the infrastructure provider is specified. ```bash export EXP_SOME_FEATURE_NAME=true clusterctl init --infrastructure openstack ``` -------------------------------- ### Generate Release Notes Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/RELEASE.md Use the make command to generate the release notes. Ensure you replace vX.Y.Z with the new release tag. ```bash RELEASE_TAG=vX.Y.Z make generate-release-notes ``` -------------------------------- ### Configure Boot From Volume in OpenStackMachineTemplate Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/clusteropenstack/configuration.md Enable booting from a Cinder volume by setting `spec.rootVolume.diskSize` to a value greater than 0 in the OpenStackMachineTemplate. Optionally specify volume type and availability zone. ```yaml apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 kind: OpenStackMachineTemplate metadata: name: -controlplane namespace: spec: template: spec: ... rootVolume: sizeGiB: type: availabilityZone: name: ... ``` -------------------------------- ### Build Docker Image Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/AGENTS.md Builds the project's Docker image. ```bash make docker-build ``` -------------------------------- ### Configure OpenStack Environment Variables Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/development/development.md Set these environment variables before running the create_devstack.sh script for OpenStack deployments. Ensure paths and names match your OpenStack setup. ```bash export RESOURCE_TYPE="openstack" export OS_CLOUD= export OPENSTACK_FLAVOR_controller== 16 cores, 64GB RAM and 50GB storage> export OPENSTACK_FLAVOR_worker== 8 cores, 32GB RAM and 50GB storage> export OPENSTACK_PUBLIC_NETWORK= export OPENSTACK_SSH_KEY_NAME= export SSH_PUBLIC_KEY_FILE=/home/user/.ssh/id_ed25519.pub export SSH_PRIVATE_KEY_FILE=/home/user/.ssh/id_ed25519 ``` -------------------------------- ### Get OpenStackServer Objects with Kubectl Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/development/development.md Use this command to retrieve a list of all OpenStackServer objects managed by the controller. These objects represent servers in OpenStack and are created and deleted by the controller. ```shell kubectl get openstackservers ``` -------------------------------- ### Build End-to-End Test Binaries Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/AGENTS.md Compiles the end-to-end test binaries, preparing them for execution. ```bash make build-e2e-tests ``` -------------------------------- ### Get Cluster API Controller Logs Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/topics/troubleshooting.md Retrieve logs for Cluster API controller managers in the 'capo-system' namespace. Similar commands can be used for 'capi-system' and 'cabpk-system' namespaces. ```bash kubectl --kubeconfig minikube.kubeconfig -n capo-system logs -l control-plane=capo-controller-manager -c manager ``` -------------------------------- ### Generate API Documentation Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/AGENTS.md Generates documentation for the project's APIs. ```bash make generate-api-docs ``` -------------------------------- ### Configure Tilt Settings for CAPO Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/development/development.md Update your tilt-settings.yaml to include CAPO templates and define necessary kustomize substitutions for cluster creation. This is crucial for using Tilt with ClusterClass. ```yaml template_dirs: openstack: # Make Tilt aware of the CAPO templates - ../cluster-api-provider-openstack/templates kustomize_substitutions: CLUSTER_TOPOLOGY: "true" # [Optional] SSH Keypair Name for Instances in OpenStack (Default: "") OPENSTACK_SSH_KEY_NAME: "" # [Optional] Control Plane Machine Flavor (Default: m1.medium) OPENSTACK_CONTROL_PLANE_MACHINE_FLAVOR: "" # [Optional] Node Machine Flavor (Default: m1.small) OPENSTACK_NODE_MACHINE_FLAVOR: "" # [Optional] OpenStack Cloud Environment (Default: capo-e2e) OPENSTACK_CLOUD: "" # See templates/cluster-template-development.yaml and # templates/clusterclass-dev-test.yaml for more variables. # [Optional] Automatically apply a kustomization, e.g. for adding the clouds.yaml secret additional_kustomizations: secret_kustomization: /path/to/kustomize/secret/configuration ``` -------------------------------- ### Add Custom Security Group Rule for All Nodes Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/clusteropenstack/configuration.md Use `clusterNodesSecurityGroupRules` to define custom ingress rules for all cluster nodes. This example allows BGP traffic between control plane and worker nodes. ```yaml managedSecurityGroups: clusterNodesSecurityGroupRules: - remoteManagedGroups: - controlplane - worker direction: ingress etherType: IPv4 name: BGP (Calico) portRangeMin: 179 portRangeMax: 179 protocol: tcp description: "Allow BGP between control plane and workers" ``` -------------------------------- ### Port Configuration: Fixed IP with Subnet ID Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/clusteropenstack/configuration.md Example of configuring a port with a fixed IP, inferring the network from the provided subnet ID. This is less efficient and reliable than explicit network specification. ```yaml ports: - tags: - control-plane fixedIPs: - subnet: id: a5e50a9c-58f9-4b6f-b8ee-2e7b4e4414ee ``` -------------------------------- ### Execute DevStack Creation Script Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/development/development.md Run this script after configuring the necessary environment variables to create the DevStack environment on OpenStack. ```bash ./hack/ci/create_devstack.sh ``` -------------------------------- ### Generate Cluster Configuration with 'without-lb' Flavor Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/clusteropenstack/configuration.md Use this command to generate a cluster configuration file, specifically for a single control plane setup without a load balancer, by specifying the 'without-lb' flavor. ```bash # Using 'without-lb' flavor clusterctl generate cluster \ --flavor without-lb \ --kubernetes-version v1.24.2 \ --control-plane-machine-count=1 \ --worker-machine-count=1 \ > capi-quickstart.yaml ``` -------------------------------- ### Accessing Ready Condition in v1beta2 Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/topics/crd-changes/v1beta1-to-v1beta2.md Demonstrates how to check the 'Ready' condition status in v1beta2 using the Kubernetes API machinery. This replaces the deprecated 'status.ready' field. ```go import "k8s.io/apimachinery/pkg/api/meta" readyCondition := meta.FindStatusCondition(cluster.Status.Conditions, "Ready") if readyCondition != nil && readyCondition.Status == metav1.ConditionTrue { // ... } ``` -------------------------------- ### OpenStackCluster CNI Security Group Rules Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/clusteropenstack/configuration.md Configure specific security group rules for CNI plugins like Calico. This example shows rules for BGP and IP-in-IP traffic between control plane and worker nodes. ```yaml apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 kind: OpenStackCluster metadata: name: namespace: spec: ... managedSecurityGroups: clusterNodesSecurityGroupRules: - remoteManagedGroups: - controlplane - worker direction: ingress etherType: IPv4 name: BGP (Calico) portRangeMin: 179 portRangeMax: 179 protocol: tcp description: "Allow BGP between control plane and workers" - remoteManagedGroups: - controlplane - worker direction: ingress etherType: IPv4 name: IP-in-IP (Calico) protocol: 4 description: "Allow IP-in-IP between control plane and workers" allowAllInClusterTraffic: false ``` -------------------------------- ### Run E2E Tests with Rootless Podman Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/development/development.md Executes end-to-end tests using rootless Podman by setting the PODMAN=1 environment variable. Requires specific host kernel and systemd/iptables configuration. ```bash make test-e2e OPENSTACK_CLOUD_YAML_FILE=/path/to/clouds.yaml OPENSTACK_CLOUD=my_cloud \ PODMAN=1 ``` -------------------------------- ### Allowing Cross-AZ Member Registration Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/proposals/20250818-multi-az-apiserver-loadbalancer.md Enable the `allowCrossAZLoadBalancerMembers` flag in the API server load balancer configuration to permit members from different availability zones to register with the load balancer. This is useful in specific multi-AZ setups. ```yaml spec: controlPlaneEndpoint: host: api.mycluster.example.com port: 6443 apiServerLoadBalancer: enabled: true network: id: 6c90b532-7ba0-418a-a276-5ae55060b5b0 availabilityZoneSubnets: - availabilityZone: az1 subnet: id: cad5a91a-36de-4388-823b-b0cc82cadfdc - availabilityZone: az2 subnet: id: e2407c18-c4e7-4d3d-befa-8eec5d8756f2 allowCrossAZLoadBalancerMembers: true ``` -------------------------------- ### Create HCP System Namespace Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/topics/hosted-control-plane.md Creates the 'hcp-system' namespace for deploying cluster components. Adjust the namespace name if needed. ```bash kubectl create namespace hcp-system ``` -------------------------------- ### Configure Glance for Web Download Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/development/development.md Configures Glance API, Horizon, and image import settings to enable web download of images. Restart services after applying changes. ```ini # /etc/glance/glance-api.conf show_multiple_locations = True # ./horizon/openstack_dashboard/defaults.py IMAGE_ALLOW_LOCATIONS = True # /etc/glance/glance-image-import.conf [image_import_opts] image_import_plugins = ['image_decompression'] $ sudo systemctl restart devstack@g-api.service apache2 ``` -------------------------------- ### Build and Push Custom CAPO Controller Image Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/development/development.md Builds and pushes a custom capi-openstack controller image to a Docker registry. Ensure REGISTRY, IMAGE_NAME, and TAG environment variables are set appropriately. ```bash make docker-build docker-push ``` -------------------------------- ### Remove Kubernetes Configuration and Download New Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/clusteropenstack/configuration.md Remove existing Kubernetes configuration and download a new configuration for a different major version. ```bash sudo rm /etc/sysupdate.kubernetes.d/kubernetes-*.conf && cd /etc/sysupdate.kubernetes.d && sudo wget https://github.com/flatcar/sysext-bakery/releases/download/latest/kubernetes-${KUBERNETES_VERSION%.*}.conf ``` -------------------------------- ### Enable Flatcar Sysext Systemd Timer Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/clusteropenstack/configuration.md Enable the systemd-sysupdate timer for automatic Kubernetes updates on Flatcar sysext nodes. ```bash sudo systemctl enable --now systemd-sysupdate.timer ``` -------------------------------- ### MachineInitialization Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/api/v1beta2/api.md MachineInitialization contains information about the initialization status of the machine. ```APIDOC ## MachineInitialization ### Description MachineInitialization contains information about the initialization status of the machine. ### Fields - **provisioned** (bool) - Optional - provisioned is set to true when the initial provisioning of the machine infrastructure is completed. The value of this field is never updated after provisioning is completed. ``` -------------------------------- ### Monitor Hosted Control Plane Creation Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/topics/hosted-control-plane.md Monitor the hosted control plane deployment by checking PVC binding, pod startup, and LoadBalancer service IP assignment on the management cluster. ```bash # Watch etcd PVC binding and pod startup on the management cluster kubectl -n hcp-system get pvc kubectl -n hcp-system get pods -w ``` ```bash # Verify the LoadBalancer service receives an external IP address kubectl -n hcp-system get svc openstack-hcp-cluster-cp -o wide ``` -------------------------------- ### Checkout Main Branch Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/RELEASE.md Switch to the main branch before creating a new branch for release notes. ```bash git checkout main ``` -------------------------------- ### Run Unit Tests Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/AGENTS.md Executes all unit tests defined in the project. ```bash make test ``` -------------------------------- ### Generate Client Code Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/AGENTS.md Generates client code, including clientsets, listers, and informers for Kubernetes APIs. ```bash make generate-codegen ``` -------------------------------- ### Generate and Apply Development Cluster Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/development/development.md Create a cluster YAML file using `clusterctl generate cluster` with a development template and apply it to the cluster. This creates a new cluster instance based on the defined ClusterClass. ```bash clusterctl generate cluster my-cluster --kubernetes-version=v1.29.0 --from templates/cluster-template-development.yaml > my-cluster.yaml kubectl apply -f my-cluster.yaml ``` -------------------------------- ### Cluster Controller Bastion Logic Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/design/proposed/2020-openstackserver-controller.md Pseudocode illustrating the cluster controller's logic for managing bastion hosts using OpenStackServer objects. It handles creation, deletion, and reconciliation based on the bastion's specification. ```go if spec.Bastion == nil { if OpenStackServer for bastion exists { delete OpenStackServer object return } } else { serverObj := fetch OpenStackServer object if serverObj does not exist { substitute tags and default network into bastion spec if required create OpenStackServer object return } if server spec does not match bastion.Spec { deleteOpenStackServer(bastion) return } if server is Ready { attach bastion floating IP to server populate bastion status in OpenStackCluster } } ``` -------------------------------- ### Build Manager Binaries Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/AGENTS.md Builds the manager binaries for the project, typically the main controllers. ```bash make managers ``` -------------------------------- ### Initialize Cluster API with OpenStack Provider Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/topics/hosted-control-plane.md Initializes Cluster API on your management cluster, enabling the OpenStack infrastructure provider. Ensure you have cluster-admin access. ```bash clusterctl init --infrastructure openstack ``` -------------------------------- ### Verify Go Vulnerability Check Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/AGENTS.md Checks Go code for security vulnerabilities using the `govulncheck` tool. ```bash make verify-govulncheck ``` -------------------------------- ### Check Bootstrap Cluster Pods Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/topics/mover.md Verify that all necessary Cluster API and system pods are running on the bootstrap cluster before proceeding with the move operation. ```bash # kubectl get pods --all-namespaces NAMESPACE NAME READY STATUS RESTARTS AGE capi-kubeadm-bootstrap-system capi-kubeadm-bootstrap-controller-manager-68cfd4c5b8-mjq75 2/2 Running 0 27m capi-kubeadm-control-plane-system capi-kubeadm-control-plane-controller-manager-848575ccb7-m672j 2/2 Running 0 27m capi-system capi-controller-manager-564d97d59c-2t7sl 2/2 Running 0 27m capi-webhook-system capi-controller-manager-9c8b5d6d4-49czx 2/2 Running 0 28m capi-webhook-system capi-kubeadm-bootstrap-controller-manager-7dff4b8c7-8w9sq 2/2 Running 1 27m capi-webhook-system capi-kubeadm-control-plane-controller-manager-74c99998d-bftbn 2/2 Running 0 27m capi-webhook-system capo-controller-manager-7d7bfc856b-5ttw6 2/2 Running 0 24m capo-system capo-controller-manager-5fb48fcb4c-ttkpv 2/2 Running 0 25m cert-manager cert-manager-544d659678-l9pjb 1/1 Running 0 29m cert-manager cert-manager-cainjector-64c9f978d7-bjxkg 1/1 Running 0 29m cert-manager cert-manager-webhook-5855bb8c8c-8hb9w 1/1 Running 0 29m kube-system coredns-66bff467f8-ggn54 1/1 Running 0 40m kube-system coredns-66bff467f8-t4bqr 1/1 Running 0 40m kube-system etcd-kind-control-plane 1/1 Running 1 40m kube-system kindnet-ng2gf 1/1 Running 0 40m kube-system kube-apiserver-kind-control-plane 1/1 Running 1 40m kube-system kube-controller-manager-kind-control-plane 1/1 Running 1 40m kube-system kube-proxy-h6rmz 1/1 Running 0 40m kube-system kube-scheduler-kind-control-plane 1/1 Running 1 40m local-path-storage local-path-provisioner-bd4bb6b75-ft7wh 1/1 Running 0 40m ``` -------------------------------- ### Validate Experimental Features on Existing Management Clusters Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/experimental-features/experimental-features.md Use 'kubectl describe' to view the arguments of the controller manager deployment and validate the status of enabled experimental features. ```bash kubectl describe -n capo-system deployment.apps/capo-controller-manager ``` -------------------------------- ### Apply Cluster Manifest Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/topics/hosted-control-plane.md Apply the cluster manifest to deploy the hosted control plane. ```bash kubectl apply -f openstack-hcp-cluster.yaml ``` -------------------------------- ### Emulate Docker Daemon with Podman System Service Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/docs/book/src/development/development.md This workaround is necessary for the cluster-api test framework, which explicitly connects to a running Docker daemon. Ensure the Podman system service is running and listening on the correct socket. ```bash $ podman system service -t 0 & $ sudo rm /var/run/docker.sock $ sudo ln -s /run/user/$(id -u)/podman/podman.sock /var/run/docker.sock ``` -------------------------------- ### Create Release Notes Branch Source: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/RELEASE.md Create a new branch specifically for generating and committing release notes. Replace X.Y.Z with the actual release version. ```bash git checkout -b release-notes-X.Y.Z origin/main ```