# generate a token
export K3S_TOKEN=$(openssl rand -base64 32)
# install k3s
curl -Lo /usr/local/bin/k3s https://github.com/rancher/k3s/releases/download/v1.17.4%2Bk3s1/k3s-arm64 && chmod a+x /usr/local/bin/k3s
# start k3s
k3s server
# Create a symlink or alias
alias k='sudo k3s kubectl'
# /etc/rancher/k3s/k3s.yaml
k get nodes
k describe node <some node>
k get pods --all-namespaces
k describe pod -n kube-system <some pod>
export K3S_TOKEN=<your token>
export K3S_URL=https://<server ip>:6443
# install k3s
curl -Lo /usr/local/bin/k3s https://github.com/rancher/k3s/releases/download/v1.17.4%2Bk3s1/k3s-arm64 && chmod a+x /usr/local/bin/k3s
# start k3s
k3s agent
k3s kubectl get nodes -w
k create namespace nextcloud
k config set-context --current --namespace nextcloud
k create deploy --image=nextcloud nextcloud
k get pods -w
k get deploy nextcloud -o yaml
k port-forward <pod name> 8080:80
# browse to http://localhost:8080
k delete pods --all
k get pods -w
k port-forward <pod name> 8080:80
k describe pod <pod name>
Data storage:
- persistent volumes
- host paths
Secrets
Configmaps
Ingress
Daemonsets
Jobs, CronJobs
RBAC
NodePorts
Operators