Skip to content

Instantly share code, notes, and snippets.

@snelis
Last active June 12, 2017 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save snelis/f2c90e763dd64258e655d9df523da798 to your computer and use it in GitHub Desktop.
Save snelis/f2c90e763dd64258e655d9df523da798 to your computer and use it in GitHub Desktop.

General

datetime (If you want to revert to the hardware clock being in UTC, do:)
timedatectl set-local-rtc 0

Docker

Also making sure we can do docker commands without sudo

yaourt -S --noconfirm docker
usermod -a -G docker $USER
newgrp docker

Kubernetes

Install

yaourt -S --noconfirm kubernetes cni kubernetes-helm

sudo mkdir -p /etc/systemd/system/kubelet.service.d/

sudo bash -c "cat > /etc/systemd/system/kubelet.service.d/10-kubeadm.conf" << \EOT
[Service]
Environment="KUBELET_KUBECONFIG_ARGS=--kubeconfig=/etc/kubernetes/kubelet.conf --require-kubeconfig=true"
Environment="KUBELET_SYSTEM_PODS_ARGS=--pod-manifest-path=/etc/kubernetes/manifests --allow-privileged=true"
Environment="KUBELET_NETWORK_ARGS=--network-plugin=cni --cni-conf-dir=/etc/cni/net.d --cni-bin-dir=/opt/cni/bin"
Environment="KUBELET_DNS_ARGS=--cluster-dns=10.96.0.10 --cluster-domain=cluster.local"
Environment="KUBELET_AUTHZ_ARGS=--authorization-mode=Webhook --client-ca-file=/etc/kubernetes/pki/ca.crt"
Environment="KUBELET_CGROUP_ARGS=--cgroup-driver=cgroupfs"
Environment="KUBELET_EXTRA_ARGS=--feature-gates=Accelerators=true"
ExecStart=
ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_SYSTEM_PODS_ARGS $KUBELET_NETWORK_ARGS $KUBELET_DNS_ARGS $KUBELET_AUTHZ_ARGS $KUBELET_CGROUP_ARGS $KUBELET_EXTRA_ARGS
EOT

sudo systemctl daemon-reload
sudo systemctl restart kubelet
sudo kubeadm init

sudo cp /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config

kubectl taint nodes $(hostname -s) node-role.kubernetes.io/master:NoSchedule-

kubectl apply -f https://git.io/kube-dashboard
kubectl apply -f https://git.io/weave-kube-1.6
kubectl apply -f https://raw.githubusercontent.com/kubernetes/kops/master/addons/monitoring-standalone/v1.6.0.yaml

kubectl proxy &
chromium 127.0.0.1:8001/ui

Helm

workaround temporary helm/helm#2224

kubectl create clusterrolebinding permissive-binding --clusterrole=cluster-admin --user=admin --user=kubelet --group=system:serviceaccounts;
helm init

Nvidia / CUDA

sudo pacman -S --noconfirm nvidia cudnn

kubelet not detecting GPU

nvidia-smi -pm 1 || true
nvidia-smi -acp 0 || true
nvidia-smi --auto-boost-default=0 || true
nvidia-smi --auto-boost-permission=0 || true
nvidia-modprobe -u -c=0 -m || true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment