Skip to content

Instantly share code, notes, and snippets.

View leonsteinhaeuser's full-sized avatar
🏠
Working from home

Leon Steinhäuser leonsteinhaeuser

🏠
Working from home
View GitHub Profile

cloud init

This cloud init yaml bootstraps a server and sets up the necessary bits to get Docker running with all dependencies.

@leonsteinhaeuser
leonsteinhaeuser / delete-terminating-pods.yaml
Created July 5, 2023 08:52
Force delete all "Terminating" pods in Kubernetes (not namespace aware)
#!/bin/bash
# identify kubernetes config file
k_config_path=~/.kube/config
if [ "$KUBE_CONFIG" != "" ]; then
k_config_path=$KUBE_CONFIG
fi
# identify kubernetes context
k_context=""
@leonsteinhaeuser
leonsteinhaeuser / main.go
Last active September 13, 2021 07:46
Watch k8s (kubernetes) pod restarts
package main
import (
"context"
"fmt"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/watch"
@leonsteinhaeuser
leonsteinhaeuser / main.go
Created May 26, 2021 21:37
k8s watch custom resource
package main
import (
"context"
"fmt"
v1 "github.com/programmfabrik/k8s-fylr-operator/api/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"