<p>I'm trying to deploy my container in a kubernetes cluster but I'm not getting an External ip and hence I'm not able to access the server.</p>
<p>This is my .yaml file:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    kompose.cmd: kompose convert
    kompose.version: 1.21.0 (992df58d8)
  creationTimestamp: null
  labels:
    io.kompose.service: service-app
  name: service-app
spec:
  replicas: 1
  selector:
    matchLabels:
      io.kompose.service: service-app
  strategy: {}
  template:
    metadata:
      annotations:
        kompose.cmd: kompose convert
        kompose.version: 1.21.0 (992df58d8)
      creationTimestamp: null
      labels:
        io.kompose.service: service-app
    spec:
      containers:
      - image: magneto-challengue:1.0
        imagePullPolicy: &quot;&quot;
        name: magneto-challengue
        ports:
        - containerPort: 8080
        resources: {}
      restartPolicy: Always
      serviceAccountName: &quot;&quot;
      volumes: null
status: {}
---
apiVersion: v1
kind: Service
metadata:
  annotations:
    kompose.cmd: kompose convert
    kompose.version: 1.21.0 (992df58d8)
  creationTimestamp: null
  labels:
    io.kompose.service: service-app
  name: service-app
spec:
  ports:
  - name: http
    protocol: TCP
    port: 8080
    targetPort: 8080
  selector:
    io.kompose.service: service-app
    type: NodePort
</code></pre>
<p>When I use the <code>kubectl get svc,deployment,pods</code> command. I'm getting the next response:</p>
<p><a href="https://i.stack.imgur.com/63qyM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/63qyM.png" alt="enter image description here" /></a></p>
<p>As you can see I'm not getting an external Ip. With the <code>kubectl describe service service-app</code> command I'm getting the next response:</p>
<p><a href="https://i.stack.imgur.com/yuBSo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yuBSo.png" alt="enter image description here" /></a></p>
<p>I tried with the <code>10.107.179.10</code> ip, but it didn't work.</p>
<p>Any idea?</p>

rasilvap
<p>You can not use <code>10.107.179.10</code> IP to access a pod from outside kubernetes cluster because that IP is clusterIP and is valid inside the kubernetes cluster and can be used from another pod for example.</p>
<p><code>NodePort</code> type does not get an <code>EXTERNAL-IP</code>. To access a pod from outside the kubernetes cluster via NodePort service you can use <code>NodeIP:NodePort</code> where <code>NodeIP</code> is any of your kubernetes cluster nodes IP address.</p>
