Skip to content

Lightkeeper tool

Raghavendra chandrashekar edited this page Aug 25, 2023 · 24 revisions

Prerequisite: You must be a member of the VA-ABD-RRD GitHub team

Followed Getting Started instructions and GETTING-STARTED page to install lightkeeper.

Developpment Environment Step:

  • Execute lightkeeper create clusterconfig nonprod > kube_config` on a GFE (a machine within the VA network).
  • Transfer kube_config from GFE to development laptop (where kubectl is installed) and save it as ~/.kube/config.
  • NOTE:- this config is for the nonprod cluster (containing dev, qa, and sandbox only )
  • For Prod cluster ( containing prod-test and prod), Execute lightkeeper create clusterconfig prod > kube_config`
  • see Development environments#LHDI for cluster info.
  • NOTE:- If you're switching between the two clusters, remember to use the right config file.

Remember to specify the namespace (e.g., --namespace va-abd-rrd-dev) for all kubectl commands, e.g.:

  • kubectl get pods --namespace va-abd-rrd-dev
  • helm list --namespace va-abd-rrd-dev

This config needs to be renewed every 90 days.

Be cautious when running commands as this may affect others using VRO in these environments, particularly in the prod-test and prod environments where PII/PHI and various secrets are visible.

Tip: For a nice GUI to monitor the status, try the Lens app.

Watch VRO logs

To follow the logs for the app container in the dev environment:

# Use the namespace corresponding to the dev environmentalias kc='kubectl -n va-abd-rrd-dev'

# List the pods; we want the vro-api pod with 7 containers in it
❯ kc get pods
NAME                                 READY   STATUS    RESTARTS      AGE
vro-api-7ff6569c78-jj9zk             7/7     Running   2 (17m ago)   22m
vro-api-postgres-7776cbd54f-wkf8r    1/1     Running   0             22m
vro-api-rabbit-mq-7ff55bcb5f-6rg46   1/1     Running   0             22m
vro-api-redis-555446854-ksgjt        1/1     Running   0             22m

# Follow the logs for the abd-vro-api in the vro-api pod
❯ kc logs -f vro-api-7ff6569c78-jj9zk -c abd-vro-api

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v2.7.4)

2022-11-18 18:47:11.835  INFO 1 --- [           main] gov.va.vro.VroApplication                : Starting VroApplication using Java 17.0.5 on vro-api-7ff6569c78-jj9zk with PID 1 (/project/vro-app.jar started by docker in /project)
2022-11-18 18:47:11.839  INFO 1 --- [           main] gov.va.vro.VroApplication                : The following 2 profiles are active: "compose", "dev"
2022-11-18 18:47:15.525  INFO 1 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
...

Machine user login (DevOPS - Step only ):

IMPORTANT:- This step is only for Automated GH workflows and GH Actions. Not for Development use.

Use this step to generate kubernettes config for both prod and non-prod clusters

lightkeeper create clusterconfig nonprod | base64 > DEV_KUBE_CONFIG
lightkeeper create clusterconfig prod | base64 > PROD_KUBE_CONFIG

IMPORTANT: Since the config expires in 90 days, the DEV_KUBE_CONFIG and PROD_KUBE_CONFIG in git GH Action secrets need to be updated regularly so that GitHub Action workflows that interact with LHDI continue to work.

Clone this wiki locally