Skip to content

Instantly share code, notes, and snippets.

@agracey
Created March 19, 2025 17:23
Show Gist options
  • Save agracey/6a89509f234f0f8f0711ed42966136cd to your computer and use it in GitHub Desktop.
Save agracey/6a89509f234f0f8f0711ed42966136cd to your computer and use it in GitHub Desktop.
Fleet Example
#!/bin/bash
# You can definitely add labels when creating a cluster in Rancher and everything just works
# but if you want to change the groupings in the future, you can use `kubectl label`:
kubectl label cluster.fleet.cattle.io -n fleet-default $CLUSTER_NAME $KEY=$VAL
apiVersion: fleet.cattle.io/v1alpha1
kind: ClusterGroup
metadata:
name: longhorn-stable
namespace: fleet-default
spec:
selector:
matchExpressions: []
matchLabels:
longhorn: stable
apiVersion: fleet.cattle.io/v1alpha1
kind: GitRepo
metadata:
name: longhorn-crds
namespace: fleet-default
spec:
repo: https://github.com/suse-edge/fleet-examples.git
branch: main
paths:
- /fleets/general/longhorn/longhorn-crd
targets:
- clusterGroup: longhorn-stable
---
apiVersion: fleet.cattle.io/v1alpha1
kind: GitRepo
metadata:
name: longhorn
namespace: fleet-default
spec:
repo: https://github.com/suse-edge/fleet-examples.git
branch: main
paths:
- /fleets/general/longhorn/longhorn
targets:
- clusterGroup: longhorn-stable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment