Tag Archives: kubernetes

Docker and Kubernetes basics for developers

Docker Docker containers are much more lightweight compared to classic VMs as they leverage host OS instead of starting their own OS. Containers are using 2 features of Linux-based OS: Namespaces and Cgroups (Control Groups). Namespace Lets you allocate resources in an isolated environment (like a sandbox). On a container start, docker daemon generates a …

Read more

Using tcpdump for k8s pods

You need wireshark to be installed on your local machine — download (more on this below). If you don’t have tcpdump installed inside the pod, you can install it with

Then, on your local machine:

If you want to see packets in grpc/http2, you can add a rule in Wireshark. For this, click …

Read more

Forward multiple kubernetes pods for local development

kubefwd is a great tool that can forward a lot of pods at once to your local machine. The only downside for me is that it touches your local /etc/hosts. That’s how I use it:

It does not have huge documentation, but it is written in golang, and you can check how the source …

Read more

How to update your k8s pod limits

Then search for memory (for instance) and update request/limit for it. When you quit, it will be saved automatically for you.

Port forwarding with kubectl

If you want some kubernetes pod to forward all the traffic to you local machine, you can do this: 1. get pod id with

2. forward exact port from it to you localhost with

And you can request you localhost to reach pod on selected port.

Kubernetes’ cronjobs

That’s what it is — https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/ Get all cronjobs in env:

Get info on exact cronjob:

Get pods with this cronjob:

Get logs of cronjob

you can add -f for live updating logs and -p for watching logs of previous pod.

Kubectl helpful commands

k8s cheatsheet. Get all pods by label

Exec into the pod

Port forwarding

Getting logs

Get replica limits from configs:

Remove pod from load balancing to debug startup errors:

Scale (up/down) pods:

More commands here: https://kubernetes.io/docs/reference/kubectl/overview/ https://kubernetes.io/docs/reference/kubectl/cheatsheet/