Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions hack/generate_openstack_image_manager_yaml.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/usr/bin/env bash

# Usage: Just list the version as arguments
# Example: ./generate_openstack_image_manager_yaml.sh 1.33.5 1.32.0 1.32.2

BASE_URL="https://nbg1.your-objectstorage.com/osism/openstack-k8s-capi-images/ubuntu-2404-kube"

get_checksum() {
local version=$1
local checksum_url="${BASE_URL}-v${version%.*}/ubuntu-2404-kube-v${version}.qcow2.CHECKSUM"
curl -s "$checksum_url" | awk '{print $1}'
}

generate_version_entry() {
local version=$1
local checksum=$2
local build_date=$3

cat <<EOF
- version: 'v${version}'
url: ${BASE_URL}-v${version%.*}/ubuntu-2404-kube-v${version}.qcow2
checksum: "sha256:${checksum}"
build_date: ${build_date}
EOF
}

echo "---
images:
- name: ubuntu-capi-image
enable: true
format: raw
login: ubuntu
min_disk: 20
min_ram: 1024
status: active
visibility: public
multi: false
separator: \"-\"
meta:
architecture: x86_64
hw_disk_bus: virtio
hw_rng_model: virtio
hw_scsi_model: virtio-scsi
hw_watchdog_action: reset
hypervisor_type: qemu
os_distro: ubuntu
replace_frequency: never
uuid_validity: none
provided_until: none
tags:
- clusterstacks
versions:"

for version in "$@"; do
checksum=$(get_checksum "$version")
build_date=$(date +%Y-%m-%d)
generate_version_entry "$version" "$checksum" "$build_date"
done
24 changes: 21 additions & 3 deletions providers/openstack/scs2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Getting started


### Prepare a management Cluster using kind

```sh
# Create bootstrap cluster
kind create cluster
Expand All @@ -17,14 +20,17 @@ kubectl -n capi-system rollout status deployment
kubectl -n capo-system rollout status deployment
```

### Install the Cluster Stack Operator

```
# Install CSO and CSPO
helm upgrade -i cso \
-n cso-system \
--create-namespace \
oci://registry.scs.community/cluster-stacks/cso
```

### Prepare some environment variables for reuse

```sh
export CLUSTER_NAMESPACE=cluster
export CLUSTER_NAME=my-cluster
Expand All @@ -34,6 +40,8 @@ export OS_CLIENT_CONFIG_FILE=${PWD}/clouds.yaml
kubectl create namespace $CLUSTER_NAMESPACE --dry-run=client -o yaml | kubectl apply -f -
```

### Add clouds.yaml as Secret

```sh
# Create secret for CAPO
kubectl create secret -n $CLUSTER_NAMESPACE generic openstack --from-file=clouds.yaml=$OS_CLIENT_CONFIG_FILE --dry-run=client -oyaml | kubectl apply -f -
Expand Down Expand Up @@ -63,8 +71,9 @@ spec:
EOF
```

### Install the Cluster Stack resource

```sh
# Apply ClusterStack resource
cat <<EOF | kubectl apply -f -
apiVersion: clusterstack.x-k8s.io/v1alpha1
kind: ClusterStack
Expand All @@ -83,8 +92,15 @@ spec:
EOF
```

### Prepare the Node Images

