-
Documentação de apoio
-
Curso Introduction to Kubernetes
-
Instalar Kubernetes
- Docker Desktop -> Kubernetes e ativar (Enable Kubernetes)
-
Instalar Kubectl
-
Instalar Krew
-
Instalar Kubectx e Kubens
- kubectl krew install ctx
- kubectl krew install ns
- Aplica um yaml
kubectl apply -f {arquivo.yml}
- Remover os recursos de um yaml
kubectl delete -f {arquivo.yml}
- Listar recursos
kubectl get pods
kubectl get namespaces
kubectl get services
kubectl get cronjobs
- Visualizar um recurso
kubectl describe pod {name}
kubectl describe namespace {name}
kubectl describe service {name}
kubectl describe namespace {name}
- Ver os logs de um pod
kubectl logs {podname}[-c {containername}]
- Ver o uso de recursos dos pods/containers (precisa ter o metrics server instalado)
kubectl top pods
kubectl top pods --containers
- Port Forward
kubectl port-forward pods/{name} {LOCAL_PORT}:{CLUSTER_PORT}
kubectl port-forward deployment/{name} {LOCAL_PORT}:{CLUSTER_PORT}
kubectl port-forward service/{name} {LOCAL_PORT}:{CLUSTER_PORT}