Genpact Cora Knowledge Center


Set Up Kubernetes Environment


Kubernetes is a powerful container orchestration tool that automates container deployment, scaling, and management. It simplifies the process of managing containerized applications across different environments, and makes it easy to deploy and scale applications on-demand. It allows developers to deploy and manage containers across multiple hosts, and provides tools for managing container lifecycles, resource allocation, and scaling.

Procedure to set up a local environment for Kubernetes

  1. Install WSL.
    For details, see this link.
  2. Verify WSL installation.
    In command line (CMD) run, wsl --list --verbose.
  3. Install Rancher Desktop.
    For details, see this link
  4. Run Rancher Desktop and verify installation: 
    1. Verify Helm installation.
      In CMD run, helm version.
    2. Verify K8S installation.
      In CMD run, kubectl version --short.
  5. Create a namespace for the cluster.
    In CMD run, kubectl create namespace monitoring.
  6. Extract, and open it with CMD.
  7. Install cluster with Helm.
    In CMD run, helm install o11y . -n monitoring -f values.yaml.
  8. Verify cluster installation.
    In CMD run, kubectl get pod -A -n monitoring.
  9. Open Rancher Desktop Preferences:
    1. Right-click on Rancher icon, and then select Preferences.
    2. Go to Port Forwarding settings.
  10. Forward required ports in Rancher Desktop Port Forwarding.
    1. Find o11y-grafana and forward port to access Grafana.
    2. Find o11y-loki and forward port for Promtail agent.
    3. Find o11y-prometheus-server and forward port to access Prometheus.
    4. Find o11y-tempo grpc-tempo-otlp and forward port for OTEL Collector agent.
  11. Extract attached to C:\agents.
  12. Configure Promtail agent, open and edit C:\agents\promtail\config.yaml.
    1. Get port number from step 10.b.
    2. Get path to app logs from:
      Administration || Flowtime || JES || ADSS || BRS > Configuration\Logging\logging.sinks.json 
  13. Run Promtail agent. In CMD run, run.bat.
  14. Configure OTEL Collector agent. Open and edit C:\agents\otel\config.yaml.
    1. For the exporters section, get port number from step 10.d.
    2. For the receivers section, get port number from:
      Administration || Flowtime || JES || ADSS || BRS> Configuration\ Observability\ o11y.netfx.json.
  15. Run OTEL Collector agent.
    In CMD run, run.bat
  16. Access Grafana by navigating to http://localhost:XXXX in your web browser, where XXXX is the port number from step 10.a.
    • Default user: admin
    • Default password: admin 
  17. Access Prometheus by navigating to http://localhost:XXXX in your web browser, where XXXX is the port number from step 10.c.

Procedure to install a Kubernetes environment on a cluster

  1. In the GIT repository, create a new branch from dev for your deployment.
    You must create a branch with the following name convention:
    For each environment, the namespace is unique within the cluster.
    For example,users/alice/cora-qa
  2. Add, in the values.yaml file, all configuration details like database credential, database connection string, database provider, connection name, that are present in Azure Key Vault.
  3. Check the values.yaml file, if the parameters and variables are required to be changed.
    You can check the existing parameters and variables in the values.yaml file here.
  4. In repository, open the code in any IDE (VS is recommended).
    For example, ":users/alice/cora-qa" branch.
  5. Push your changes to the GIT repository. (Or from CMD or IDE).
    The applications are deployed to the cluster automatically.
  6. Wait for a few minutes for pipeline to finish deployment of applications in the cluster.
  7. Check the cluster with the namespace. For example, namespace is cora-qa in our case here.
  8. Create an all-web application, run https://<namespace>-<name application>
    For example, to create namespace cora-qa, run the following:
  9. Check if the status of all the applications is running.
    In CMD, run kubectl get pod -n cora-qa.
    Or check in one of UI Kubernetes IDE.
    For update configuration you need to change variable or parameters in the values.yaml file, and push the same to GIT repository and running pipeline. 
  10. For new version create new branch.