k0sproject / k0smotron

k0smotron
https://docs.k0smotron.io/
Other
489 stars 45 forks source link

Check and support upgrades #426

Open makhov opened 9 months ago

makhov commented 9 months ago

Check, and if needed, support k0s version updates for RemoteMachine's and other k0smotron scenarios

nekwar commented 8 months ago

Current sequence of actions that need to be performed in order to upgrade child k0s cluster with k0smotron as Control Plane Bootstrap provider:

  1. Create configmap with Autopilot's Plan with controllers only as targets. Example:
    apiVersion: v1
    kind: ConfigMap
    metadata:
    name: example-cluster-autopilot-plan
    namespace: default
    data:
    data: |
    apiVersion: autopilot.k0sproject.io/v1beta2
    kind: Plan
    metadata:
      name: autopilot
    spec:
      id: id1234
      timestamp: now
      commands:
        - k0supdate:
            version: v1.29.1+k0s.1
            platforms:
              linux-amd64:
                url: https://github.com/k0sproject/k0s/releases/download/v1.29.1+k0s.1/k0s-v1.29.1+k0s.1-amd64
            targets:
              controllers:
                discovery:
                  selector: {}
  2. Add this configmap to ClusterResourceSet (the easiest way to do it is to use kubectl edit clusterresourceset <crs-name>)
  3. Wait for controllers to be upgraded
  4. Change version in spec.k0sVersion in K0sControlPlane resource (this needs to be done in order to new controllers, if there will be any, to have new k0s version)

Once controllers are upgraded, you can proceed with workers upgrade:

  1. Change k0s version in K0sWorkerConfigTemplate
  2. Change version in MachineDeployment

Issues, that need to be addressed