Skip to content

Instantly share code, notes, and snippets.

View allanlei's full-sized avatar
:shipit:
What's up?

Allan Lei allanlei

:shipit:
What's up?
View GitHub Profile
@allanlei
allanlei / kernel-tuner.yaml
Created September 15, 2018 21:37
Kubernetes THP tuner daemonset
kind: DaemonSet
apiVersion: apps/v1
metadata:
namespace: kube-system
name: kernel-tuner
labels:
app: kernel-tuner
spec:
selector:
matchLabels:
@allanlei
allanlei / rbac.yaml
Created September 15, 2018 21:36
Kubernetes Node Labeling permissions
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: node-labeler
rules:
- apiGroups: [""]
resources: ["node"]
verbs: ["list", "update"]
---
apiVersion: rbac.authorization.k8s.io/v1beta1
@allanlei
allanlei / redis.yaml
Created September 15, 2018 21:34
Kubernetes System THP nodeAffinity
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis
spec:
replicas: 1
selector:
matchLabels:
app: redis
template:
@allanlei
allanlei / daemonset.yaml
Last active September 2, 2019 05:15
Kubernetes sysctl daemonset for tuning Transparent Huge Pages
apiVersion: apps/v1
kind: DaemonSet
metadata:
namespace: kube-system
name: sysctl
spec:
selector:
matchLabels:
app: sysctl
template:
@allanlei
allanlei / deployment.yaml
Created January 28, 2018 15:03
Install kubectl into a Kubernetes Pod
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: redis
spec:
replicas: 1
selector:
matchLabels:
app: redis
template:
@allanlei
allanlei / Dockerfile
Last active July 24, 2017 02:21
xfsprogs builder
FROM debian
ARG VERSION=v4.12.0
RUN apt-get update
RUN apt-get install -y \
git-core \
libtool \
build-essential \
gettext \
kind: DaemonSet
apiVersion: extensions/v1beta1
metadata:
name: startup-script
namespace: kube-system
labels:
app: startup-script
spec:
template:
metadata:
@allanlei
allanlei / Dockerfile
Last active January 7, 2019 16:26
Running cron in Docker via compiled image
FROM alpine
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
# run: docker run -it --rm IMAGE "* * * * * echo hello"
@allanlei
allanlei / mounted-volume.sh
Last active January 7, 2019 16:26
Running cron in Docker via mounted volume
docker run -it --rm -v tasks.cron:/tasks.cron alpine:3.5 sh -c "crontab /tasks.cron && crond -f -L /dev/stdout"
@allanlei
allanlei / singleline.sh
Last active January 7, 2019 16:26
Running cron in Docker via command
docker run -it --rm alpine sh -c "echo \"* * * * * echo hello\" | crontab - && crond -f -L /dev/stdout"