Keyboard Time: 10 mins, Automation Wait Time: 5 mins
Scenarios: Instructor-Led, Self-Paced
Configure the Kubernetes Agent to monitor the CI constructed kubernetes manifests.
Observe the initial deployment of staging and production via tailing the Kubernetes Agent log and the appearance of the target environments.
For instructor-led classes, this portion will be done by the instructor.
If you are not in an instructor-led course, perform the lab as described.
Logon the cluster administration machine => Instructions for SSM Session Manager for EKS
Run the following command to tail the kubernetes agent log while deployments are happening:
kubectl logs -f -l=app=gitlab-agent -n gitlab-agent
Leave this view open as you will be instructed to consult it to see the deployment logging activity when the GItLab Agent pulls and processes the kubernetes manifest.
In a web browser Navigate to classgroup/cluster-management
Near the upper right of the page, Click Web IDE (button)
Navigate to the file .gitlab/agents/spotazuseast2-agent/config.yml
Add the following to the file only once:
gitops:
manifest_projects:
Under “gitops:manifest_projects:” add as below - replacing _classgroup_
and _yourpersonalgroup_
with the actual names for your project. Ensure indenting and “gitops:manifest_projects” should only appear once in the entire file.
For Instructors: add one of these sections per participant. Ensure indentation is perserved.
- id: _classgroup_/_yourpersonalgroup_/world-greetings-env-1
default_namespace: default
paths:
- glob: '/manifests/**/*.yaml'
reconcile_timeout: 3600s # 1 hour by default
dry_run_strategy: none # 'none' by default
prune: true # enabled by default
prune_timeout: 360s # 1 hour by default
prune_propagation_policy: foreground # 'foreground' by default
inventory_policy: must_match # 'must_match' by default
Final result should be something like this (including indentation - with repeating “id” sections for each participant if in a classroom):
gitops:
manifest_projects:
- id: _classgroup_/_yourpersonalgroup_/world-greetings-env-1
default_namespace: default
paths:
- glob: '/manifests/**/*.yaml'
reconcile_timeout: 3600s # 1 hour by default
dry_run_strategy: none # 'none' by default
prune: true # enabled by default
prune_timeout: 360s # 1 hour by default
prune_propagation_policy: foreground # 'foreground' by default
inventory_policy: must_match # 'must_match' by default
Click Create commit…
Select Commit to master branch (change from “Create a new branch”)
Click Commit
Watch the previously opened view of the GitLab Agent log for deployment activity.
For Instructor-Led: the instructor may have this view displayed for everyone
To watch the progress, navigate to classgroup/yourpersonalgroup/world-greetings-env-1
Click Deployments => Environments
[Automation wait: ~3 min] Keep refreshing until staging deployment activities complete.
[Automation wait: ~3 min] Wait after the status shows complete…
On the ‘staging’ line, to the right, Click Open
You can see the staging deployed application.
In the browser tabs, Click [the tab with the Environments page]
On the ‘production’ line, to the right, Click Open
You can see the production deployed application
If there an error indicating there is no site yet, keep refreshing the browser window until the site displays.
Configure the Kubernetes Agent to monitor the CI constructed kubernetes manifests.
Observe the initial deployment of staging and production via tailing the Kubernetes Agent log and the appearance of the target environments.