Skip to content

Instantly share code, notes, and snippets.

View jhoelzel's full-sized avatar
available

Johannes Hölzel jhoelzel

available
  • Freelance Sr. Engineer with Kubernetes / DevOps / Golang Focus
  • Berlin
View GitHub Profile
@jhoelzel
jhoelzel / loki-rancher-rke-helm-values.yml
Created March 8, 2024 12:10 — forked from dgvigil/loki-rancher-rke-helm-values.yml
Values file for Helm install of Loki for Rancher Monitoring V2 on RKE2
loki:
persistence:
enabled: true
size: 5Gi
serviceMonitor:
enabled: true
promtail:
enabled: true
extraScrapeConfigs:
- job_name: kubernetes-pods-app
@jhoelzel
jhoelzel / config-a.json
Last active September 7, 2023 07:07
argo ApplicationSet to deploy an application to two argo cd instances at the same time
{
"appName": "production-deployment",
"destNamespace": "prod"
}
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: external-dns
namespace: argocd
annotations:
argocd.argoproj.io/sync-wave: "2"
spec:
destination:
namespace: external-dns
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: sealed-secrets-controller
namespace: argocd
spec:
project: default
source:
repoURL: https://bitnami-labs.github.io/sealed-secrets
targetRevision: 0.17.5
@jhoelzel
jhoelzel / gist:68687d945d2116499a547eba8a44c00d
Created January 29, 2022 15:53
Windows 11 update time for docker desktop container
# Often after hibernation your docker containers will be out of sync which will create problems with everythin expiration based.
# This quick fix will update the time in your local docker desktop container which should be using wsl und Windows 11
# You can find more information about hwclock here: https://linux.die.net/man/8/hwclock
$ wsl -d docker-desktop -e /sbin/hwclock -s
@jhoelzel
jhoelzel / gist:07334e7698b9cf729e8087e01de8dfe4
Created September 28, 2021 16:13
Kubernetes count items with wc
kubectl get deployments --no-headers | wc -l
@jhoelzel
jhoelzel / gist:2ed10b1d893856fec3e0f0a5d1524fe4
Created September 28, 2021 16:09
Deploy MetalLB at home
# Enable MetalLB Load Balancer.
microk8s enable metallb
when asked for an IP range give a NEW ONE for instance 10.37.1.0/24
## route local machine
route -P add 10.1.2.0/24 MASK 255.255.255.0 10.0.37.1
## in order to do that with OpenWRT just add a static route!
Host-IP or Network: 10.1.1.1/24 MASK 255.255.255.0 Gateway:10.37.0.6
@jhoelzel
jhoelzel / gist:5a778e55192e398a0e34d083b52159e3
Created September 28, 2021 16:06
Kubernetes nodes scale up and down
# Scale Up the Deployment
kubectl scale --replicas=20 deployment/<Deployment-Name>
kubectl scale --replicas=20 deployment/my-deployment
# Verify Deployment status
kubectl get deployments
# Verify ReplicaSet has been updated
kubectl get rs
@jhoelzel
jhoelzel / gist:f27b7a05640e4cf7d535d24c844cc71e
Created September 28, 2021 16:03
Kuberenetes node cloudconfig basics for public nodes
#cloud-config
packages:
- ufw
- fail2ban
package_update: true
package_upgrade: true
runcmd:
- sed -i 's/[#]*PermitRootLogin yes/PermitRootLogin prohibit-password/g' /etc/ssh/sshd_config
- sed -i 's/[#]*PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config
- systemctl restart sshd
@jhoelzel
jhoelzel / gist:9cf00a5eda378996669a426b0d780502
Created September 28, 2021 15:53
Easyli scroll through kubectl output with more
# with more you can easily scroll through the kubectl output:
kubectl -n kube-system get deployment.apps/cluster-autoscaler -o yaml | more