3.4 KiB
3.4 KiB
k3s
For those looking to deploy k3s (http://k3s.io/) the below notes should help get it setup and quickly deployed.
Inspiration / Further Reading
- https://github.com/kubernetes/dashboard
- https://kubernetes.io/docs/concepts/
- https://kubernetes.io/docs/tasks/
- https://kubernetes.io/docs/tutorials/stateful-application/mysql-wordpress-persistent-volume/
- https://helm.sh/docs/using_helm/#quickstart
- https://helm.sh/docs/using_helm/#installing-helm
- https://github.com/helm/chartmuseum
- https://github.com/helm/monocular
- https://github.com/jessestuart/tiller-multiarch
- https://github.com/kubeapps/kubeapps
- https://github.com/kubeapps/kubeapps/issues/929
- [https://github.com/kubeapps/kubeapps/blob/master/Makefile]
- https://github.com/chartmuseum/ui
- https://github.com/helm/chartmuseum
- https://github.com/rancher/k3s/issues/81
Quick Deployment
Armbian Install / Setup
- Install Armbian
- Login and run through first login steps
apt update && apt install htop nload iotop vim nano tmux && apt upgrade
systemctl reboot
Run tmux as root
Prep
cat > admin-user.yaml <<EOF
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: admin-user
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: admin-user
namespace: kube-system
EOF
Session 1
curl -sfL https://get.k3s.io | sh -
journalctl -fu k3s
Session 2
k3s kubectl get node
-- This should eventually give outputkubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.0/src/deploy/recommended/kubernetes-dashboard-arm.yaml
kubectl apply -f admin-user.yaml
kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep admin-user | awk '{print $1}')
Session 3
cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get | bash
helm init --tiller-image=jessestuart/tiller
helm repo add bitnami https://charts.bitnami.com/bitnami
helm install --name kubeapps --namespace kubeapps bitnami/kubeapps
Local Machine
- Setup proxy per the "Accessing cluster from outside section" section at https://github.com/rancher/k3s/blob/master/README.md
- Access dashboard at http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/