Answers: <p><code>https://wso2-apim-gateway/</code> is the URL that will point to the <code>gateway</code> service according to your configuration. This is defined by the <code>host: wso2-apim-gateway</code> part of your configuration. Note that your load balancer (<code>172.17.17.100</code>) is a private IP address, so you will need to be on the same network to access it.</p>
  
  <p>I can't see any further configuration required, except perhaps TLS certifications - if you receive a 5xx response, you may want to check the logs of the ingress-nginx deployment/replicaset.</p>
  
Answers: CC BY-SA 4.0
Answers: 2018-12-23T03:35:21.347Z
Answers: Yes. The problem was with the external IP of the nodeport I was using. I edited it to the actual IP of the remote host it was running and also replaced the entry in /etc/hosts with that IP and things worked well.
Answers: Pasan W.
Answers: CC BY-SA 4.0
Answers: 2018-12-21T07:51:22.790Z
Answers: 2018-12-21T09:43:03.160Z
Answers: 2018-12-21T09:43:03.160Z
Answers: user2640621
Body: <p>I'm attempting to access a service in an existing kubernetes cluster deployed in a remote machine. I've configured the cluster to be accessible through <code>kubectl</code> from my local mac.</p>
  
  <pre><code>$ kubectl cluster-info
  Kubernetes master is running at https://192.168.58.114:6443
  KubeDNS is running at https://192.168.58.114:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
  </code></pre>
  
  <p>The ingress configuration for the service I want to connect is:</p>
  
  <pre><code>kind: Ingress
  apiVersion: extensions/v1beta1
  metadata:
    name: gw-ingress
    namespace: vick-system
    selfLink: /apis/extensions/v1beta1/namespaces/vick-system/ingresses/gw-ingress
    uid: 52b62da6-01c1-11e9-9f59-fa163eb296d8
    resourceVersion: '2695'
    generation: 1
    creationTimestamp: '2018-12-17T06:02:23Z'
    annotations:
      kubectl.kubernetes.io/last-applied-configuration: &gt;
        {"apiVersion":"extensions/v1beta1","kind":"Ingress","metadata":{"annotations":{"kubernetes.io/ingress.class":"nginx","nginx.ingress.kubernetes.io/affinity":"cookie","nginx.ingress.kubernetes.io/session-cookie-hash":"sha1","nginx.ingress.kubernetes.io/session-cookie-name":"route"},"name":"gw-ingress","namespace":"vick-system"},"spec":{"rules":[{"host":"wso2-apim-gateway","http":{"paths":[{"backend":{"serviceName":"gateway","servicePort":8280},"path":"/"}]}}],"tls":[{"hosts":["wso2-apim-gateway"]}]}}
      kubernetes.io/ingress.class: nginx
      nginx.ingress.kubernetes.io/affinity: cookie
      nginx.ingress.kubernetes.io/session-cookie-hash: sha1
      nginx.ingress.kubernetes.io/session-cookie-name: route
  spec:
    tls:
      - hosts:
          - wso2-apim-gateway
    rules:
      - host: wso2-apim-gateway
        http:
          paths:
            - path: /
              backend:
                serviceName: gateway
                servicePort: 8280
  status:
    loadBalancer:
      ingress:
        - ip: 172.17.17.100
  </code></pre>
  
  <p>My list of services are:
  <a href="https://i.sstatic.net/BpjIu.png" rel="noreferrer"><img src="https://i.sstatic.net/BpjIu.png" alt="enter image description here"></a></p>
  
  <p>My <code>/etc/hosts</code> file looks like below:</p>
  
  <pre><code>##
  # Host Database
  #
  # localhost is used to configure the loopback interface
  # when the system is booting.  Do not change this entry.
  ##
  127.0.0.1   localhost
  255.255.255.255 broadcasthost
  ::1             localhost
  
  172.17.17.100 wso2-apim-gateway wso2-apim wso2sp-dashboard
  </code></pre>
  
  <p>What is the URL I should use to access this service from my local browser? Should I do any more configurations?</p>
  
