kubectl get namespaces
kubectl get deployments --all-namespaces=true
kubectl get deployments -n <nome-namespace>
kubectl get pods -n <nome-namespace>
kubectl describe pods -n <nome-namespace> <pod-name>
kubectl get service -n <nome-namespace>
kubectl get service -n <nome-namespace> <service-name> -o yaml
kubectl delete namespace <nome-namespace>
kubectl create secret tls tls-secret --key tls.key --cert tls.crt
kubectl get deploy,pod,rs,svc,ing -n <nome-namespace>
kubectl get ingress -n gdt-dev
kubectl rollout history deployment/<nome-deployment> -n gdt-dev
kubectl rollout undo deploy my-deployment-name -n my-namespace
kubectl rollout undo deployment/<nome-deployment> -n <nome-namespace> --to-revision=12
kubectl scale deploy <nome-deployment>.yaml -n <nome-namespace> --replicas=1
kubectl describe replicationcontrollers/<nome-ReplicationController>
az acr login -n <nome-registry>
kubectl get namespace <nome-namespace> -o json > dados.json
nano dados.json
kubectl replace --raw "/api/v1/namespaces/<nome-namespace>/finalize" -f ./dados.json
kubectl delete --wait=false pod <pod-name> -n <nome-namespace>
kubectl create secret tls tls-secret \
--namespace gdt-prd \
--key tls.key \
--cert tls.crt
kubectl exec <pod-name> -n <nome-namespace> -- curl --location --request GET 'http://localhost/'
curl http://<nome-service>.<nome-namespace>:8080/healthcheck
kubectl cp <nome-namespace>/<nome-pod>:<caminho-arquivo> <destino-local>
kubectl cp <caminho-arquivo-local> <nome-namespace>/<nome-pod>:<caminho-arquivo>
Linux com bash
kubectl exec -it <pod-name> -n <nome-namespace> -- /bin/bash
Alpine (apk add curl
) inserir curl no alpine
kubectl exec -it <pod-name> -n <nome-namespace> -- /bin/ash
Log em tempo real
kubectl logs -f <pod-name> -n <nome-namespace>
Logs capturado
kubectl logs <pod-name> -n <nome-namespace>