Skip to content

Instantly share code, notes, and snippets.

@Jivvon
Jivvon / etcdctl-cronjob.yaml
Last active February 7, 2022 16:18
helm chart template and values file
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: {{ include "k8s-etcd-backup.fullname" . }}
labels:
{{- include "k8s-etcd-backup.labels" . | nindent 4 }}
spec:
concurrencyPolicy: Allow
failedJobsHistoryLimit: 1
jobTemplate:
@Jivvon
Jivvon / velero-backup-without-pv-snapshot.sh
Created February 7, 2022 16:21
Backup all k8s resources per namespace into Minio bucket
# using velero
# backup k8s resources per namespace without pv snapshot
# required: velero server & client are installed
NAMESPACES=`kubectl get ns | grep -v NAME | awk '{ print $1 }'`
EXCEPT_NAMESPACES=(velero)
BUCKET_LOCATION=default
for NAMESPACE in $NAMESPACES; do
skip_flag=false
@Jivvon
Jivvon / values.yaml
Created February 7, 2022 16:30
scrape configs for dcgm exporter in prometheus
prometheus:
extraScrapeConfigs: |
- job_name: gpu-metrics
kubernetes_sd_configs:
- role: endpoints
relabel_configs:
- action: keep
regex: dcgm-exporter;monitoring
source_labels:
- __meta_kubernetes_pod_label_app_kubernetes_io_name
@Jivvon
Jivvon / reset-k8s-node.sh
Created February 17, 2022 06:32 — forked from JhoLee/reset-k8s-node.sh
Reset K8S Node
echo -n "Really want to reset this node? (y/N): "
read -r check
if [[ "$check" = "y" ]]; then
echo "[INFO] Reset kubeadm"
kubeadm reset -f
echo "[INFO] Stop kubelet & docker service"
systemctl stop kubelet docker docker.socket
echo "[INFO] Remove K8S files"
rm -rvf /etc/kubernetes/*