Skip to content

Commit d0ed7e3

Browse files
committed
feat(scs2): Add image references
Signed-off-by: Jan Schoone <[email protected]>
1 parent 33790b7 commit d0ed7e3

File tree

4 files changed

+164
-3
lines changed

4 files changed

+164
-3
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/usr/bin/env bash
2+
3+
# Usage: Just list the version as arguments
4+
# Example: ./generate_openstack_image_manager_yaml.sh 1.33.5 1.32.0 1.32.2
5+
6+
BASE_URL="https://nbg1.your-objectstorage.com/osism/openstack-k8s-capi-images/ubuntu-2404-kube"
7+
8+
get_checksum() {
9+
local version=$1
10+
local checksum_url="${BASE_URL}-v${version%.*}/ubuntu-2404-kube-v${version}.qcow2.CHECKSUM"
11+
curl -s "$checksum_url" | awk '{print $1}'
12+
}
13+
14+
generate_version_entry() {
15+
local version=$1
16+
local checksum=$2
17+
local build_date=$3
18+
19+
cat <<EOF
20+
- version: 'v${version}'
21+
url: ${BASE_URL}-v${version%.*}/ubuntu-2404-kube-v${version}.qcow2
22+
checksum: "sha256:${checksum}"
23+
build_date: ${build_date}
24+
EOF
25+
}
26+
27+
echo "---
28+
images:
29+
- name: ubuntu-capi-image
30+
enable: true
31+
format: raw
32+
login: ubuntu
33+
min_disk: 20
34+
min_ram: 1024
35+
status: active
36+
visibility: public
37+
multi: false
38+
separator: \"-\"
39+
meta:
40+
architecture: x86_64
41+
hw_disk_bus: virtio
42+
hw_rng_model: virtio
43+
hw_scsi_model: virtio-scsi
44+
hw_watchdog_action: reset
45+
hypervisor_type: qemu
46+
os_distro: ubuntu
47+
replace_frequency: never
48+
uuid_validity: none
49+
provided_until: none
50+
tags:
51+
- clusterstacks
52+
versions:"
53+
54+
for version in "$@"; do
55+
checksum=$(get_checksum "$version")
56+
build_date=$(date +%Y-%m-%d)
57+
generate_version_entry "$version" "$checksum" "$build_date"
58+
done

providers/openstack/scs2/README.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## Getting started
44

5+
6+
### Prepare a management Cluster using kind
7+
58
```sh
69
# Create bootstrap cluster
710
kind create cluster
@@ -17,14 +20,17 @@ kubectl -n capi-system rollout status deployment
1720
kubectl -n capo-system rollout status deployment
1821
```
1922

23+
### Install the Cluster Stack Operator
24+
2025
```
21-
# Install CSO and CSPO
2226
helm upgrade -i cso \
2327
-n cso-system \
2428
--create-namespace \
2529
oci://registry.scs.community/cluster-stacks/cso
2630
```
2731

32+
### Prepare some environment variables for reuse
33+
2834
```sh
2935
export CLUSTER_NAMESPACE=cluster
3036
export CLUSTER_NAME=my-cluster
@@ -34,6 +40,8 @@ export OS_CLIENT_CONFIG_FILE=${PWD}/clouds.yaml
3440
kubectl create namespace $CLUSTER_NAMESPACE --dry-run=client -o yaml | kubectl apply -f -
3541
```
3642

43+
### Add clouds.yaml as Secret
44+
3745
```sh
3846
# Create secret for CAPO
3947
kubectl create secret -n $CLUSTER_NAMESPACE generic openstack --from-file=clouds.yaml=$OS_CLIENT_CONFIG_FILE --dry-run=client -oyaml | kubectl apply -f -
@@ -63,8 +71,9 @@ spec:
6371
EOF
6472
```
6573

74+
### Install the Cluster Stack resource
75+
6676
```sh
67-
# Apply ClusterStack resource
6877
cat <<EOF | kubectl apply -f -
6978
apiVersion: clusterstack.x-k8s.io/v1alpha1
7079
kind: ClusterStack
@@ -83,8 +92,15 @@ spec:
8392
EOF
8493
```
8594

95+
### Prepare the Node Images
96+
97+
These Cluster Stacks do not contain fixed image to make it possible to provide the images in different ways.
98+
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.
99+
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.
100+
101+
### Apply the Cluster resource
102+
86103
```sh
87-
# Apply Cluster resource
88104
cat <<EOF | kubectl apply -f -
89105
apiVersion: cluster.x-k8s.io/v1beta1
90106
kind: Cluster
@@ -118,6 +134,8 @@ spec:
118134
EOF
119135
```
120136

