Kubernetes: различия между версиями

Материал из Artem Aleksashkin's Wiki
Перейти к навигации Перейти к поиску
Строка 35: Строка 35:
kubectl describe ing mongo-express-ingress -n mongo-admin
kubectl describe ing mongo-express-ingress -n mongo-admin
kubectl describe ingress mongo-express-ingress -n mongo-admin
kubectl describe ingress mongo-express-ingress -n mongo-admin
</pre>
</pre>



Версия от 22:16, 16 апреля 2023

Installation

sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl
sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
sudo apt-get update
sudo apt-get install -y kubelet kubeadm kubectl
sudo apt-mark hold kubelet kubeadm kubectl


Шпаргалка по командам

minikube ip
kubectl cluster-info
kubectl create deployment nginx-depl --image=nginx
kubectl get pod
kubectl get replicaset
kubectl get pod <POD-ID> -o wide
kubectl get deployment nginx-depl
kubectl get deployment nginx-depl -o yaml
kubectl edit deployment nginx-depl
kubectl logs <POD-ID>
kubectl describe pod <POD-ID>
kubectl exec -it <POD-ID> -- /bin/bash
kubectl apply -f <CONFIG.YML>
kubectl get deployment nginx-deployment -o yaml
# https://kubernetes.github.io/ingress-nginx/troubleshooting/
kubectl get ingress -n mongo-admin
kubectl describe ing mongo-express-ingress -n mongo-admin
kubectl describe ingress mongo-express-ingress -n mongo-admin

System reset

minikube stop
minikube delete
rm -rf ~/.minikube
rm -rf ~/.kube
docker kill $(docker ps -q)
docker rm $(docker ps -a -q)
docker rmi $(docker images -q)
docker system prune

Translate a Docker Compose File to Kubernetes Resources