<p>I'm following Les Jackson's <a href="https://www.youtube.com/watch?v=DgVjEo3OGBI" rel="nofollow noreferrer">tutorial</a> to microservices and got stuck at 05:30:00 while creating a deployment for a ms sql server. I've written the deployment file just as shown on the yt video:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: mssql-depl
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mssql
  template:
    metadata:
      labels:
        app: mssql
    spec:
      containers:
        - name: mssql
          image: mcr.microsoft.com/mssql/server:2017-latest
          ports:
            - containerPort: 1433
          env:
          - name: MSSQL_PID
            value: &quot;Express&quot;
          - name: ACCEPT_EULA
            value: &quot;Y&quot;
          - name: SA_PASSWORD
            valueFrom:
              secretKeyRef:
                name: mssql
                key: SA_PASSWORD
          volumeMounts:
            - mountPath: /var/opt/mssql/data
              name: mssqldb
      volumes:
      - name: mssqldb
        persistentVolumeClaim:
          claimName: mssql-claim

---
apiVersion: v1
kind: Service
metadata:
  name: mssql-clusterip-srv
spec:
  type: ClusterIP
  selector:
    app: mssql
  ports:
  - name: mssql
    protocol: TCP
    port: 1433 # this is default port for mssql
    targetPort: 1433 

---
apiVersion: v1
kind: Service
metadata:
  name: mssql-loadbalancer
spec:
  type: LoadBalancer
  selector:
    app: mssql
  ports:
  - protocol: TCP
    port: 1433 # this is default port for mssql
   targetPort: 1433 
</code></pre>
<p>The persistent volume claim:</p>
<pre><code>apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: mssql-claim
spec:
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 200Mi
</code></pre>
<p>But when I apply this deployment, the pod ends up with ImagePullBackOff status:</p>
<pre><code>commands-depl-688f77b9c6-vln5v    1/1     Running            0          2d21h
mssql-depl-5cd6d7d486-m8nw6       0/1     ImagePullBackOff   0          4m54s
platforms-depl-6b6cf9b478-ktlhf   1/1     Running            0          2d21h
</code></pre>
<p><strong>kubectl describe pod</strong></p>
<pre><code>Name:         mssql-depl-5cd6d7d486-nrrkn
Namespace:    default
Priority:     0
Node:         docker-desktop/192.168.65.4
Start Time:   Thu, 28 Jul 2022 12:09:34 +0200
Labels:       app=mssql
              pod-template-hash=5cd6d7d486
Annotations:  &lt;none&gt;
Status:       Pending
IP:           10.1.0.27
IPs:
  IP:           10.1.0.27
Controlled By:  ReplicaSet/mssql-depl-5cd6d7d486
Containers:
  mssql:
    Container ID:
    Image:          mcr.microsoft.com/mssql/server:2017-latest
    Image ID:
    Port:           1433/TCP
    Host Port:      0/TCP
    State:          Waiting
      Reason:       ImagePullBackOff
    Ready:          False
    Restart Count:  0
    Environment:
      MSSQL_PID:    Express
      ACCEPT_EULA:  Y
      SA_PASSWORD:  &lt;set to the key 'SA_PASSWORD' in secret         'mssql'&gt;  Optional: false
    Mounts:
      /var/opt/mssql/data from mssqldb (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-    api-access-xqzks (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             False
  ContainersReady   False
  PodScheduled      True
Volumes:
  mssqldb:
    Type:       PersistentVolumeClaim (a reference to a         PersistentVolumeClaim in the same namespace)
    ClaimName:  mssql-claim
    ReadOnly:   false
  kube-api-access-xqzks:
    Type:                    Projected (a volume that contains injected data from multiple sources)
    TokenExpirationSeconds:  3607
    ConfigMapName:           kube-root-ca.crt
    ConfigMapOptional:       &lt;nil&gt;
    DownwardAPI:             true
QoS Class:                   BestEffort
Node-Selectors:              &lt;none&gt;
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
  ----     ------     ----                 ----               -------
  Normal   Scheduled  3m42s                default-scheduler      Successfully assigned default/mssql-depl-5cd6d7d486-nrrkn to docker-desktop
  Warning  Failed     102s                 kubelet                Failed to pull image &quot;mcr.microsoft.com/mssql/server:2017-latest&quot;:     rpc error: code = Unknown desc = context deadline exceeded
  Warning  Failed     102s                 kubelet            Error: ErrImagePull
  Normal   BackOff    102s                 kubelet            Back-off pulling image &quot;mcr.microsoft.com/mssql/server:2017-latest&quot;
  Warning  Failed     102s                 kubelet            Error: ImagePullBackOff
  Normal   Pulling    87s (x2 over 3m41s)  kubelet            Pulling image &quot;mcr.microsoft.com/mssql/server:2017-latest&quot;
</code></pre>
<p>In the events it shows</p>
<blockquote>
<p>&quot;rpc error: code = Unknown desc = context deadline exceeded&quot;</p>
</blockquote>
<p>But it doesn't tell me anything and resources on troubleshooting this error don't include such error.</p>
<p>I'm using kubernetes on docker locally.
I've researched that this issue can happen when pulling the image from a private registry, but this is public one, right <a href="https://hub.docker.com/_/microsoft-mssql-server" rel="nofollow noreferrer">here</a>. I copy pasted the image path to be sure, I tried with different ms sql version, but to no avail.</p>
<p>Can someone be so kind and show me the right direction I should go / what should I try to get this to work? It worked just fine on the video :(</p>

<p>I fixed it by manually pulling the image via <code>docker pull mcr.microsoft.com/mssql/server:2017-latest</code> and then deleting and re-applying the deployment.</p>
