<p>I am working my way through a kubernetes tutorial using GKE, but it was written with Azure in mind - tho it has been working ok so far.</p>
<p>The first part where it has not worked has been with exercises regarding coreDNS - which I understand does not exist on GKE - it's kubedns only?</p>
<p>Is this why I can't get a pod endpoint with:</p>
<pre><code>export PODIP=$(kubectl get endpoints hello-world-clusterip -o jsonpath='{ .subsets[].addresses[].ip}')
</code></pre>
<p>and then curl:</p>
<pre><code>curl http://$PODIP:8080
</code></pre>
<p>My deployment is definitely on the right port:</p>
<pre><code>ports:
        - containerPort: 8080
</code></pre>
<p>And, in fact, the deployment for the tut is from a google sample.</p>
<p>Is this to do with coreDNS or authorisation/needing a service account? What can I do to make the curl request work?</p>
<p>Deployment yaml is:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: hello-world-customdns
spec:
  replicas: 3
  selector:
    matchLabels:
      app: hello-world-customdns
  template:
    metadata:
      labels:
        app: hello-world-customdns
    spec:
      containers:
      - name: hello-world
        image: gcr.io/google-samples/hello-app:1.0
        ports:
        - containerPort: 8080
      dnsPolicy: &quot;None&quot;
      dnsConfig:
        nameservers:
          - 9.9.9.9
---
apiVersion: v1
kind: Service
metadata:
  name: hello-world-customdns
spec:
  selector:
    app: hello-world-customdns
  ports:
  - port: 80
    protocol: TCP
    targetPort: 8080
</code></pre>

Davtho1983
<p>Having a deeper insight on what Gari comments, when exposing a service outside your cluster, this services must be configured as <strong>NodePort</strong> or <strong>LoadBalancer</strong>, since <strong>ClusterIP</strong> only exposes the Service on a cluster-internal IP making the service only reachable from within the cluster, and since Cloud Shell is a a shell environment for managing resources hosted on Google Cloud, and not part of the cluster, that's why you're not getting any response. To change this, you can change your yaml file with the following:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: hello-world-customdns
spec:
  replicas: 3
  selector:
    matchLabels:
      app: hello-world-customdns
  template:
    metadata:
      labels:
        app: hello-world-customdns
    spec:
      containers:
      - name: hello-world
        image: gcr.io/google-samples/hello-app:1.0
        ports:
        - containerPort: 8080
      dnsPolicy: &quot;None&quot;
      dnsConfig:
        nameservers:
          - 9.9.9.9
---
apiVersion: v1
kind: Service
metadata:
  name: hello-world-customdns
spec:
  selector:
    app: hello-world-customdns
  type: NodePort
  ports:
  - port: 80
    protocol: TCP
    targetPort: 8080
</code></pre>
<p>After redeploying your service, you can run command <code>kubectl get all -o wide</code> on <strong>cloud shell</strong> to validate that NodePort type service has been created with a node and target port.</p>
<p>To test your deployment just throw a CURL test to he external IP from one of your nodes incluiding the node port that was assigned, the command should look like something like:</p>
<p><code>curl &lt;node_IP_address&gt;:&lt;Node_port&gt;</code></p>
