Skip to content

Instantly share code, notes, and snippets.

View Tim-Schwalbe's full-sized avatar
🤠

Tim Schwalbe Tim-Schwalbe

🤠
View GitHub Profile
helm install --name nginx-ingress stable/nginx-ingress --version 0.12.3 --namespace nginx-ingress --set rbac.create=true --set controller.service.loadBalancerIP="STATIC_IP"
kubectl get po -a --all-namespaces -o json | \
jq '.items[] | select(.status.reason!=null) | select(.status.reason | contains("Evicted")) |
"kubectl delete po \(.metadata.name) -n \(.metadata.namespace)"' | xargs -n 1 bash -c
apiVersion: apps/v1beta2
kind: DaemonSet
metadata:
name: prepull-image
spec:
selector:
matchLabels:
name: prepull-image
template:
@Tim-Schwalbe
Tim-Schwalbe / gist:85718020370fc3f149fd092d4c0f3842
Created December 20, 2018 21:51
base64 encode service accounts
base64_encoded_service_account=$(base64 -w 0 keyfile.json)
@Tim-Schwalbe
Tim-Schwalbe / maintenance.properties
Created December 28, 2018 16:50
BASH: one liner to read properties files in bash script
app.config.name=test app
app.config.url= www.test
@Tim-Schwalbe
Tim-Schwalbe / gist:71b85f45967198dfc98d013dcdc9b1c5
Created March 18, 2019 15:33
Best way for trouble with image pull secret
https://container-solutions.com/using-google-container-registry-with-kubernetes/
rm ~/.docker/config.json
gcloud auth print-access-token | docker login -u oauth2accesstoken --password-stdin https://eu.gcr.io
@Tim-Schwalbe
Tim-Schwalbe / send_file.py
Created April 16, 2019 16:01
python - mattermost api v4 send file into channel
import os
import json
import requests
SERVER_URL = "YOUR_SERVER_URL"
CHANNEL_ID = "YOUR_CHANNEL_ID"
FILE_PATH = './test.jpg'
s = requests.Session()
s.headers.update({"Authorization": "Bearer YOUR_PERSONAL_ACCESS_TOKEN"})
@Tim-Schwalbe
Tim-Schwalbe / gist:63bc01043bc534e2af276ed703185534
Created July 20, 2020 08:50
Kubectl: Delete released persistent volumes (PV)
kubectl get pv | grep Released | awk '$1 {print$1}' | while read vol; do kubectl delete pv/${vol}; done
@Tim-Schwalbe
Tim-Schwalbe / sh
Last active July 8, 2021 12:24
Copy K8S Secret from one Namespace to another
kubectl get secret wildcard-tls --namespace=prod -o yaml | sed 's/namespace: prod/namespace: monitoring/g' | kubectl create -f -