Hi everyone!
So i worked on the task “Deploy Tomcat App on Kubernetes” but the deployment got stuck (0/1 Available)
I checked the logs from the pod created and got “Warning FailedScheduling 3m39s default-scheduler 0/1 nodes are available: 1 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn’t tolerate.”
Any idea? Did i missed something?
thor@jump_host ~$ kubectl create namespace tomcat-namespace-nautilus
namespace/tomcat-namespace-nautilus created
thor@jump_host ~$ vi tomcat.yml
thor@jump_host ~$ thor@jump_host ~$ cat tomcat.yml
apiVersion: apps/v1
kind: Deployment
metadata:
name: tomcat-deployment-nautilus
namespace: tomcat-namespace-nautilus
labels:
app: tomcat
spec:
replicas: 1
selector:
matchLabels:
app: tomcat
template:
metadata:
labels:
app: tomcat
spec:
containers:
- name: tomcat-container-nautilus
image: gcr.io/kodekloud/centos-ssh-enabled:tomcat
ports:
- containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: tomcat-service-nautilus
namespace: tomcat-namespace-nautilus
spec:
type: NodePort
selector:
app: tomcat
ports:
# By default and for convenience, the `targetPort` is set to the same value as the `port` field.
- port: 8080
targetPort: 8080
# Optional field
# By default and for convenience, the Kubernetes control plane will allocate a port from a range (default: 30000-32767)
nodePort: 32227
thor@jump_host ~$ kubectl apply -f tomcat.yml
deployment.apps/tomcat-deployment-nautilus created
service/tomcat-service-nautilus created
thor@jump_host ~$ kubectl get deployments --namespace tomcat-namespace-nautilus
NAME READY UP-TO-DATE AVAILABLE AGE
tomcat-deployment-nautilus 0/1 1 0 14s
thor@jump_host ~$ watch kubectl get deployments --namespace tomcat-namespace-nautilus
thor@jump_host ~$ watch kubectl get pods --namespace tomcat-namespace-nautilus
thor@jump_host ~$ kubectl describe pod tomcat-deployment-nautilus-7fcd865f5d-wlv2r --namespace tomcat-namespace-nautilus
Name: tomcat-deployment-nautilus-7fcd865f5d-wlv2r
Namespace: tomcat-namespace-nautilus
Priority: 0
Node: <none>
Labels: app=tomcat
pod-template-hash=7fcd865f5d
Annotations: <none>
Status: Pending
IP:
IPs: <none>
Controlled By: ReplicaSet/tomcat-deployment-nautilus-7fcd865f5d
Containers:
tomcat-container-nautilus:
Image: gcr.io/kodekloud/centos-ssh-enabled:tomcat
Port: 8080/TCP
Host Port: 0/TCP
Environment: <none>
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from default-token-lsdsz (ro)
Conditions:
Type Status
PodScheduled False
Volumes:
default-token-lsdsz:
Type: Secret (a volume populated by a Secret)
SecretName: default-token-lsdsz
Optional: false
QoS Class: BestEffort
Node-Selectors: <none>
Tolerations: node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning FailedScheduling 3m39s default-scheduler 0/1 nodes are available: 1 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn't tolerate.
Warning FailedScheduling 3m39s default-scheduler 0/1 nodes are available: 1 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn't tolerate.
thor@jump_host ~$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
kodekloud-control-plane Ready control-plane,master 124m v1.20.5-rc.0.18+c4af4684437b37
Thanks,
João