Tags: <kubernetes>
Title: Access service in remote Kubernetes cluster using ingress
UserDisplayName: Pasan W.
ThreadText: # Access service in remote Kubernetes cluster using ingress
  
  (Asked by: username_0 on 2018-12-17)
  
  I'm attempting to access a service in an existing kubernetes cluster deployed in a remote machine. I've configured the cluster to be accessible through `kubectl` from my local mac.
  
  ```
  $ kubectl cluster-info
  Kubernetes master is running at https://192.168.58.114:6443
  KubeDNS is running at https://192.168.58.114:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
  
  ```
  
  The ingress configuration for the service I want to connect is:
  
  ```
  kind: Ingress
  apiVersion: extensions/v1beta1
  metadata:
    name: gw-ingress
    namespace: vick-system
    selfLink: /apis/extensions/v1beta1/namespaces/vick-system/ingresses/gw-ingress
    uid: 52b62da6-01c1-11e9-9f59-fa163eb296d8
    resourceVersion: '2695'
    generation: 1
    creationTimestamp: '2018-12-17T06:02:23Z'
    annotations:
      kubectl.kubernetes.io/last-applied-configuration: >
        {"apiVersion":"extensions/v1beta1","kind":"Ingress","metadata":{"annotations":{"kubernetes.io/ingress.class":"nginx","nginx.ingress.kubernetes.io/affinity":"cookie","nginx.ingress.kubernetes.io/session-cookie-hash":"sha1","nginx.ingress.kubernetes.io/session-cookie-name":"route"},"name":"gw-ingress","namespace":"vick-system"},"spec":{"rules":[{"host":"wso2-apim-gateway","http":{"paths":[{"backend":{"serviceName":"gateway","servicePort":8280},"path":"/"}]}}],"tls":[{"hosts":["wso2-apim-gateway"]}]}}
      kubernetes.io/ingress.class: nginx
      nginx.ingress.kubernetes.io/affinity: cookie
      nginx.ingress.kubernetes.io/session-cookie-hash: sha1
      nginx.ingress.kubernetes.io/session-cookie-name: route
  spec:
    tls:
      - hosts:
          - wso2-apim-gateway
    rules:
      - host: wso2-apim-gateway
        http:
          paths:
            - path: /
              backend:
                serviceName: gateway
                servicePort: 8280
  status:
    loadBalancer:
      ingress:
        - ip: 172.17.17.100
  
  ```
  
  My list of services are:
  [![enter image description here](https://i.sstatic.net/BpjIu.png)](https://i.sstatic.net/BpjIu.png)
  
  My `/etc/hosts` file looks like below:
  
  ```
  ##
  # Host Database
  #
  # localhost is used to configure the loopback interface
  # when the system is booting.  Do not change this entry.
  ##
  127.0.0.1   localhost
  255.255.255.255 broadcasthost
  ::1             localhost
  
  172.17.17.100 wso2-apim-gateway wso2-apim wso2sp-dashboard
  
  ```
  
  What is the URL I should use to access this service from my local browser? Should I do any more configurations?
  
  **Tags:** kubernetes
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-12-21. Score: 3 | Accepted answer
  
  `https://wso2-apim-gateway/` is the URL that will point to the `gateway` service according to your configuration. This is defined by the `host: wso2-apim-gateway` part of your configuration. Note that your load balancer (`172.17.17.100`) is a private IP address, so you will need to be on the same network to access it.
  
  I can't see any further configuration required, except perhaps TLS certifications - if you receive a 5xx response, you may want to check the logs of the ingress-nginx deployment/replicaset.
  
  > **Comments:**
  > **username_0**: Yes. The problem was with the external IP of the nodeport I was using. I edited it to the actual IP of the remote host it was running and also replaced the entry in /etc/hosts with that IP and things worked well.  
  
  ---
  
  