<p>Currently processing on this tutorial,
<a href="https://github.com/argoproj/argocd-example-apps/tree/master/guestbook" rel="nofollow noreferrer">https://github.com/argoproj/argocd-example-apps/tree/master/guestbook</a>
<a href="https://argoproj.github.io/argo-cd/getting_started/#5-register-a-cluster-to-deploy-apps-to-optional" rel="nofollow noreferrer">https://argoproj.github.io/argo-cd/getting_started/#5-register-a-cluster-to-deploy-apps-to-optional</a></p>

<p>My short-term milestone is to render guest-book's UI on browser.
I'm trying to connect via Ingress, and it went wrong.</p>

<p>Error message's like this,</p>

<pre><code>Status: 502
The server encountered a temporary error and could not complete your request.
</code></pre>

<p>I suppose something's wrong around service and pod.</p>

<p>guestbook-ui-svc.yaml</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: guestbook-ui-service
spec:
  ports:
    - port: 80
      targetPort: 80
  selector:
    app: guestbook-ui
</code></pre>

<p><strong>guestbook-ui-ingress.yaml</strong></p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: app-ingress
  labels:
    app: guestbook-ui
spec:
  rules:
    - http:
        paths:
          - path: /
            backend:
              serviceName: guestbook-ui-service
              servicePort: 80
</code></pre>

<p><strong>guestbook-ui-deployment.yaml</strong></p>

<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: guestbook-ui
spec:
  replicas: 1
  revisionHistoryLimit: 3
  selector:
    matchLabels:
      app: guestbook-ui
  template:
    metadata:
      labels:
        app: guestbook-ui
    spec:
      containers:
      - image: gcr.io/heptio-images/ks-guestbook-demo:0.2
        name: guestbook-ui
        ports:
        - containerPort: 80
</code></pre>

<p>I don't know which part I am missing, please lmk any ambiguous part or more detail.
Thanks, in advance!</p>

<p>Use this <code>service</code> instead.</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: guestbook-ui-service
spec:
  type: NodePort
  ports:
    - port: 80
      targetPort: 80
  selector:
    app: guestbook-ui
</code></pre>

<p>It has <code>type: NodePort</code> added to it.</p>

<p>You can check really good example on how to deploy an app, expose it via a service and add an ingress to it. It's available in kubernetes docs <a href="https://kubernetes.io/docs/tasks/access-application-cluster/ingress-minikube/#deploy-a-hello-world-app" rel="nofollow noreferrer">Deploy a hello, world app</a>.</p>

<p>Also if you are having problem understanding the difference between <code>NodePort</code>, <code>ClusterIP</code> and what <code>Ingress</code> is I recommend reading <a href="https://medium.com/google-cloud/kubernetes-nodeport-vs-loadbalancer-vs-ingress-when-should-i-use-what-922f010849e0" rel="nofollow noreferrer">Kubernetes NodePort vs LoadBalancer vs Ingress? When should I use what?</a></p>
