<p>I've used <a href="https://kompose.io/" rel="nofollow noreferrer">Kompose</a> to translate the following docker-compose to Kubernetes:</p>
<pre><code>---
version: '3'
services:
  freqtrade:
    image: mllamaza/mycoolimg:latest
    restart: unless-stopped
    container_name: mycoolimg
    volumes:
      - &quot;./user_data:/freqtrade/user_data&quot;
    ports:
      - &quot;8080:8080&quot;
    command: &gt;
      start
      --logfile /data/logs/records.log
</code></pre>
<p>If I run <code>docker-compose up -d</code> on it, it works perfectly fine. However, when running the equivalent under Kubernetes, the pod is not able to make any external HTTP/S call throwing this error:</p>
<pre><code>urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='mywebsite.com', port=443): Max retries exceeded with url: /my/cool/url/ (Caused by NewConnectionError('&lt;urllib3.connection.HTTPSConnection object at 0x7f95197d2a30&gt;: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))
</code></pre>
<p>Additionally, the image has a frontend webpage too that can be accessed from <code>http://0.0.0.0:8080</code>.</p>
<p>I use Minikube, and <a href="https://minikube.sigs.k8s.io/docs/handbook/accessing/" rel="nofollow noreferrer">their documentation</a> stays that:</p>
<blockquote>
<p>Services of type <strong>LoadBalancer</strong> can be exposed via the <code>minikube tunnel</code>
command. It must be run in a separate terminal window to keep the
LoadBalancer running.</p>
</blockquote>
<p>That's exactly what I did, that command shows no errors:</p>
<pre><code>❯ minikube tunnel           
[sudo] password for mllamaza: 
Status:
        machine: minikube
        pid: 1513359
        route: 10.96.0.0/12 -&gt; 192.168.49.2
        minikube: Running
        services: []
    errors: 
                minikube: no errors
                router: no errors
                load balancer emulator: no errors
</code></pre>
<p>But, as you can see, the pod has failed because it cannot access external IP's (I checked the logs), and the service/mycoolimg does not have an external IP configured as shown in the documentation:</p>
<pre><code>❯ k get all
NAME                             READY   STATUS             RESTARTS      AGE
pod/mycoolimg-868cdd75bf-krgp6   0/1     CrashLoopBackOff   2 (15s ago)   47s

NAME                 TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)    AGE
service/mycoolimg    ClusterIP   10.105.7.210   &lt;none&gt;        8080/TCP   47s
service/kubernetes   ClusterIP   10.96.0.1      &lt;none&gt;        443/TCP    2d13h

NAME                        READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/mycoolimg   0/1     1            0           47s

NAME                                   DESIRED   CURRENT   READY   AGE
replicaset.apps/mycoolimg-868cdd75bf   1         1         0       47s
</code></pre>
<p>What am I missing? Is this a Kompose conversion issue, and Minikube specific configuration or am I missing some Kubernetes step?</p>
<p>This is the service output:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  annotations:
    kompose.cmd: kompose convert --volumes hostPath -o ./deployment
    kompose.version: 1.26.0 (40646f47)
  creationTimestamp: null
  labels:
    io.kompose.service: mycoolimg
  name: mycoolimg
spec:
  ports:
    - name: &quot;8080&quot;
      port: 8080
      targetPort: 8080
  selector:
    io.kompose.service: mycoolimg
status:
  loadBalancer: {}
</code></pre>
<p>And this the deployment:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    kompose.cmd: kompose convert --volumes hostPath -o ./deployment
    kompose.version: 1.26.0 (40646f47)
  creationTimestamp: null
  labels:
    io.kompose.service: mycoolimg
  name: mycoolimg
spec:
  replicas: 1
  selector:
    matchLabels:
      io.kompose.service: mycoolimg
  strategy:
    type: Recreate
  template:
    metadata:
      annotations:
        kompose.cmd: kompose convert --volumes hostPath -o ./deployment
        kompose.version: 1.26.0 (40646f47)
      creationTimestamp: null
      labels:
        io.kompose.service: mycoolimg
    spec:
      containers:
        - args:
            - start
            - --logfile 
            - /data/logs/records.log
          image: mllamaza/mycoolimg:latest
          name: mycoolimg
          ports:
            - containerPort: 8080
          resources: {}
          volumeMounts:
            - mountPath: /data
              name: mycoolimg-hostpath0
      restartPolicy: Always
      volumes:
        - hostPath:
            path: /udata
          name: mycoolimg-hostpath0
status: {}
</code></pre>

mllamazares
<p>The first thing you should be looking at is the <code>CrashLoopBackOff</code> error on your pod, this is an indication that something is going on in that container which is crashing your pod, you can find a very good article here on how to debug this error <a href="https://releasehub.com/blog/kubernetes-how-to-debug-crashloopbackoff-in-a-container" rel="nofollow noreferrer">1</a>.</p>
<p>Based on the information and code provided the problem seems to be with the application itself; more precisely with the way Docker and Kubernetes handle entrypoints and commands, perhaps an entrypoint was passed as command to Kubernetes or vice versa?</p>
<p>Came to that conclusion after running a pod successfully by replicating your environment but with a different image and taking out the start command:</p>
<pre><code>---
version: '3'
services:
  freqtrade:
    image: expressjs
    restart: unless-stopped
    container_name: mycoolimg
    volumes:
      - &quot;./user_data:/freqtrade/user_data&quot;
    ports:
      - &quot;8080:8080&quot;
#    command: &gt;
#      start
#      --logfile /data/logs/records.log
</code></pre>
<p>using kompose to convert to kubernetes with command <code>kompose convert --volumes hostPath</code> I get the following output:</p>
<pre><code>WARN Restart policy 'unless-stopped' in service freqtrade is not supported, convert it to 'always' 
INFO Kubernetes file &quot;freqtrade-service.yaml&quot; created 
INFO Kubernetes file &quot;freqtrade-deployment.yaml&quot; created 
</code></pre>
<p>Applying the deployment with command <code>kubectl apply -f freqtrade-deployment.yaml</code> and I can see the pod running:</p>
<pre><code>NAME                         READY   STATUS    RESTARTS      AGE
freqtrade-86cd7d4469-dkhmw   1/1     Running   0             7s
</code></pre>
<p>Note: Depending on the method you are using to push/pull your images in minikube <a href="https://minikube.sigs.k8s.io/docs/handbook/pushing/#1-pushing-directly-to-the-in-cluster-docker-daemon-docker-env" rel="nofollow noreferrer">2</a>, you may need to add <code>imagePullPolicy: Never</code> under your containers spec:</p>
<pre><code>    spec:
      containers:
        - image: expressjs
          imagePullPolicy: Never
          name: mycoolimg
          ports:
            - containerPort: 8080
</code></pre>
