swarm | kubernetes |
---|---|
docker service list | kubectl get pods |
docker service logs service-name | kubectl logs deployment-name container-name |
docker exec -it container-id command | kubectl exec -it pod-name [-c container-name] -- command |
kubectl describe pod/srv pod-name/srv-name |
The imagePullPolicy and the tag of the image affect when the kubelet attempts to pull the specified image.
imagePullPolicy: IfNotPresent: the image is pulled only if it is not already present locally.
imagePullPolicy: Always: the image is pulled every time the pod is started.
imagePullPolicy is omitted and either the image tag is :latest or it is omitted: Always is applied.
imagePullPolicy is omitted and the image tag is present but not :latest: IfNotPresent is applied.
imagePullPolicy: Never: the image is assumed to exist locally. No attempt is made to pull the image.
So to achieve this you have to set imagePullPolicy: Always and restart you pod and it should pull a fresh latest copy of image. I don't think there is any other way in K8s
'''kubectl describe pod/hotelpago-deployment-8997fb557-jl68z -n default
kubectl describe pods
- Configurar Service com NodePort https://kubernetes.io/docs/concepts/services-networking/service/#nodeport
kubectl exec -it nome-deployment -c nome-container -- /bin/bash