Kubernetes & Docker commands for developers#
Export pod logs#
kubectl logs pod-name -n namespace-name >> /export/path/file.txtDeploy a “debug/utils” pod#
kubectl run -i --tty --rm debug --image=busybox --restart=Never --shUse bach inside a pod#
kubectl exec -it myPod -n myNameSpace -- /bin/bashRun container#
docker run -p 8080:80 --name=nginxRun specific docker service#
docker-compose up -d myDatabaseAppPod Port forwarding#
kubectl port-forward pod/your-pod-name-85e45234ef-e345 8080:8080 -n your-name-space
Forwarding from 127.0.0.1:8080 -> 8080
Forwarding from [::1]:8080 -> 8080
Handling connection for 8080Get Pods ip#
Retrieve the IP of pods (pods of a deployment)
kubectl get pods -n resell-offer-api-preprod -o wide