Skip to content

Fleet Plan Template

This is a ready-to-use Fleet Plan template. You can customize it by changing details such as the project name and Fleet Plan name according to your requirements.

This Fleet Plan is designed for a scenario where users intend to upgrade from Kubernetes version 1.23 to 1.24. It includes the following prehooks and an action:

  1. Check for Deprecated APIs: This step ensures that the cluster is compatible with the new version by checking for any APIs that have been deprecated.

  2. Check for Docker Socket Mounts: This step checks if any applications in the cluster are using Docker socket mounts. Dockershim, which was used to support Docker socket mounts, has been removed in 1.24. So, if any applications are using Docker socket mounts, they will need to be updated before upgrading to 1.24.

  3. Cluster Upgrade Action: Once the above prechecks have passed, the action for cluster upgrade will be triggered to start upgrading the fleet of the cluster to the required Kubernetes version (1.24 in this case).

Detection Tools

The Fleet Plan uses an open-source tool called 'Detector for Docker Socket' to detect Docker socket mounts. It's a reliable tool that can help you identify pods using Docker socket mounts, along with 'kube-no-trouble' and 'kubepug,' both open-source and famous tools, to detect deprecated Kubernetes APIs.

EKS Upgrade Fleet Plan

To customize the configuration to match your environment, follow below step:

  1. Update the project field with the name of your project.
kind: FleetPlan
apiVersion: infra.k8smgmt.io/v3
metadata:
  name: eks-fleet1-plan-1-23
  project: demofleet
spec:
  fleet:
    kind: clusters
    labels:
      rafay.dev/clusterType: aws-eks
      rafay.dev/k8sVersion: '1.23'
    projects:
      - name: demofleet
  operationWorkflow:
    operations:
      - name: eks-1-23-plan
        prehooks:
          - name: deprecated-api-check
            description: Deprecated APIs Check
            inject:
              - KUBECONFIG
            containerConfig:
              runner:
                type: cluster
              image: ghcr.io/doitintl/kube-no-trouble:latest
              arguments:
                - '-o'
                - json
                - '-e'
              cpuLimitMilli: '4'
              memoryLimitMb: '100'
            timeoutSeconds: 60
          - name: pre-upgrade-checker
            description: >-
              deprecated API's and will verify the current context against
              v1.24.15  version
            inject:
              - KUBECONFIG
            containerConfig:
              runner:
                type: cluster
              image: ctadeu/kubepug:latest
              arguments:
                - '--k8s-version=v1.24.15'
              cpuLimitMilli: '4'
              memoryLimitMb: '100'
            timeoutSeconds: 60
          - name: docker-socket-detector-check
            description: ''
            inject:
              - KUBECONFIG
            containerConfig:
              runner:
                type: cluster
              image: registry.rafay-edge.net/rafay/dockersocketdetector:v1
              arguments:
                - '-e'
              cpuLimitMilli: '4'
              memoryLimitMb: '100'
            timeoutSeconds: 100
        action:
          type: nodeGroupsAndControlPlaneUpgrade
          description: upgrade to 1.24
          name: eks-cluster-upgrade
          nodeGroupsAndControlPlaneUpgradeConfig:
            version: '1.24'

To run and execute the fleet plan, please use the following command:

./rctl apply -f eks-1-123-upgrade-plan.yaml

To retrieve the details of the job created by the above command, use the following command:

./rctl getjobs fleetplan <fleetplan name>

Failure due to Deprecated APIs

If the prehooks encounter any deprecated APIs during execution, the screen will display error messages similar to the following:

Fleet Plan Failure UI

This is an example of an upgrade plan for EKS. Additionally, there is another example for a blueprint upgrade in the GitHub repository. To access these examples, please clone the repository and refer to the /getstarted/fleet-plan/eks folder available at the following link:

GitHub Repository