Kubectl deployment replicas waiting status

Good day,

Kindly need help with this issue I cannot find the solution even though I used this site https://kubernetes.io/docs/concepts/workloads/controllers/deployment/. I am creating a new deployment, but when I apply my yaml file the replicas Pods Status are waiting instead of available. How can I changeg them to running status. When I check rollout status the replicas are not being available.

kubectl get deployments
NAME               READY   UP-TO-DATE   AVAILABLE   AGE
ngnix-deployment   0/3     3            0           12m

kubectl get rs
NAME                        DESIRED   CURRENT   READY   AGE
ngnix-deployment-dffcf985   3         3         0       12m

kubectl describe deployment ngnix-deployment
Name:                   ngnix-deployment
Namespace:              default
CreationTimestamp:      Thu, 02 Jul 2020 06:11:24 -0700
Labels:                 app=nginx
Annotations:            deployment.kubernetes.io/revision: 1
Selector:               app=ngnix
Replicas:               3 desired | 3 updated | 3 total | 0 available | 3 unavailable
StrategyType:           RollingUpdate
MinReadySeconds:        0
RollingUpdateStrategy:  25% max unavailable, 25% max surge
Pod Template:
  Labels:  app=ngnix
  Containers:
   ngnix:
    Image:        ngnix:1.7.9
    Port:         80/TCP
    Host Port:    0/TCP
    Environment:  <none>
    Mounts:       <none>
  Volumes:        <none>
Conditions:
  Type           Status  Reason
  ----           ------  ------
  Available      False   MinimumReplicasUnavailable
  Progressing    False   ProgressDeadlineExceeded
OldReplicaSets:  <none>
NewReplicaSet:   ngnix-deployment-dffcf985 (3/3 replicas created)
Events:
  Type    Reason             Age   From                   Message
  ----    ------             ----  ----                   -------
  Normal  ScalingReplicaSet  11m   deployment-controller  Scaled up replica set ngnix-deployment-dffcf985 to 3

My deployment yaml file:

apiVersion: apps/v1
kind: Deployment
metadata:
   name: ngnix-deployment
   labels:
     app: nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      app: ngnix
  template:
    metadata:
      labels:
        app: ngnix
    spec:
       containers:
       - name: ngnix
         image: ngnix:1.7.9
         ports:
         - containerPort: 80

I heard about nginx. What is ngnix:1.7.9 ? is it a new form of nginx? It should be nginx.

Your deployment and replicaset seem to be OK.
You should run a describe on the pods.

Also one reason for this state is when the pods don’t have networking.
Where is this cluster running?
Have you installed a CNI?

Kind regards,
Stephen

@stephendotcarter Hello, Issue in image. His image name is wrong. He is getting ErrImagePull error in Pods.

@tej-singh-rana I didn’t see ErrImagePull in the output provided.

nginx:1.7.9 is showing on Docker Hub but it is a very old version:
https://hub.docker.com/_/nginx?tab=tags&name=1.7.9&page=1

But using a newer begins version is probably recommended unless 1.7.9 is a hard requirement.
It is a few years old.

Kind regards,
Stephen

I am indicating that his nginx spell is wrong. Kind of typo @stephendotcarter

1 Like

Sorry :see_no_evil:, you are absolutely correct :+1:
I thought you were highlighting the version number, didn’t notice the typo.
So ngnix should be nginx.

Kind regards,
Stephen

1 Like

Sorry for the late reply. My apologies i forgot to update it, i have already fixed the typo when i sent my question. I am currently working on the matter as I noticed that I am receiving this error on the Web UI.

Failed to pull image “ngnix:1.9.1”: rpc error: code = Unknown desc = Error response from daemon: pull access denied for ngnix, repository does not exist or may require ‘docker login’: denied: requested access to the resource is denied

This version of nginx image is not available in docker hub repository.

1 Like

Thank you! i changed the image to something in my repository and it worked! much appreciated