Browsed by
Category: k8s

Executing into k8s pod (kubernetes)

Executing into k8s pod (kubernetes)

Today I am going to save here this command. It’s very simple although I cannot remember it!

15/10/2021 – UDPATE Because I was lazy to remember it, I wrote bash function which does most of the job instead of me. It takes one argument which is pod name and I stored in my .bashrc so it’s available everythere together with my bash.

Links: https://kubernetes.io/docs/tasks/debug-application-cluster/get-shell-running-container/

Kubernetes and Sealed Secrets (Kubernetes)

Kubernetes and Sealed Secrets (Kubernetes)

PROBLEM: I would like to share my secrets to git SOLUTION: Use the Sealed Secretes (Installing kubeseal) Kubeseal is the CLI tool to manage sealed secret, is you are using macOS, you should use brew:

On (ubuntu based) linux you should be fine using:

Creating a secret There are different ways how to create a secret, I am using direct input (–from-literal) or direct YAML efinition. I will show both. Let’s assume I am deploying some application which will…

Read More Read More

Ports in Kubernetes Services (Kubernetes)

Ports in Kubernetes Services (Kubernetes)

Just a quick reminder how ports definition in k8s services works. Service definition example below, just forgot all but port definition and take a closer look. NodePort

We can see port definition 3 times (it’s array and you can use as many of them as open ports you need): port, targetPort and nodePort. Why 3 ports? If you are familiar with Docker (Swarm) you would expect only 2, right…? NodePort port : other pod/service inside our cluster can access…

Read More Read More

Port forward to access applications in cluster (Kubernetes)

Port forward to access applications in cluster (Kubernetes)

PROBLEM: Cannot access pods in my k8s deployment for testing SOLUTION: Use very simple port-forward method Find your destination Decide what do you want to access. Port forward works on services, pods, deployments or even replicaSets. The syntax is very simple.

Which leads to example like this:

You can see your app through port 1000 on your local machine (working on the port 3000 on remote). Bear in mind, you are connecting directly to the service/pod/whatever, so use the…

Read More Read More