Skip to content
jorgesanchezperez edited this page Jul 23, 2020 · 5 revisions

Tricks

Docker desktop resources (MACOs)

  • CPUs: 6
  • Memory: 8.00 GB
  • Swap: 1.5 GB
  • Disk image size: 59.6 GB

Docker cluster access

To acces a service in a cluster

Connect to pod service

  1. Change the k8s context to the cluster context
    gcloud container clusters get-credentials [cluster-name] --zone europe-west4 --project [GC project]
  2. Set the port forward to the cluster
    kubectl port-forward pod/[POD_NAME] [PORT]

Connect to mongo

  1. Change the k8s context to the cluster context
    gcloud container clusters get-credentials master_dev --zone europe-west4 --project openbanking-214714
  2. Set the port forward to the cluster
    kubectl port-forward pod/mongo-mongodb-primary-0 27017

    Now you can access to mongo service deployed in the cluster on localhost:27017

Clean docker images

docker stop $(docker ps -a -q) && docker rm -f $(docker ps -a -q) && docker rmi -f $(docker images -q)

Dangling images

docker images -f "dangling=true" -q