# API server: nodes should be able to reach k3s server tcp port 6443 # flannel vxlan: udp port 8472 for nodes to communicate (server and agents) # metrics server: it collects resource metrics from kubelets and exposes them in k8s api server through metrics api. tcp port 10250 # https://rancher.com/docs/k3s/latest/en/installation/install-options/ # run the installation script curl -sfL https://get.k3s.io | sh - # create k3s group and add user to avoid using always sudo sudo groupadd k3s sudo usermod -aG k3s $USER sudo chown root:k3s /etc/rancher/k3s/k3s.yaml sudo chmod 740 /etc/rancher/k3s/k3s.yaml # node configuration using the agent # the token can be found on control server at: /var/lib/rancher/k3s/server/node-token curl -sfL https://get.k3s.io | K3S_URL=https://k3sserver:6443 K3S_TOKEN=mynodetoken sh - # create test pod cat < podtemplate.yaml apiVersion: v1 kind: Pod metadata: name: cowfortune spec: containers: - name: funbox-cow image: wernight/funbox command: ["fortune | cowsay"] EOF