Know Your Lab Environment
🎬 Watch Before You Begin
🧭 Video Timeline
In this video, you’ll see the lab architecture, GCP resources, Cloud Shell setup, Headlamp dashboard, and how to use log explorer / analytics.
-
[00:08]
Walkthrough lab architecture diagram / GCP resources - Load balancer, Kubernetes cluster, Namespace, Headlamp etc
-
[02:30]
Syncronise required scripts to run the labs via Cloud Shell
-
[05:20]
Access to Kubernetes Dashboard via Headlamp
-
[08:10]
Access to GCP Log Explorer / Analytics - to view logs throughout the install steps
-
[08:45]
Video ends
In this video, you’ll see the lab architecture, GCP resources, Cloud Shell setup, Headlamp dashboard, and how to use log explorer / analytics.
-
[00:08]
Walkthrough lab architecture diagram / GCP resources - Load balancer, Kubernetes cluster, Namespace, Headlamp etc -
[02:30]
Syncronise required scripts to run the labs via Cloud Shell -
[05:20]
Access to Kubernetes Dashboard via Headlamp -
[08:10]
Access to GCP Log Explorer / Analytics - to view logs throughout the install steps -
[08:45]
Video ends
Now that onboarding is complete, let's review how the Lab Environment is setup.
There are two broad aspects to the lab environment.
-
a. Preconfigured setup
To ensure a smooth execution of labs, there are a few preconfigured items for each participant (such as external access, network plumbing, etc). We will not go into the details of these, as they are outside the scope of this exercise.
Note: Cloudflare manages the lab domain setup and external network traffic. -
b. GCP Resources: GKE Cluster and Cloud Shell
The core of the labs exercise centers around the Kubernetes cluster.
Kubernetes Engine cluster{{CLUSTER_NAME}}is provisioned with required network configuration, storage and compute capacity.
GCP project{{PROJECT_ID}}hosts this GKE cluster and all other associated preconfigurations.
-
Each participant will have access to a dedicated namespace
(such as
jon-doe-gmail-com-c8-labs) to deploy Camunda self-managed app components. - The lab instructions are primarily executed via GCP Cloud Shell. Please run all lab commands from within a single Cloud Shell terminal session.
Physical Setup
Here is a summary of the physical environment. (diagram below)
- The Camunda app stack will be deployed to a specific namespace (participant specific) and consists of multiple containers
- The containers run on one of the VM nodes.
- VM nodes are running within any of the zones pertaining to a region.
- End users access the Camunda app via Cloudflare managed domain. Example:
https://jon-doe-gmail-com-c8-labs.makelabs.in
Click on image to enlarge
GCP Cloud Shell: Sync GitHub project
Let's begin our work by launching a new GCP Cloud Shell.
From this point on, all commands are executed in the Cloud Shell.
For convenience, you can use the Copy button to paste a logically grouped set of commands into Cloud Shell, or, if you prefer a slower pace with attention to detail, copy and run each command line by line.
The scripts associated with this program are available in the GitHub repository.
Let's clone the Git repository to your GCP Cloud Shell.
Important: # Start from your home directory in Cloud Shell terminal window.
gcloud config set project c8-labs
git clone https://github.com/rchari-ml/c86-mini.git
cd c86-mini
git checkout c8-labs-swati
git fetch origin
git pull origin c8-labs-swati
gcloud components install gke-gcloud-auth-plugin
gke-gcloud-auth-plugin --version
gcloud container clusters get-credentials {{CLUSTER_NAME}} --region {{REGION}} --project c8-labs
!!! Note: If you see any errors such as below, please ignore the same. You may continue with the steps.
HTTP request failed after retries: response_data={'error': {'code': 404, 'message': 'Account not found for email: some-hash-code|user-email-address', 'status': 'NOT_FOUND'}}, retryable_error=False
Post Command-Set Execution: Click to view screen shot - Cloud Shell init success with k8s cluster.
Click on image to enlarge
Kubernetes Dashboard for Resources Visualisation
Headlamp provides a web-based interface for visualizing and managing Kubernetes resources. During the labs, you'll use it to explore namespaces, workloads, services, pods, and other Kubernetes objects.
The webapp requires a token for user authentication. Use the command below to generate the token.
export UNAMESPACE={{UNAMESPACE}}
kubectl create token headlamp-svc-acct -n ${UNAMESPACE}
- Open in a new tab: Kubernetes Dashboard
-
Click on
Cluster Settings=> Add your namespace underAllowed namespaces -
Return to login page (click on
Go to Cluster) - Copy-paste the token from the previous step and submit.
-
You are now on home page of Headlamp.
Click on Clusters main => Namespaces list => click on your namespace
Expected Result: Your namespace shows statusActive
Post Command-Set Execution (a): Click to view screen shot - Headlamp Sign In
Click on image to enlarge
Post Command-Set Execution (b): Click to view screen shot - Headlamp kubeconfig - Add your namespace.
Click on image to enlarge
Post Command-Set Execution (c): Click to view screen shot - Headlamp kubeconfig - Namespace is active !!
Click on image to enlarge
Observability / Log Analytics
# Use this as a starting point and customise your query based on the debug scenario
https://console.cloud.google.com/logs/query;query=severity%3E%3DDEFAULT;storageScope=storage,projects%2F{{PROJECT_ID}}%2Flocations%2Fasia-south2%2Fbuckets%2Fc8-labs-training%2Fviews%2F_AllLogs;query=resource.type%3D%22k8s_container%22%0Aresource.labels.cluster_name%3D%22{{CLUSTER_NAME}}%22%0Aresource.labels.namespace_name%3D%22{{UNAMESPACE}}%22%0Aseverity%3E%3DDEFAULT;cursorTimestamp={{TODAY_TIMESTAMP}};duration=PT30M?project={{PROJECT_ID}}