Request Kube API with curl within a pod

Today we will see how to request Kubernetes API from within a pod in the cluster. I assume you already have a kubernetes cluster deployed somewhere. On my side, I will spin a sandbox cluster on my PC with k3d. nginx deployment For the purpose of this blog post, I will create a nginx deployment in my sandbox cluster: kubectl create deploy --image=nginx nginx create a dedicated serviceAccount and RBAC Most of the time, you will get a 403 Forbidden response if you try to request the KubeAPI from within the cluster....

<span title='2022-10-31 00:00:01 +0000 UTC'>October 31, 2022</span>&nbsp;·&nbsp;6 min&nbsp;·&nbsp;JC

Filter Kubernetes objects by annotation with kubectl

The problem kubectl has a decent mechanism for querying kubernetes objects by label but sometimes you will need to get pods, services, or anything else by querying their annotation. Some dudes asked for annotation query support here but it is not planned at the moment: You cannot query annotations in Kubernetes, and this will not change in the foreseeable future. To achieve that, you will find on the internet a way to achieve that with jsonpath....

<span title='2022-10-19 00:00:01 +0000 UTC'>October 19, 2022</span>&nbsp;·&nbsp;4 min&nbsp;·&nbsp;JC

Paste a predefined text via a keyboard shortcut

The aim of this tip is to have a keyboard shortcut to quickly configure my favorite kubectl aliases for the CKA exam :-) Install xdotool and xsel sudo apt install xdotool xsel Add this keyboard shortcut (In Gnome: Settings > Keyboard > Customize Shortcuts > Custom Shortcut) /bin/bash -c 'echo -n "source <(kubectl completion bash) && alias k=kubectl && complete -F __start_kubectl k && alias kgp=\"kubectl get pods\"" | xsel && xdotool click 2' Source: https://askubuntu....

<span title='2021-03-25 21:24:02 +0000 UTC'>March 25, 2021</span>&nbsp;·&nbsp;1 min&nbsp;·&nbsp;JC

Helm cheatsheet

helm is a kind of apt-get for kubernetes. As tiller poses a potential security threat, we will focus here on helm v3, the current stable release. With helm v2, you had to install tiller component in the kube-system namespace of your cluster, then have to add a RBAC account, as explained here. Ressources: https://helm.sh https://v3.helm.sh https://helm.sh/docs/using_helm/ https://v3.helm.sh/docs/intro/quickstart/ Installation Just download from Github Helm Releases and put the helm binary in one of your PATH’s folder....

<span title='2021-02-14 16:10:02 +0000 UTC'>February 14, 2021</span>&nbsp;·&nbsp;2 min&nbsp;·&nbsp;JC