Commands for On-Prem

Introduction
This article walks you through common commands for On-Prem.

Commands
Note: Variables are enclosed in <> brackets

  • Get mongo password:

    • kubectl get secret -n <namespace> mongodb-replicaset-chart -o jsonpath={.data.mongodb-root-password} | base64 --decode | awk '{print $1}'
  • Shell into mongo:

    • kubectl exec -it mongodb-replicaset-chart-0 -n <namespace> -- /bin/sh
    • If the mongo replica is Secondary try mongodb-replicaset-chart-1 or mongodb-replicaset-chart-2, If Primary, continue to use admin
    • db.auth('admin', <password>)
  • Shell into Timescale:

    • kubectl exec -it harness-timescale-0 -n <namespace> -- /bin/sh (pod name might differ)
    • psql -U postgres
    • enter password
  • Shell into postgres:

    • kubectl exec --stdin --tty postgres-0 -n <namespace> -- /opt/bitnami/scripts/postgresql/entrypoint.sh /bin/bash
2 Likes