SovereignCloudStack / cluster-stacks

Definition of Cluster Stacks based on the ClusterAPI ClusterClass feature
https://scs.community/
Apache License 2.0
7 stars 6 forks source link

:sparkles: Add wooctavia cluster stack #54

Closed chess-knight closed 3 months ago

chess-knight commented 4 months ago

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged): Fixes #48

Special notes for your reviewer: Prepare kube-vip:

$ openstack network create wooctavia-net -c id -f value
05940077-55c1-4a48-83be-80564f8c0fdc
$ openstack subnet create wooctavia-subnet --network wooctavia-net --subnet-range 192.0.2.0/24 # --dns-nameserver 62.138.222.111 --dns-nameserver 62.138.222.222
$ openstack port create vip-port --network wooctavia-net -c fixed_ips -f value
[{'subnet_id': '0be684d2-a2f9-42fe-9398-22857c64befd', 'ip_address': '192.0.2.96'}]
# assign public IP to VIP
$ openstack router create wooctavia-router
$ openstack router add subnet wooctavia-router wooctavia-subnet
$ openstack router set --external-gateway ext01 wooctavia-router
$ openstack floating ip create ext01 --port vip-port -c floating_ip_address -f value
213.131.230.131

Prepare yawol:

Use OpenStack helper chart for secrets:

helm template https://github.com/SovereignCloudStack/openstack-csp-helper/releases/latest/download/openstack-csp-helper.tgz -f path/to/clouds.yaml --set yawol=true | kubectl apply -f -

Create cluster(cluster stacks openstack-wooctavia-1-27-v1(pre-release for now) have to be installed first):

apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
  name: wooctavia
  labels:
    managed-secret: cloud-config
spec:
  clusterNetwork:
    pods:
      cidrBlocks:
        - 192.168.0.0/16
    serviceDomain: cluster.local
    services:
      cidrBlocks:
        - 10.96.0.0/12
  topology:
    variables:
      - name: controller_flavor
        value: "SCS-2V-4-50"
      - name: worker_flavor
        value: "SCS-2V-4-50"
      - name: external_id
        value: "ebfe5546-f09f-4f42-ab54-094e457d42ec" # ext01
      # kube-vip
      - name: apiserver_public_ip
        value: 213.131.230.131
      - name: apiserver_virtual_ip
        value: 192.0.2.96
      - name: network_id
        value: 05940077-55c1-4a48-83be-80564f8c0fdc
      # yawol
      - name: yawol_flavor_id
        value: 0a79590e-10d7-4c2c-8f69-ca0a2c6208d2 # SCS-1V-2-5
      - name: yawol_image_id
        value: f0b2ef46-f0ff-43d2-9c08-f58a5a6e9060 # yawol-alpine-yawol-controller-0.21.3-5-g2a2b2f9
    class: openstack-wooctavia-1-27-v1
    controlPlane:
      replicas: 3
    version: v1.27.12
    workers:
      machineDeployments:
        - class: openstack-wooctavia-1-27-v1
          failureDomain: nova
          name: wooctavia
          replicas: 3

Until the CSO has a new release with SovereignCloudStack/cluster-stack-operator#130, apply yawol CRDs into the workload cluster:

kubectl --kubeconfig kubeconfig.yaml apply -f \
https://raw.githubusercontent.com/stackitcloud/yawol/yawol-controller-0.21.3/charts/yawol-controller/crds/yawol.stackit.cloud_loadbalancermachines.yaml,\
https://raw.githubusercontent.com/stackitcloud/yawol/yawol-controller-0.21.3/charts/yawol-controller/crds/yawol.stackit.cloud_loadbalancers.yaml,\
https://raw.githubusercontent.com/stackitcloud/yawol/yawol-controller-0.21.3/charts/yawol-controller/crds/yawol.stackit.cloud_loadbalancersets.yaml

Test yawol:

kubectl --kubeconfig kubeconfig.yaml create deploy --image nginx --port 80 nginx
kubectl --kubeconfig kubeconfig.yaml expose deployment nginx --port 80 --type LoadBalancer

Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

TODOs:

mxmxchere commented 4 months ago

lgtm so far, we just moved the csp-helper-chart to its own repository here: https://github.com/SovereignCloudStack/openstack-csp-helper/ csctl was not able to deal with the openstack-csp-helper releases so they had to be moved elsewhere.

mxmxchere commented 4 months ago

I included the openstack-helper-chart changes here: https://github.com/SovereignCloudStack/openstack-csp-helper/pull/1/files. The only additional changes were:

@chess-knight do you think that this version of the chart will work for the yawol clusterstack as well as for the alpha stack?

chess-knight commented 4 months ago

I included the openstack-helper-chart changes here: https://github.com/SovereignCloudStack/openstack-csp-helper/pull/1/files. The only additional changes were:

  • setting use-octavia depending on .Values.yawol
  • new location and latest tag used in README.md

@chess-knight do you think that this version of the chart will work for the yawol clusterstack as well as for the alpha stack?

I reviewed it. And yes, the chart should work for bot cluster stacks.

mxmxchere commented 4 months ago

thanks for the prompt review, very good. I will include it and release it.

jschoone commented 4 months ago

Hi @jklippel here is a first version of using yawol and kubevip with Cluster Stacks on Openstack, maybe this could be interesting for you?