
#master node
 cd /etc/rancher/rke2/
 sudo systemctl restart rke2-server.service
 journalctl -xeu rke2-server.service -f

#worker node
sudo systemctl restart rke2-agent.service
sudo systemctl stop rke2-agent.service

sudo systemctl start rke2-agent.service
journalctl -xeu rke2-agent.service -f
cat /var/lib/rancher/rke2/agent/logs/kubelet.log


#load balancer
/etc/haproxy/haproxy.cfg
sudo systemctl restart haproxy
journalctl -xeu haproxy.service -f
tail -f /var/log/haproxy.log
http://<load balancer vm external ip>:8080/stats  (admin/admin)

Console rancher:  https://rancher.pigreco66.it/ (AdminJapp0cam)


************Check risorse***************
kubectl resource-capacity


kubectl create -n demo-apps -f - <<EOF
apiVersion: v1
kind: Pod
metadata:
  name: swiss-army-knife
  labels:
    app: swiss-army-knife
spec:
  containers:
  - name: swiss-army-knife
    image: leodotcloud/swiss-army-knife:latest
    command: ["/bin/sleep", "3650d"]
    imagePullPolicy: IfNotPresent
  restartPolicy: Always
EOF

kubectl -n demo-apps exec -it swiss-army-knife -- sh



gateway-nginx-nodeport.nginx-gateway.svc.cluster.local:30864

kubectl exec -n nginx-gateway main-gateway-nginx-6968db7f9f-6v4qg -- ss -tulnp

kubectl edit gateway main-gateway -n nginx-gateway

Pulizia disco:
docker system prune -af
docker builder prune -af


db postgresql-------------------------------------

kubectl get clusters.postgresql.cnpg.io -n stsharedservices-dev

kubectl cnpg hibernate on stpgclusterdev -n stsharedservices-dev
kubectl cnpg hibernate off stpgclusterdev -n stsharedservices-dev
