Start MariaDB in K8s - MariaDB.org
kubectl get no
Auto completion:
kubectl completion bash > /etc/bash_completion.d/kubectl
or
k completion bash > /etc/bash_completion.d/k
Clusters:
cat /etc/rancher/k3s/k3s.yaml
Export kubeconfig
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
List of api resource how install in your system
kubectl api-resources
The kubectl explain command is used to get detailed explanations of Kubernetes API resources and their fields.
kubectl explain pods.spec
The kubectl get ns command is used to list all namespaces in the Kubernetes cluster. It provides an overview of the namespaces available in the cluster, including the default ones and any custom namespaces that have been created.
kubectl get ns
Linux watch command lets you repeatedly run a command or utility in regular time intervals. Learn how it works and what it can do.
watch -n0.1 kubectl get po -o wide
یک کوبرنتیز سبک وزن. نصب آسان، نیمی از حافظه، همه در یک باینری کمتر از 100 مگابایت.
K3s is a highly available, certified Kubernetes distribution designed for production workloads in unattended, resource-constrained, remote locations
curl -sfL https://get.k3s.io | sh -
/usr/local/bin/k3s-uninstall.sh
/usr/local/bin/k3s-agent-uninstall.sh
+ id -u
+ [ 0 -eq 0 ]
+ /usr/local/bin/k3s-killall.sh
+ [ -s /etc/systemd/system/k3s.service ]
+ basename /etc/systemd/system/k3s.service
+ systemctl stop k3s.service
+ [ -x /etc/init.d/k3s* ]
+ killtree 147461 147624 147632 148208 148371
+ kill -9 147461 147521 147745 147624
+ do_unmount_and_remove /run/k3s
+ set +x
sh -c 'umount -f "$0" && rm -rf "$0"' /run/k3s/containerd/io.containerd.runtime.v2.task/k8s.io/fb14aaf9c40b/rootfs
sh -c 'umount -f "$0" && rm -rf "$0"' /run/k3s/containerd/io.containerd.grpc.v1.cri/sandboxes/2284da276e6d08/shm
+ do_unmount_and_remove /var/lib/rancher/k3s
+ set +x
+ do_unmount_and_remove /var/lib/kubelet/pods
+ set +x
sh -c 'umount -f "$0" && rm -rf "$0"' /var/lib/kubelet/pods/fa2347b9-961c/volumes/kubernetes.io~projected/kube-api-access
sh -c 'umount -f "$0" && rm -rf "$0"' /var/lib/kubelet/pods/b7b38efd-be27/volumes/kubernetes.io~projected/kube-api-access
sh -c 'umount -f "$0" && rm -rf "$0"' /var/lib/kubelet/pods/685b5b37-5f14/volumes/kubernetes.io~projected/kube-api-access
sh -c 'umount -f "$0" && rm -rf "$0"' /var/lib/kubelet/pods/0b616901-07797/volumes/kubernetes.io~projected/kube-api-access
+ do_unmount_and_remove /var/lib/kubelet/plugins
+ set +x
+ do_unmount_and_remove /run/netns/cni-
+ set +x
sh -c 'umount -f "$0" && rm -rf "$0"' /run/netns/cni-d8fb7cad-b174-c0de
sh -c 'umount -f "$0" && rm -rf "$0"' /run/netns/cni-c50edff3-0ead-d2f6
sh -c 'umount -f "$0" && rm -rf "$0"' /run/netns/cni-6e824504-c8d9-9e04
sh -c 'umount -f "$0" && rm -rf "$0"' /run/netns/cni-3196af2b-0b5a-4880
sh -c 'umount -f "$0" && rm -rf "$0"' /run/netns/cni-00bc09d8-0b84-94f2
+ xargs -r -t -n 1 ip netns delete
+ grep cni-
+ ip netns show
+ remove_interfaces
+ read ignore iface ignore
+ grep master cni0
+ ip link show
+ ip link delete cni0
+ ip link delete flannel.1
+ ip link delete flannel-v6.1
Cannot find device "flannel-v6.1"
+ ip link delete kube-ipvs0
Cannot find device "kube-ipvs0"
+ ip link delete flannel-wg
Cannot find device "flannel-wg"
+ ip link delete flannel-wg-v6
Cannot find device "flannel-wg-v6"
+ command -v tailscale
+ [ -n ]
+ rm -rf /var/lib/cni/
+ iptables-restore
+ grep -iv flannel
+ grep -v CNI-
+ grep -v KUBE-
+ iptables-save
+ ip6tables-restore
+ grep -iv flannel
+ grep -v CNI-
+ grep -v KUBE-
+ ip6tables-save
+ command -v systemctl
/usr/bin/systemctl
+ systemctl disable k3s
Removed /etc/systemd/system/multi-user.target.wants/k3s.service.
+ systemctl reset-failed k3s
+ systemctl daemon-reload
+ command -v rc-update
+ rm -f /etc/systemd/system/k3s.service
+ rm -f /etc/systemd/system/k3s.service.env
+ trap remove_uninstall EXIT
+ [ -L /usr/local/bin/kubectl ]
+ rm -f /usr/local/bin/kubectl
+ [ -L /usr/local/bin/crictl ]
+ rm -f /usr/local/bin/crictl
+ [ -L /usr/local/bin/ctr ]
+ rm -rf /etc/rancher/k3s
+ rm -rf /run/k3s
+ rm -rf /run/flannel
+ rm -rf /var/lib/rancher/k3s
+ rm -rf /var/lib/kubelet
+ rm -f /usr/local/bin/k3s
+ rm -f /usr/local/bin/k3s-killall.sh
+ type yum
+ type rpm-ostree
+ type zypper
+ remove_uninstall
+ rm -f /usr/local/bin/k3s-uninstall.sh
CNI stands for container network interface and it's a specification to configure network interfaces in Linux containers. And it is concerned mainly with adding, connecting and deleting disconnecting containers to networks.
-Networking services: dns, ingress, etc explains how CoreDNS, Traefik, Network Policy controller and ServiceLB controller work within k3s
CTR
CRICTL
kubectl rollout undo deployment test
Deploy WordPress in K3S Cluster (based on Kubernetes Official Documentation)