Kubectl prikazy

seznameni https://school-k8s-doc.readthedocs.io

jak se dostat pres forward ssh na ostatni stroje uvnitr site
ssh -J root@rancher.kube.sspu-opava.cz root@192.168.55.2

uvnitr k3s jsou prikazy napr
k3s crictl ps

upgrade k3s se provadi

backup main k3s adresare urceno pro migraci

/etc/rancher
/var/lib/rancher/k3s/[*token,manifest]
/var/lib/rancher/k3s/server

prejit na node

ssh -J root@rancher.kube.sspu-opava.cz root@192.168.55.3

zde



curl -o /usr/local/bin/k3s -L https://github.com/k3s-io/k3s/releases/download/v1.34.2%2Bk3s1/k3s

a nasledne restart

download cluster config yaml from rancher vpravo nahore

ulozit do file .kube/config

kubectl completion pripoji konfig do promenne terminalu pro praci z kube

„. <(kubectl completion bash)“

dobre pridat do .bashrc na konec nasledne prikaz „kubectl “ + <tab> = vypise vsechny prikazy kubectl

v pripade vice kubernetes siti je nutne stahnout dalsi config a ulozit jej do ./kube a nasledne do .bashr pridat
export KUBECONFIG=“$HOME/.kube/config:$HOME/.kube/config1″
a nasledne prepinani mezi kube je prikaz
kubectl config use-context + <tab> = vyber urciteho kubernetesu

dalsi terminal rozhrani pro kube je „k9s“
snap install k9s --channel=latest/stable
sudo ln -s /snap/k9s/current/bin/k9s /snap/bin/k9s

webhooklimits jak na to viz https://github.com/Jan1s2/webhook-limits
a nasledne v kube activovat volani na docker s limity viz
kubectl edit mutatingwebhookconfigurations.admissionregistration.k8s.io limits-webhook.sspu-opava.cz

prikaz

k9s
??? rewrite external url to app specific phpmyadmin

  annotations:
    nginx.org/rewrites: serviceName=phpmyadmin rewrite=/

prikazy ….

kubectl get node
kubectl describe node
kubectl top node