- PiB includes
GitOps Automationthat usescluster metadatafor targeted deployments - In this lab we will
- Create the GitOps structure for 15 clusters
- Add
ringmetadata to each cluster - Add targets based on cluster metadata
Note: we don't actually create the clusters, just the GitOps folders
# start in the base of the repo
cd $PIB_BASE
flt create \
--gitops-only \
-g $MY_BRANCH-fleet \
-c central-tx-atx-101 \
-c central-tx-dal-101 \
-c central-tx-hou-101 \
-c central-tx-ftw-101 \
-c central-tx-san-101 \
-c east-ga-atl-101 \
-c east-fl-mia-101 \
-c east-al-bham-101 \
-c east-ms-bil-101 \
-c east-nc-clt-101 \
-c west-wa-sea-101 \
-c west-nv-lv-101 \
-c west-ca-sd-101 \
-c west-or-pdx-101 \
-c west-mt-bose-101
ls -alF clusters/*.yaml
cat clusters/central-tx-atx-101.yaml
-
flt creategenerates GitOps files for the cluster -
CI-CD generates the deployment manifests
- Wait for CI-CD to complete (usually about 30 seconds)
# update the git repo after ci-cd completes git pull
echo "ring: 0" >> clusters/central-tx-atx-101.yaml
echo "ring: 1" >> clusters/central-tx-dal-101.yaml
echo "ring: 2" >> clusters/central-tx-ftw-101.yaml
echo "ring: 3" >> clusters/central-tx-hou-101.yaml
echo "ring: 4" >> clusters/central-tx-san-101.yaml
echo "ring: 0" >> clusters/east-al-bham-101.yaml
echo "ring: 1" >> clusters/east-fl-mia-101.yaml
echo "ring: 2" >> clusters/east-ga-atl-101.yaml
echo "ring: 3" >> clusters/east-ms-bil-101.yaml
echo "ring: 4" >> clusters/east-nc-clt-101.yaml
echo "ring: 0" >> clusters/west-ca-sd-101.yaml
echo "ring: 1" >> clusters/west-mt-bose-101.yaml
echo "ring: 2" >> clusters/west-nv-lv-101.yaml
echo "ring: 3" >> clusters/west-or-pdx-101.yaml
echo "ring: 4" >> clusters/west-wa-sea-101.yaml
git add clusters
cd $PIB_BASE/apps/imdb
flt targets clear
flt targets add ring:0
flt targets deploy
# wait for ci-cd to finish
git pull
cd $PIB_BASE/apps/imdb
flt targets add ring:1
flt targets deploy
# wait for ci-cd to finish
git pull
cd $PIB_BASE/apps/imdb
flt targets add region:central
flt targets deploy
# wait for ci-cd to finish
git pull
- Once you are finished with the workshop, you can delete your GitOps resources
# start in the base of the repo
cd $PIB_BASE
git pull
# restore the clusters dir from main
git restore -s main clusters
git add .
# clear imdb targets
cd apps/imdb
flt targets clear
# clear dogs-cats targets
cd ../dogs-cats
flt targets clear
# push changes
flt targets deploy
cd ../..