Skip to content

Commit

Permalink
Make use of the cluster.spec.topology.version field to select image (
Browse files Browse the repository at this point in the history
…#65)

* use cluster.spec.topology.version to select image
---------
Signed-off-by: Paul Hildebrandt <hildebrandt@b1-systems.de>
  • Loading branch information
paulphys authored Apr 16, 2024
1 parent 0c6a269 commit d14f656
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 20 deletions.
16 changes: 8 additions & 8 deletions providers/openstack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Fine grained PAT with `Public Repositories (read-only)` is enough.
export GIT_PROVIDER_B64=Z2l0aHVi # github
export GIT_ORG_NAME_B64=U292ZXJlaWduQ2xvdWRTdGFjaw== # SovereignCloudStack
export GIT_REPOSITORY_NAME_B64=Y2x1c3Rlci1zdGFja3M= # cluster-stacks
export GIT_ACCESS_TOKEN_B64=$(echo -n '<my-github-access-token>' | base64 -w0)
export GIT_ACCESS_TOKEN_B64=$(echo -n '<my-personal-access-token>' | base64 -w0)
```

### CSO and CSPO deployment (CSP)
Expand Down Expand Up @@ -107,15 +107,15 @@ metadata:
spec:
provider: openstack
name: alpha
kubernetesVersion: "1.28"
kubernetesVersion: "1.29"
channel: stable
autoSubscribe: false
providerRef:
apiVersion: infrastructure.clusterstack.x-k8s.io/v1alpha1
kind: OpenStackClusterStackReleaseTemplate
name: cspotemplate
versions:
- v3
- v2
---
apiVersion: infrastructure.clusterstack.x-k8s.io/v1alpha1
kind: OpenStackClusterStackReleaseTemplate
Expand Down Expand Up @@ -166,15 +166,15 @@ spec:
value: "SCS-2V-4-50"
- name: external_id
value: "ebfe5546-f09f-4f42-ab54-094e457d42ec" # gx-scs
class: openstack-alpha-1-28-v3
class: openstack-alpha-1-29-v2
controlPlane:
replicas: 1
version: v1.28.6
version: v1.29.3
workers:
machineDeployments:
- class: capi-openstack-alpha-1-28
- class: openstack-alpha-1-29-v2
failureDomain: nova
name: capi-openstack-alpha-1-28
name: openstack-alpha-1-29-v2
replicas: 3
EOF
```
Expand Down Expand Up @@ -226,4 +226,4 @@ kube-system openstack-cinder-csi-nodeplugin-crhc4 3/3 R
kube-system openstack-cinder-csi-nodeplugin-d7rzz 3/3 Running 0 7m58s
kube-system openstack-cinder-csi-nodeplugin-nkgq6 3/3 Running 0 6m44s
kube-system openstack-cloud-controller-manager-hp2n2 1/1 Running 0 7m9s
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,22 @@ spec:
example: "capi-keypair"
description: "The ssh key to inject in the nodes."
patches:
- name: k8s_version
description: "Sets the openstack node image for workers and the controlplane to the cluster-api image with the version mentioned in spec.topology.version."
definitions:
- selector:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha7
kind: OpenStackMachineTemplate
matchResources:
controlPlane: true
machineDeploymentClass:
names:
- {{ .Release.Name }}-{{ .Chart.Version }}
jsonPatches:
- op: add
path: "/spec/template/spec/image"
valueFrom:
template: ubuntu-capi-image-{{ `{{ .builtin.cluster.topology.version }}` }}
- name: controller_flavor
description: "Sets the openstack instance flavor for the KubeadmControlPlane."
enabledIf: {{ `'{{ ne .controller_flavor "" }}'` }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ spec:
flavor: {{ .Values.controller_flavor }}
identityRef:
kind: Secret
name: {{ default "openstack" .Values.secrets.clouds_yaml }}
image: {{ .Values.images.controlPlane.name }}
name: {{ default "openstack" .Values.secrets.clouds_yaml }}
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ spec:
flavor: {{ .Values.worker_flavor }}
identityRef:
kind: Secret
name: {{ default "openstack" .Values.secrets.clouds_yaml }}
image: {{ .Values.images.worker.name }}
name: {{ default "openstack" .Values.secrets.clouds_yaml }}
7 changes: 0 additions & 7 deletions providers/openstack/alpha/1-29/cluster-class/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@ restrict_kubeapi: []
# newly introduced:
openstack_loadbalancer_apiserver: true

# TBD, currently needed:
images:
controlPlane:
name: ubuntu-capi-image-v1.29.3
worker:
name: ubuntu-capi-image-v1.29.3

cloud:
name: "openstack"
secrets:
Expand Down
2 changes: 1 addition & 1 deletion providers/openstack/alpha/1-29/node-images/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ openStackNodeImages:
name: ubuntu-capi-image-v1.29.3
disk_format: qcow2
container_format: bare
visibility: private
visibility: private

0 comments on commit d14f656

Please sign in to comment.