These Cluster Stacks do not contain fixed image to make it possible to provide the images in different ways.
Recommended is to add all images using the [Image Manager](https://docs.scs.community/docs/iaas/components/image-manager/) pointing to the file `kubernetes.yaml` next to this README.
If you can't add images publicly you can change the visibility in the file to `private`. But in that case it's simpler to just apply the `image.yaml`. Since the OpenStack Resource Controller is a dependency to ClusterAPI Provider OpenStack this will import the image in your project using the same clouds.yaml file from the `openstack` Secret.

### Apply the Cluster resource

```sh
# Apply Cluster resource
cat <<EOF | kubectl apply -f -
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
Expand Down Expand Up @@ -118,6 +134,8 @@ spec:
EOF
```

### Get the Workload Cluster kubeconfig and try it

```sh
clusterctl get kubeconfig -n $CLUSTER_NAMESPACE openstack-testcluster > /tmp/kubeconfig
kubectl get nodes --kubeconfig /tmp/kubeconfig
Expand Down
32 changes: 32 additions & 0 deletions providers/openstack/scs2/image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
apiVersion: openstack.k-orc.cloud/v1alpha1
kind: Image
metadata:
name: "ubuntu-capi-image-v1.33.6"
spec:
cloudCredentialsRef:
cloudName: "openstack"
secretName: "openstack"
managementPolicy: managed
resource:
visibility: private
properties:
hardware:
diskBus: scsi
scsiModel: virtio-scsi
vifModel: virtio
qemuGuestAgent: true
rngModel: virtio
architecture: x86_64
minDiskGB: 20
minMemoryMB: 2048
operatingSystem:
distro: ubuntu
version: "24.04"
content:
diskFormat: qcow2
download:
url: https://nbg1.your-objectstorage.com/osism/openstack-k8s-capi-images/ubuntu-2404-kube-v1.33/ubuntu-2404-kube-v1.33.6.qcow2
hash:
algorithm: sha256
value: ff458b22c33fc08eca9ba6635783e9a409b6f0613f577c4acdec554db7e2f6a7
55 changes: 55 additions & 0 deletions providers/openstack/scs2/kubernetes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
images:
- name: ubuntu-capi-image
enable: true
format: raw
login: ubuntu
min_disk: 20
min_ram: 1024
status: active
visibility: public
multi: false
separator: "-"
meta:
architecture: x86_64
hw_disk_bus: virtio
hw_rng_model: virtio
hw_scsi_model: virtio-scsi
hw_watchdog_action: reset
hypervisor_type: qemu
os_distro: ubuntu
os_purpose: k8snode
replace_frequency: never
uuid_validity: none
provided_until: none
tags:
- clusterstacks
versions:
- version: 'v1.33.4'
url: https://nbg1.your-objectstorage.com/osism/openstack-k8s-capi-images/ubuntu-2404-kube-v1.33/ubuntu-2404-kube-v1.33.4.qcow2
checksum: "sha256:1f55111551d5c9948d4e02215be56a712ed818d9000592d4f11d4b6cc4407ade"
build_date: 2025-12-17
- version: 'v1.33.5'
url: https://nbg1.your-objectstorage.com/osism/openstack-k8s-capi-images/ubuntu-2404-kube-v1.33/ubuntu-2404-kube-v1.33.5.qcow2
checksum: "sha256:bd9efa9cad5d7028306eb26ecdc42a2f84337542a050381766714c4c0c1f7a98"
build_date: 2025-12-17
- version: 'v1.33.6'
url: https://nbg1.your-objectstorage.com/osism/openstack-k8s-capi-images/ubuntu-2404-kube-v1.33/ubuntu-2404-kube-v1.33.6.qcow2
checksum: "sha256:ff458b22c33fc08eca9ba6635783e9a409b6f0613f577c4acdec554db7e2f6a7"
build_date: 2025-12-17
- version: 'v1.34.0'
url: https://nbg1.your-objectstorage.com/osism/openstack-k8s-capi-images/ubuntu-2404-kube-v1.34/ubuntu-2404-kube-v1.34.0.qcow2
checksum: "sha256:1321c0978818752619ab994acccf4e2d9b241aa738fc56ed0a46b0ebe21fedfb"
build_date: 2025-12-17
- version: 'v1.34.1'
url: https://nbg1.your-objectstorage.com/osism/openstack-k8s-capi-images/ubuntu-2404-kube-v1.34/ubuntu-2404-kube-v1.34.1.qcow2
checksum: "sha256:0f2153d01e13693a680010045b1c7f4c511495eff4f8672ea29b475b02b43dc4"
build_date: 2025-12-17
- version: 'v1.34.2'
url: https://nbg1.your-objectstorage.com/osism/openstack-k8s-capi-images/ubuntu-2404-kube-v1.34/ubuntu-2404-kube-v1.34.2.qcow2
checksum: "sha256:8d37637dc86cd307e50ba2dab2d96aa3c46933552f5607f4663b40c246adb0a8"
build_date: 2025-12-17
- version: 'v1.34.3'
url: https://nbg1.your-objectstorage.com/osism/openstack-k8s-capi-images/ubuntu-2404-kube-v1.34/ubuntu-2404-kube-v1.34.3.qcow2
checksum: "sha256:b3c487345dd8ff2eea6ddd3e526d068abc3a59d40a994581f6dfc7be10df427b"
build_date: 2025-12-17