Skip to content

Instantly share code, notes, and snippets.

@r7vme
r7vme / gist:979a08e0eb0189fff9138bfc1d270236
Created November 27, 2018 13:58
kube-proxy restarter pod
apiVersion: v1
kind: Pod
metadata:
name: kube-proxy-restarter
namespace: kube-system
spec:
containers:
- image: busybox
command:
- sh
@r7vme
r7vme / temp.sh
Created September 29, 2018 13:21
#!/bin/bash
# Show temperature in Jetson TX1 board
for i in $(ls -d /sys/class/thermal/thermal_zone*); do
m=`cat $i/type`
t=`cat $i/temp`
echo $m $(($t / 1000))
done
@r7vme
r7vme / gist:c3ff2a3a0c11c52038d926d1579baae5
Created September 20, 2018 13:12
Adjust NVME driver parameters
[Unit]
Description=Adjust NVME driver parameters
[Service]
Type=oneshot
ExecStart=/bin/sh -c "echo 10 > /sys/module/nvme_core/parameters/max_retries ; echo 255 > /sys/module/nvme_core/parameters/io_timeout"
[Install]
WantedBy=multi-user.target
Sep 18 14:43:34 master-10-61-16-101 systemd[1]: Stopping Network Service...
Sep 18 14:43:35 master-10-61-16-101 systemd[1]: Stopped Network Service.
Sep 18 14:43:35 master-10-61-16-101 systemd[1]: Starting Network Service...
Sep 18 14:43:35 master-10-61-16-101 systemd-networkd[25781]: bond0: netdev ready
Sep 18 14:43:35 master-10-61-16-101 systemd-networkd[25781]: br-eh2v6: Gained IPv6LL
Sep 18 14:43:35 master-10-61-16-101 systemd-networkd[25781]: br-q2oaq: Gained IPv6LL
Sep 18 14:43:35 master-10-61-16-101 systemd-networkd[25781]: br-s2hiv: Gained IPv6LL
Sep 18 14:43:35 master-10-61-16-101 systemd-networkd[25781]: br-w4sar: Gained IPv6LL
Sep 18 14:43:35 master-10-61-16-101 systemd-networkd[25781]: calid0ad6d3cbb6: Gained IPv6LL
Sep 18 14:43:35 master-10-61-16-101 systemd-networkd[25781]: cali33ccd6ad61f: Gained IPv6LL
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: azurefile-ubuntu
namespace: afiletest
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 3
selector:
@r7vme
r7vme / donkey.service
Created July 9, 2018 19:40
systemd unit for donkey car
# Allows to automatically start donkey car on boot.
#
# 1. Put contents to /etc/systemd/system/donkey.service
# 2. sudo systemctl daemon-reload
# 3. sudo systemctl start donkey
# 4. sudo journactl -u donkey
#
# TIP: Grab logs via ssh with
#
# ssh [email protected] "sudo journalctl -u donkey -f"
# Show active kubernetes context in your zsh
# 1. Clone https://github.com/jonmosco/kube-ps1/
# 2. Add following lines to ~/.zshrc (change path to kube-ps1.sh)
source ${HOME}/src/github/kube-ps1/kube-ps1.sh
export KUBE_PS1_SYMBOL_ENABLE="false"
export KUBE_PS1_NS_ENABLE="false"
export KUBE_PS1_PREFIX=""
export KUBE_PS1_SEPARATOR=""
export KUBE_PS1_SUFFIX=" "
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: nginx-for-ingress-ingress
annotations:
nginx.ingress.kubernetes.io/ssl-passthrough: "true"
spec:
tls:
- hosts:
- nginx1.DOMAIN
@r7vme
r7vme / gist:3ce040bd7e73331fdec8d33fa797d4eb
Last active April 17, 2018 06:55
kubernetes conformance one line
#
# Run this manifest with:
#
# curl -L https://gist.githubusercontent.com/r7vme/3ce040bd7e73331fdec8d33fa797d4eb/raw/599b782e71cb0d6e6471469698dbfc9669301b58/gistfile1.txt | kubectl apply -f -
#
# Collect logs:
#
# kubectl logs e2e -f
#
# For RBAC case, allow service account to list nodes:
@r7vme
r7vme / 01-pvc.yaml
Created April 4, 2018 21:14
kubernetes pvc test
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: myclaim1
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi