Revo Docs

Kubernetes

Original document

Installation

Install gcloud sdk . Make sure kubectl is installed too.

gcloud components list.
Copied!

Login to gcloud .

gcloud auth login.
Copied!

It will open the browser, where you need to login with revo user, then get back to the terminal.

Install kubectl .

gcloud components install kubectl
Copied!

Sandbox

Select the default project
Generate the config to connect with kubectl (This step just need to be done one time)
Test you can connect

gcloud config set project smb-sandbox-3128887222.
gcloud container clusters get-credentials smb-sandbox-gke --region europe-west1-b
kubectl get namespaces
Copied!

Pre

Select the default project
Generate the config to connect with kubectl (This step just need to be done one time)
Test you can connect

gcloud config set project smb-pre-1500772851
gcloud container clusters get-credentials smb-pre-gke --region europe-west1-b
kubectl get namespaces
Copied!

Pro

Select the default project
Generate the config to connect with kubectl (This step just need to be done one time)
Test you can connect

gcloud config set project smb-prod-1062679862
gcloud container clusters get-credentials smb-prod-gke --region europe-west1-b
kubectl get namespaces
Copied!

Pro XEF

Select the default project
Generate the config to connect with kubectl (This step just need to be done one time)
Test you can connect

gcloud config set project smb-prod-1062679862
gcloud container clusters get-credentials xef-smb-prod-gke --region europe-west1
kubectl config rename-context gke_smb-prod-1062679862_europe-west1_xef-smb-prod-gke xef-smb-prod-gke
Copied!

Verify you can access

Select the context

kubectl config use-context  gke_smb-sandbox-3128887222_europe-west1-b_smb-sandbox-gke
Copied!

Sett the context you have access

kubectl config get-contexts
Copied!

K9S

This is a tool to connect ot kubernetes from the terminal. Install it with:

brew install derailed/k9s/k9s
Copied!

Basic k9s actions

#Canviar context
:context

#Escollir el context
#Si no es veuen els pods pitjar
0

# Veure pods
:pods

# Veure namespaces
:namespace

# Veure deploys
:deploy

# Si es vol es pot escalar el nombre de deploys posant-se sobre deploy i pitjant

# Buscar pods en concret
/

# Conectar a DB
# Redirigir el port des de k9s
Shift + f

# Consultar logs
# Des de console.cloud.google.com
# Des de k9s

#Entrar a pod i pitjar
l

# Entrar a la shell del pod (posar-t'hi a sobre)
s
Copied!