Skip to content

Instantly share code, notes, and snippets.

@saiyam1814
Last active June 10, 2021 17:53
Show Gist options
  • Save saiyam1814/83c89150aa36f6966a7022e8d79a7abb to your computer and use it in GitHub Desktop.
Save saiyam1814/83c89150aa36f6966a7022e8d79a7abb to your computer and use it in GitHub Desktop.
giopsdays
# Fleet multi cluster setup
kubectl config view -o json --raw | jq -r '.clusters[].cluster["certificate-authority-data"]' | base64 -d > ca.pem
API_SERVER_URL="https://212.2.246.8:6443"
API_SERVER_CA="ca.pem"
helm -n fleet-system install --create-namespace --wait fleet-crd https://github.com/rancher/fleet/releases/download/v0.3.3/fleet-crd-0.3.3.tgz
helm -n fleet-system install --create-namespace --wait \
--set apiServerURL="${API_SERVER_URL}" \
--set-file apiServerCA="${API_SERVER_CA}" \
fleet https://github.com/rancher/fleet/releases/download/v0.3.3/fleet-0.3.3.tgz
kubectl -n fleet-system logs -l app=fleet-controller
kubectl -n fleet-system get pods -l app=fleet-controller
=========================================================
#Agent Registration toekn method
Run below on Fleet controller cluster
kubectl create ns clusters
kubectl apply -f token.yaml
kubectl -n clusters get secret new-token -o 'jsonpath={.data.values}' | base64 --decode > values.yaml
#Run below on Agent cluster
helm -n fleet-system install --create-namespace --wait \
--set-string labels.env=prod \
--values values.yaml \
fleet-agent https://github.com/rancher/fleet/releases/download/v0.3.3/fleet-agent-0.3.3.tgz
kubectl -n clusters get clusters.fleet.cattle.io
==========================================================
#Cluster group creation
kubectl create -f cg.yaml
kubectl get clustergroup -A
#Add git repo
kubectl apply -f repo.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment