Get Started with Kurator Fleet

The easiest way to manage multi clusters with fleet manager.

In this tutorial we’ll cover the basics of how to use Fleet to manage a group of clusters.

Prerequisites

Now fleet manager can manage clusters either created using kurator Cluster API or prebuilt AttachedCluster.

Please refer to Get started with Kurator Cluster API to create a vanilla kubernetes cluster.

Create a Fleet

Here in this example, we create a fleet with a cluster provisioned with kurator cluster operator. If you want to manage a prebuilt cluster, please refer to Manage AttachedCluster.

Apply the fleet manifest

kubectl apply -f examples/fleet/fleet.yaml

After a while, we can see the fleet turns ready, the fleet has one cluster quickstart registered successfully.

$ kubectl get fleet quickstart -n test -oyaml
apiVersion: fleet.kurator.dev/v1alpha1
kind: Fleet
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"fleet.kurator.dev/v1alpha1","kind":"Fleet","metadata":{"annotations":{},"name":"quickstart","namespace":"test"},"spec":{"clusters":[{"name":"quickstart"}]}}
  creationTimestamp: "2023-04-10T02:24:12Z"
  finalizers:
  - fleet.kurator.dev
  generation: 1
  name: quickstart
  namespace: test
  resourceVersion: "6317753"
  uid: 5483c4d2-0ccf-48f8-afae-945b18dac8d9
spec:
  clusters:
  - name: quickstart
status:
  credentialSecret: kubeconfig
  phase: Ready
  readyClusters: 1

Cleanup

Delete the fleet created

kubectl delete fleet quickstart

Uninstall fleet manager:

helm uninstall kurator-fleet-manager -n kurator-system

IMPORTANT: In order to ensure a proper cleanup of your infrastructure you must always delete the cluster object. Deleting the entire cluster template with kubectl delete -f capi-quickstart.yaml might lead to pending resources to be cleaned up manually.

kubectl delete cluster --all

Uninstall cluster operator:

helm uninstall kurator-cluster-operator -n kurator-system

Optional, clean CRDs:

kubectl delete crd $(kubectl get crds | grep cluster.x-k8s.io | awk '{print $1}')
kubectl delete crd $(kubectl get crds | grep kurator.dev | awk '{print $1}')

Optional, delete namespace:

kubectl delete ns kurator-system

Optional, unintall cert manager:

helm uninstall -n cert-manager cert-manager

Optional, shutdown cluster:

kind delete cluster --name kurator