Handling Secrets with SOPS

Installation using homebrew brew install sops manual download download from GitHub https://github.com/getsops/sops/releases Using SOPS Create a sops.yaml sops.yaml creation_rules: # encrypt stuff in .secrets - aws_profile: default kms: arn:aws:kms:eu-central-1:1234567890:key/abcdefg-0123456-abcdefg (1) path_regex: ^./secrets/.*$ (2) 1 We are using AWS KMS for encryption/decryption 2 All files in the directory .secrets will be encrypted Inplace Encrypt sops -e -i .secrets/mysecret.yaml Inplace Decrypt sops -d -i .secrets/mysecret.yaml Complete Example using PGP Install GPG and create a new Key Install the GPG binaries .Linux / apt sudo apt install gnupg ...

April 19, 2024 · 2 min · 308 words · Micha Kops

Quick Kafdrop Setup with Helm Charts

Figure 1. Kafdrop Topic Viewer In the ever-expanding world of data streaming and event-driven architecture, Apache Kafka has emerged as a cornerstone for reliable and scalable data processing. However, managing and monitoring Kafka clusters can often present its own set of challenges. This is where Kafdrop, a web-based Kafka consumer group and topic viewer, comes to the rescue. With its intuitive interface and insightful visualizations, Kafdrop offers developers and operators an efficient way to gain valuable insights into Kafka clusters. ...

August 10, 2023 · 2 min · 376 words · Micha Kops

Install Kubernetes Components - Kubeadm, Kubectl, Kubelet

Goals Install kubeadm, kubectl and kubelet on Debian-based Linux Freeze their versions to avoid automatic updates Installation curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - (1) cat << EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list (2) deb https://apt.kubernetes.io/ kubernetes-xenial main EOF sudo apt-get update (3) sudo apt-get install -y kubelet=1.15.7-00 kubeadm=1.15.7-00 kubectl=1.15.7-00 (4) sudo apt-mark hold kubelet kubeadm kubectl (5) 1 Add the GPG key 2 Add the kubernetes repo to the sources list 3 Update the index 4 Install kubelet, kubeadm and kubectl It’s important to use the same version for kubelet, kubeadm and kubectl. ...

May 14, 2021 · 1 min · 117 words · Micha Kops

Setting up a Kubernetes Master Node

Goals Setup a kubernetes master node on a Linux machine Setup Initialize the cluster on the master node sudo kubeadm init --pod-network-cidr=10.244.0.0/16 This might take a few minutes …​ afterward we set up our local kubeconfig: mkdir -p $HOME/.kube sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config sudo chown $(id -u):$(id -g) $HOME/.kube/config Verify the Cluster Setup Shows that the cluster is responding and kubectl working: kubectl version

May 14, 2021 · 1 min · 65 words · Micha Kops

Helm Snippets

Common operations Add Helm Repository helm repo add NAME URL e.g. for the Bitnami repository: helm repo add bitnami https://charts.bitnami.com/bitnami 1 ↵ "bitnami" has been added to your repositories List Repositories helm repo list 130 ↵ NAME URL bitnami https://charts.bitnami.com/bitnami Searching in a Helm Repository helm search repo wordpress NAME CHART VERSION APP VERSION DESCRIPTION bitnami/wordpress 15.2.30 6.1.1 WordPress is the world's most popular blogging ... bitnami/wordpress-intel 2.1.31 6.1.1 DEPRECATED WordPress for Intel is the most popu... ...

March 1, 2010 · 4 min · 697 words · Micha Kops

Java Snippets

Remote Debug a Pod’s Java Process Simple steps for remote debugging a Java process running on a k8 pod: Edit deployment and add the following parameters to the Java start line: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=127.0.0.1:5005 Also add the following port mapping at the section container → ports in the deployment: - containerPort: 5005 protocol: TCP Safe, wait for the new pods and then add a port forward for port 5005 for this pod: kubectl port-forward podname 5005 ...

March 1, 2010 · 13 min · 2583 words · Micha Kops

Kubernetes Snippets

Rerun existing completed Job kubectl replace deletes the old job, if there is any error, your job definition is lost, don’t forget to save it first! Replace an existing Job with itself kubectl get job JOBNAME -o yaml | kubectl replace --force -f - Sometimes there are errors importing the job template due to auto-generated labels or selectors .. a quick and dirty hack is to filter them out using jq ...

March 1, 2010 · 10 min · 1924 words · Micha Kops