137+
### Get the Workload Cluster kubeconfig and try it
138+
121139
```sh
122140
clusterctl get kubeconfig -n $CLUSTER_NAMESPACE openstack-testcluster > /tmp/kubeconfig
123141
kubectl get nodes --kubeconfig /tmp/kubeconfig
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
apiVersion: openstack.k-orc.cloud/v1alpha1
3+
kind: Image
4+
metadata:
5+
name: "ubuntu-capi-image-v1.33.6"
6+
spec:
7+
cloudCredentialsRef:
8+
cloudName: "openstack"
9+
secretName: "openstack"
10+
managementPolicy: managed
11+
resource:
12+
properties:
13+
hardware:
14+
diskBus: scsi
15+
scsiModel: virtio-scsi
16+
vifModel: virtio
17+
qemuGuestAgent: true
18+
rngModel: virtio
19+
architecture: x86_64
20+
minDiskGB: 20
21+
minMemoryMB: 2048
22+
operatingSystem:
23+
distro: ubuntu
24+
version: "24.04"
25+
content:
26+
diskFormat: qcow2
27+
download:
28+
url: https://nbg1.your-objectstorage.com/osism/openstack-k8s-capi-images/ubuntu-2404-kube-v1.33/ubuntu-2404-kube-v1.33.6.qcow2
29+
hash:
30+
algorithm: sha256
31+
value: ff458b22c33fc08eca9ba6635783e9a409b6f0613f577c4acdec554db7e2f6a7
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
images:
3+
- name: ubuntu-capi-image
4+
enable: true
5+
format: raw
6+
login: ubuntu
7+
min_disk: 20
8+
min_ram: 1024
9+
status: active
10+
visibility: public
11+
multi: false
12+
separator: "-"
13+
meta:
14+
architecture: x86_64
15+
hw_disk_bus: virtio
16+
hw_rng_model: virtio
17+
hw_scsi_model: virtio-scsi
18+
hw_watchdog_action: reset
19+
hypervisor_type: qemu
20+
os_distro: ubuntu
21+
replace_frequency: never
22+
uuid_validity: none
23+
provided_until: none
24+
tags:
25+
- clusterstacks
26+
versions:
27+
- version: 'v1.33.4'
28+
url: https://nbg1.your-objectstorage.com/osism/openstack-k8s-capi-images/ubuntu-2404-kube-v1.33/ubuntu-2404-kube-v1.33.4.qcow2
29+
checksum: "sha256:1f55111551d5c9948d4e02215be56a712ed818d9000592d4f11d4b6cc4407ade"
30+
build_date: 2025-12-17
31+
- version: 'v1.33.5'
32+
url: https://nbg1.your-objectstorage.com/osism/openstack-k8s-capi-images/ubuntu-2404-kube-v1.33/ubuntu-2404-kube-v1.33.5.qcow2
33+
checksum: "sha256:bd9efa9cad5d7028306eb26ecdc42a2f84337542a050381766714c4c0c1f7a98"
34+
build_date: 2025-12-17
35+
- version: 'v1.33.6'
36+
url: https://nbg1.your-objectstorage.com/osism/openstack-k8s-capi-images/ubuntu-2404-kube-v1.33/ubuntu-2404-kube-v1.33.6.qcow2
37+
checksum: "sha256:ff458b22c33fc08eca9ba6635783e9a409b6f0613f577c4acdec554db7e2f6a7"
38+
build_date: 2025-12-17
39+
- version: 'v1.34.0'
40+
url: https://nbg1.your-objectstorage.com/osism/openstack-k8s-capi-images/ubuntu-2404-kube-v1.34/ubuntu-2404-kube-v1.34.0.qcow2
41+
checksum: "sha256:1321c0978818752619ab994acccf4e2d9b241aa738fc56ed0a46b0ebe21fedfb"
42+
build_date: 2025-12-17
43+
- version: 'v1.34.1'
44+
url: https://nbg1.your-objectstorage.com/osism/openstack-k8s-capi-images/ubuntu-2404-kube-v1.34/ubuntu-2404-kube-v1.34.1.qcow2
45+
checksum: "sha256:0f2153d01e13693a680010045b1c7f4c511495eff4f8672ea29b475b02b43dc4"
46+
build_date: 2025-12-17
47+
- version: 'v1.34.2'
48+
url: https://nbg1.your-objectstorage.com/osism/openstack-k8s-capi-images/ubuntu-2404-kube-v1.34/ubuntu-2404-kube-v1.34.2.qcow2
49+
checksum: "sha256:8d37637dc86cd307e50ba2dab2d96aa3c46933552f5607f4663b40c246adb0a8"
50+
build_date: 2025-12-17
51+
- version: 'v1.34.3'
52+
url: https://nbg1.your-objectstorage.com/osism/openstack-k8s-capi-images/ubuntu-2404-kube-v1.34/ubuntu-2404-kube-v1.34.3.qcow2
53+
checksum: "sha256:b3c487345dd8ff2eea6ddd3e526d068abc3a59d40a994581f6dfc7be10df427b"
54+
build_date: 2025-12-17

0 commit comments

Comments
 (0)