This lab is a prerequisite for the Kustomization and GitOps labs
- Application teams need to deploy their applicatons to specific clusters
- The
Groups
,Namespaces
, andApplications
are objects in the Res-Edge Data Service - Res-Edge provides
GitOps Automation
to merge the objects viaGitOps
(Flux)
In this lab, we will assign the
stores Group
to thedogs-cats Namespace
which will result in the dogs-cats Namespace and Application being deployed to all 12 clusters via GitOps
- The Res-Edge Data Service needs to be deployed for this lab
- Go to Deploy Res-Edge Data Service lab to deploy the data service to the cluster
# start in the repo base directory
cd "$KIC_BASE"
# Warning: this will delete any existing data changes and they are not recoverable
ds reload --force
# run ci-cd locally
ds cicd
# deploy the clusters directory changes
ds deploy
ds check resedge
-
Get the Stores Group Id
- The ds command will return 3
ds search groups --query stores
-
Get the dogs-cats Id
- The ds command will return 4
- It is coincidental that the Ids are the same
ds search namespaces --query dogs-cats
- The ds command will return 4
-
Use curl to assign the Group to the Namespace
- You can use the Swagger UI as well
- From the
ports
tab, openRes-Edge (32080)
- Navigate to the Namespaces Section
- Click on
Patch
- Click on
Try it out
- From the
# assign the stores Group to the Namespace # command will return a 200 ds update namespace --id 4 --expression /g/stores
- You can use the Swagger UI as well
-
Verify the Group was added to the Namespace
ds show namespace --id 4 | grep expression
-
Output should look like this
"expression": "/g/stores",
-
Run cicd locally to verify changes
ds cicd
-
Check the status with git
git status clusters
-
Results
- 3 files will be added to each cluster
- The dogs-cats Namespace
- The dogs-cats Application
- The
Flux listener
for GitOps
- 3 files will be added to each cluster
-
Commit the changes and push to the repo
ds deploy
- Assign the following Groups to the tabs-spaces Namespace
- beta
- pilot
# assign the Groups to the Namespace
ds update namespace --id 5 --expression '/g/beta or /g/pilot'
-
Verify the Groups were added to the Namespace
ds show namespace --id 5 | grep expression
-
Run cicd locally to verify changes
ds cicd
-
Check the status with git
git status clusters
-
Results
- 6 clusters will have the tabs-spaces Namespace
-
Remove Groups from Namespaces
# unassign Groups from dog-cats and tabs-spaces Namespaces ds update namespace --id 4 --expression none ds update namespace --id 5 --expression none # run ci-cd locally ds cicd # no files should be dirty git status clusters
- The next lab demonstrates ring deployment using Res-Edge and Kustomize
- Go to the Ring Deployment with Kustomize lab