<p>We have installed consul through helm charts on k8 cluster. Here, I have deployed one consul server and the rest are consul agents.</p>

<pre><code>kubectl get pods
NAME                                                          READY     STATUS      RESTARTS   AGE
consul-7csp9                                                  1/1       Running     0          4h
consul-connect-injector-webhook-deployment-66d46867f6-wqtt7   1/1       Running     0          4h
consul-server-0                                               1/1       Running     0          4h
consul-sync-catalog-85f5654b89-9qblx                          1/1       Running     0          4h
consul-x4mqq                                                  1/1       Running     0          4h
</code></pre>

<p>We see that the nodes are registered onto the Consul Server. <a href="http://XX.XX.XX.XX/ui/kube/nodes" rel="nofollow noreferrer">http://XX.XX.XX.XX/ui/kube/nodes</a></p>

<p>We have deployed an hello world application onto k8 cluster. This will bring-up Hello-World </p>

<pre><code>kubectl get pods
NAME                                                          READY     STATUS      RESTARTS   AGE
consul-7csp9                                                  1/1       Running     0          4h
consul-connect-injector-webhook-deployment-66d46867f6-wqtt7   1/1       Running     0          4h
consul-server-0                                               1/1       Running     0          4h
consul-sync-catalog-85f5654b89-9qblx                          1/1       Running     0          4h
consul-x4mqq                                                  1/1       Running     0          4h
sampleapp-69bf9f84-ms55k                                      2/2       Running     0          4h
</code></pre>

<p>Below is the yaml file.</p>

<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: sampleapp
spec:
  replicas: 1
selector:
matchLabels:
  app: sampleapp
template:
  metadata:
    labels:
      app: sampleapp
    annotations:
      "consul.hashicorp.com/connect-inject": "true"
  spec:
    containers:
    - name: sampleapp
      image: "docker-dev-repo.aws.com/sampleapp-java/helloworld-service:a8c9f65-65"
      ports:
      - containerPort: 8080
        name: http
</code></pre>

<p>Successful deployment of sampleapp, I see that sampleapp-proxy is registered in consul. and sampleapp-proxy is listed in kubernetes services. (This is because the toConsul and toK8S are passed as true during installation)</p>

<pre><code>kubectl get services
NAME                          TYPE           CLUSTER-IP     EXTERNAL-IP                      PORT(S)                                                                   AGE
consul                        ExternalName   &lt;none&gt;         consul.service.test              &lt;none&gt;                                                                    4h
consul-connect-injector-svc   ClusterIP      XX.XX.XX.XX    &lt;none&gt;                           443/TCP                                                                   4h
consul-dns                    ClusterIP      XX.XX.XX.XX    &lt;none&gt;                           53/TCP,53/UDP                                                             4h
consul-server                 ClusterIP      None           &lt;none&gt;                           8500/TCP,8301/TCP,8301/UDP,8302/TCP,8302/UDP,8300/TCP,8600/TCP,8600/UDP   4h
consul-ui                     LoadBalancer   XX.XX.XX.XX    XX.XX.XX.XX                      80:32648/TCP                                                              4h
dns-test-proxy                ExternalName   &lt;none&gt;         dns-test-proxy.service.test      &lt;none&gt;                                                                    2h
fluentd-gcp-proxy             ExternalName   &lt;none&gt;         fluentd-gcp-proxy.service.test   &lt;none&gt;                                                                    33m
kubernetes                    ClusterIP      XX.XX.XX.XX    &lt;none&gt;                           443/TCP                                                                   5d
sampleapp-proxy               ExternalName   &lt;none&gt;         sampleapp-proxy.service.test     &lt;none&gt;                                                                    4h
</code></pre>

<p>How can I access my sampleapp? Should I expose my application as kube service again? </p>

<p>Earlier, without consul, we used a create a service for the sampleapp and expose the service as ingress. Using the Ingress Loadbalancer, we used to access our application. </p>

<p>Consul does not provide any new ways to expose your apps. You need to create ingress Loadbalancer as before.</p>
