Skip to content

Instantly share code, notes, and snippets.

View dejanu's full-sized avatar
💭
🎯 all things are subject to interpretation...even API keys

dejanualex dejanu

💭
🎯 all things are subject to interpretation...even API keys
View GitHub Profile
@dejanu
dejanu / k8s_introspection.sh
Created March 26, 2026 21:03
k8s_introspection
# managed or not
kubectl get no -owide
# events events events
kubectl get events -A --sort-by=.metadata.creationTimestamp
# RBAC what can I do
kubectl auth can-i --list
# discovering CRDs
@dejanu
dejanu / buildkit.md
Last active June 2, 2025 19:48
builder

Buildkit

BuildKit is the image building engine inside Docker. It's not part of other container runtimes - like containerd - but you can run a BuildKit server in a container. docker build uses Buildx and BuildKit by default since Docker Engine 23.0.

You can install BuildKit by either running it natively via systemd or in a container.

BuildKit can also be built in a version that tightly integrates with containerd, using an existing containerd daemon for the storage and sharing it with other containerd clients.

Docker

@dejanu
dejanu / ops_jargon.md
Last active May 25, 2026 20:49
Ops Jargon

⚠️ Avoid being stuck in tutorial hell and always use the official documentation.

🚀 DevOps

  • Pipeline

An automated process that defines a series of stages or steps to build, test and deploy SW solutions.

  • Continuous Integration (CI)
@dejanu
dejanu / k8s_upgrade.md
Last active August 20, 2025 20:46
Upgrading Kubernetes

The upgrade process (docs) follows the general procedure of:

- Upgrading the Kubernetes control plane with kubeadm (Kubernetes components and add-ons excluding the CNI)
- If applicable upgrading the CNI network plugin
- Upgrading the Kubernetes packages (kubelet, kubeadm, kubectl) on the control plane and worker nodes
- Upgrading the kubelet config on worker nodes with kubeadm
# check cluster nodes and version
kubectl  get no  -owide
#!/usr/bin/env bash
###########################################
# ##
# @dejanualex: Trivy based image scanner ##
# ##
###########################################
version: '3.1'
services:
db:
image: mysql
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
MYSQL_ROOT_PASSWORD: example
@dejanu
dejanu / pssh.sh
Created June 7, 2023 09:32
Simple shell script that achieves concurrent SSH connections using background processes
#!/bin/bash
## #####################################################################
## run concurrently command passed as argv on multiple remote servers ##
## UPDATE: servers array and user variable ##
########################################################################
# define an array of remote servers
servers=("server1.fqdn" "server2.fqdn" "server3.fqdn")
# Function to execute command on a remote server
execute_command() {
server=$1
@dejanu
dejanu / capacity_mgmt.sh
Created December 8, 2022 16:02
wrapper for inspecting Requests/Limits for Pods
#!/usr/bin/env bash
#############################################################
# Purpose: wrapper for inspecting Requests/Limits for Pods ##
# @dejanualex ##
#############################################################
# read namespace and po
echo -e "Available namespaces are:\n $(kubectl get ns -o=custom-columns=NAMESPACES:.metadata.name) \n"
echo -e "\n Please write the name of the namespace for which you want to know the resource status:\n"
@dejanu
dejanu / prometheus101.md
Last active November 14, 2025 12:00
Kubernetes metrics to watch for capacity management

Nice and eazy Metrics


# Memory: Use bytes(IEC) and NO bytes(SI) the diff is: 
# The unit MiB was defined by the International Electrotechnical Commission (IEC)
1 Mebibyte (MB) = 1.04 Megabyte (MiB)

50Mi = 50 mebibytes
50M = 50 megabytes
@dejanu
dejanu / cluster_state_report.sh
Created August 10, 2022 20:55
wrapper for k8s cluster state report
#!/usr/bin/env bash
################################################################################################
# kubectl wrapper that generates a report concerning cluster state, ##
# which creates a dir with compiled information regarding: ##
# - control plane components status, cluster events, nodes description, and namespace events ##
################################################################################################
# Get nodes, componentsstatuses, and pods for control-plane
echo -e "\e[0;32m Cluster Nodes: \e[0m \n $(kubectl get nodes -owide)"