You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Cluster Stacks] Automate creation of Cluster Stack release assets using Zuul #727
ContainerIssues or pull requests relevant for Team 2: Container Infra and ToolingOpsIssues or pull requests relevant for Team 3: Ops ToolingenhancementNew feature or requestneeds refinementUser stories that need to be refined for further progress
Basic workflow to create assets from Cluster Stack defintion
git clone https://github.com/SovereignCloudStack/cluster-stacks
git clone https://github.com/SovereignCloudStack/csctl
git clone https://github.com/SovereignCloudStack/csctl-plugin-openstack
cd csctl
make build
cp csctl /usr/local/bin
cd ../csctl-plugin-openstack
make build
cp csctl-openstack /usr/local/bin
cd ../cluster-stacks
./hack/generate_version.py --build # works only for Cluster Stack openstack-scs
csctl create -m hash providers/openstack/out/1-29/ # useless in ci because assets are only available locally
Needed secrets:
OCI_REGISTRY
OCI_REPOSITORY
OCI_USERNAME
OCI_PASSWORD
or
OCI_ACCESS_TOKEN
Hi @o-otte, only needed for the last part: as mentioned on Friday I used a script for automatically creating the ClusterStack object I didn't checked in somewhere because it's not very stable, but was enough for my tests.
But maybe it can be used for inspiration or something :D
See here:
#!/bin/bash# Given directory name#directory_name=".release/openstack-scs-1-27-v0-sha-zciidfn"
directory_name=$1# Extract parts from the directory name
IFS='/'read -ra PARTS <<<"$directory_name"
IFS='-'read -ra PARTS <<<"${PARTS[1]}"
provider="${PARTS[0]}"
name="${PARTS[1]}"
kubernetes_major_version="${PARTS[2]}"
kubernetes_minor_version="${PARTS[3]}"
version="${PARTS[4]}-${PARTS[5]}.${PARTS[6]}"
channel="custom"if [[ -z${PARTS[6]} ]];then
version="${PARTS[4]}"
channel="stable"fi# Create the YAML structure
clusterstack_yaml=$( cat <<EOF---apiVersion: clusterstack.x-k8s.io/v1alpha1kind: ClusterStackmetadata: name: ${provider}-${name}-${kubernetes_major_version}-${kubernetes_minor_version}spec: provider: ${provider} name: ${name} kubernetesVersion: "${kubernetes_major_version}.${kubernetes_minor_version}" channel: ${channel} autoSubscribe: false providerRef: apiVersion: infrastructure.clusterstack.x-k8s.io/v1alpha1 kind: OpenStackClusterStackReleaseTemplate name: cspotemplate versions: - ${version}EOF)# Print the YAML contentecho"$clusterstack_yaml"
I've started to create a justfile to automate the first step, including building csctl and the `csctl openstack plugin to enable a local user and later the CI to use it as discussed.
Workflow automation can now create all assets locally with one command. All commands are idempotent as long as there are no changes in the versions.yaml file.
Will continue on Monday with the upload to the registry. OCI_ variables will be fetched from a just.env file. Afterwards, this will be integrated with Zuul.
@jschoone As discussed, I've added some final changes to the justfile, including draft recipes for creating ClusterStack and Cluster ressources as well as a test if the clusterstack manifest could be applied. This needs to get fleshed out for real world use.
I also created two playbooks to:
Upload Assets to the OCI registry (hashed more for PRs, stable more for post-merge Runs)
Create chore branches and PRs
The last commit also includes Zuul Job definitions that use those playbooks.
The following is left to do:
A (new) Zuul base job is needed that does the credentials handling with Vault for the SCS Registry as well as for a GitHub Token needed for pushing to the feature branches as well as opening the PRs.
Attaching of Zuul Jobs to Zuul Pipelines
Setting up Zuul to recognize PRs against the release branches.
ContainerIssues or pull requests relevant for Team 2: Container Infra and ToolingOpsIssues or pull requests relevant for Team 3: Ops ToolingenhancementNew feature or requestneeds refinementUser stories that need to be refined for further progress
Activity
jschoone commentedon Nov 8, 2024
Notes about all the stuff
Requirements:
Build and publish Cluster Stacks
Basic workflow to create assets from Cluster Stack defintion
Needed secrets:
OCI_REGISTRY
OCI_REPOSITORY
OCI_USERNAME
OCI_PASSWORD
or
OCI_ACCESS_TOKEN
KUBECONFIG
Workflow to push assets to OCI registry
in our example we got version openstack-scs-1-29-v0-sha-ihtybxi
which is available in .releases and in the $OCI_REPOSITORY
Thoughts:
When generating cluster stacks with
generate_version.py, versions should always be inproviders/openstack/scsExample for 1.29:
providers/openstack/scswithproviders/openstack/out/1-29chore/update-1.29release-1.29Automatically check for new versions
We depend on various versions
Test in Cluster (probably out of scope here)
Results in Cluster Stack object:
jschoone commentedon Nov 11, 2024
Hi @o-otte,
only needed for the last part: as mentioned on Friday I used a script for automatically creating the ClusterStack object I didn't checked in somewhere because it's not very stable, but was enough for my tests.
But maybe it can be used for inspiration or something :D
See here:
okautz commentedon Nov 11, 2024
Thanks!
I've started to create a justfile to automate the first step, including building
csctland the `csctl openstack plugin to enable a local user and later the CI to use it as discussed.This will be the current working PR: SovereignCloudStack/cluster-stacks#184
okautz commentedon Nov 14, 2024
Workflow automation can now create all assets locally with one command. All commands are idempotent as long as there are no changes in the versions.yaml file.
Will continue on Monday with the upload to the registry.
OCI_variables will be fetched from ajust.envfile. Afterwards, this will be integrated with Zuul.okautz commentedon Nov 29, 2024
@jschoone As discussed, I've added some final changes to the justfile, including draft recipes for creating ClusterStack and Cluster ressources as well as a test if the clusterstack manifest could be applied. This needs to get fleshed out for real world use.
I also created two playbooks to:
The last commit also includes Zuul Job definitions that use those playbooks.
The following is left to do: