Deployed kubernetes service from cluster is not accessible outside the cluster using node port method
If there is an event message i.e 0/2 nodes are available: 2 node(s) had taints that the pod didn't tolerate
. This means there is a Taint to your nodes.
Step 1:- To verify there is a Taint
kubectl describe node | grep -i taint
Step 2:- Remove the Taint, verify it has been removed.
Note that the key is used with a minus sign appended to the end.
kubectl taint nodes --all node-role.kubernetes.io/master-
kubectl taint nodes --all node-role.kubernetes.io/not-ready-
kubectl taint nodes --all node-role.kubernetes.io/unreachable-
Step 3:- Then as per your deployment.yaml file, we need to create the Taint.
kubectl taint nodes node1 dedicated-app:my-dedi-app-a:NoSchedule
Step 4:- To verify there is a Taint
kubectl describe node | grep -i taint
Step 5:- Deploy your .yaml file
kubectl apply -f deployment.yaml
You specify toleration for a pod in the PodSpec. Both of the following tolerations “match” the taint created by the kubectl taint line above, and thus a pod with either toleration would be able to schedule onto node1
https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
Also, your describe pod
shows that your deployment name is spacestudycontrolalerts-deployment
. which is making us a confusion with your deployment.yaml file i.e metadata.Name: my-deployment. Make sure you describe pod with respective deployment name
.
I hope this will help everyone for future reference on Taints and Tolerations.
The snapshot shows no Endpoints
. That means there are no Pods running behind the service or the selector
selector:
app: my-deployment
...doesn't match such label in any running Pods.