<p>I'm trying to deploy a container to AKS but the pod is constantly in CrashLoopBackOff and restarting. I tried with different pods but apparently is unrelated with that regard.</p>
<p>The pod has very simple functional behaviour that works fine locally. It's a simple express server listening to the port 9002 and send the message &quot;HELLO&quot; in the path &quot;/&quot;.</p>
<p>The deployed container has the following yaml file:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: be-simply-depl
spec:
  replicas: 1
  selector:
    matchLabels:
      app: be-simply
  template:
    metadata:
      labels:
        app: be-simply
    spec:
      containers:
        - name: be-simply
          image: dockeraccount/be-simply
---
apiVersion: v1
kind: Service
metadata:
  name: be-simply-srv
spec:
  selector:
    app: be-simply
  type: ClusterIP
  ports:
    - name: be-simply
      protocol: TCP
      port: 9002
      targetPort: 9002
</code></pre>
<p>When running:</p>
<blockquote>
<p>kubectl describe pod be-simply-depl-79f49b58d7-wksms</p>
</blockquote>
<pre><code>Name:             be-simply-depl-79f49b58d7-wksms 
Namespace:        default 
Priority:         0 
Service Account:  default 
Node:             aks-agentpool-24486413-vmss000000/10.224.0.4
Start Time:       Tue, 25 Jul 2023 05:17:17 +0000 
Labels:           
    app=be-simply                   
    pod-template-hash=79f49b58d7 
Annotations:      &lt;none&gt; 
Status:           
Running IP:               10.244.0.42 
IPs:   
IP:           10.244.0.42 
Controlled By:  ReplicaSet/be-simply-depl-79f49b58d7 
Containers:   be-simply:     
Container ID:   containerd://eddf0b34eaeaa8a0223631976d175b1e86d24129300d669a79c217cab4ef5531     
Image:          manelcastro/be-simply     
Image ID:       docker.io/manelcastro/be-simply@sha256:c933ed74ed2d1281e793beb9d4555b8951a5dba3ed21bc8dd27c65e0896e13ea     
Port:           &lt;none&gt;     
Host Port:      &lt;none&gt;     
State:          Waiting       
Reason:       CrashLoopBackOff     
Last State:     Terminated       
Reason:       Error       
Exit Code:    1       
Started:      Tue, 25 Jul 2023 05:18:06 +0000       
Finished:     Tue, 25 Jul 2023 05:18:06 +0000     Ready:          False     Restart Count:  3     
Environment:    &lt;none&gt;     
Mounts:       /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-pnhv2 (ro) 
Conditions:
    Type              Status
    Initialized       True
    Ready             False
    ContainersReady   False
    PodScheduled      True
Volumes:
   kube-api-access-pnhv2:
     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  101s                default-scheduler  Successfully assigned default/be-simply-depl-79f49b58d7-wksms to aks-agentpool-24486413-vmss000000   
Normal   Pulled     101s                kubelet            Successfully pulled image &quot;manelcastro/be-simply&quot; in 749.891764ms (749.897064ms including waiting)   
Normal   Pulled     99s                 kubelet            Successfully pulled image &quot;manelcastro/be-simply&quot; in 735.883614ms (735.889814ms including waiting)   
Normal   Pulled     82s                 kubelet            Successfully pulled image &quot;manelcastro/be-simply&quot; in 728.026859ms (728.037459ms including waiting)   
Normal   Created    53s (x4 over 101s)  kubelet            Created container be-simply  
Normal   Started    53s (x4 over 101s)  kubelet            Started container be-simply  
Normal   Pulled     53s                 kubelet            Successfully pulled image &quot;manelcastro/be-simply&quot; in 733.54339ms (733.55049ms including waiting)   
Warning  BackOff    15s (x8 over 99s)   kubelet            Back-off restarting failed container
</code></pre>
<blockquote>
<p>kubectl logs be-simply-depl-79f49b58d7-wksms</p>
</blockquote>
<pre><code>exec /usr/local/bin/docker-entrypoint.sh: exec format error
</code></pre>
<p>Anybody can shed light on this topic? Thanks</p>

Manel
<p>Finally solved the issue, it was due to a mismatch in the CPU architecture between where I was building the docker image and deploying it. I was building on a Mac and deploying to a x86_64 cloud server</p>
