title: How to access a kubernetes service through https?
body: <p>This is my cluster info</p>
  
  <pre><code>kubectl cluster-info
  Kubernetes master is running at https://129.146.10.66:6443
  Heapster is running at https://129.146.10.66:6443/api/v1/proxy/namespaces/kube-system/services/heapster
  KubeDNS is running at https://129.146.10.66:6443/api/v1/proxy/namespaces/kube-system/services/kube-dns
  </code></pre>
  
  <p>So, I have a service(mysqlbrokerservice) running as NodePort and the configuration looks like this</p>
  
  <pre><code>kubectl describe svc mysqlbrokerservice
  Name:                        mysqlbrokerservice
  Namespace:                mysqlbroker
  Labels:                        &lt;none&gt;
  Annotations:                &lt;none&gt;
  Selector:                app=mysqlbroker
  Type:                        NodePort
  IP:                        10.99.194.191
  Port:                        mysqlbroker        8080/TCP
  NodePort:                mysqlbroker        30000/TCP
  Endpoints:                10.244.1.198:8080
  Session Affinity:        None
  Events:                        &lt;none&gt;
  </code></pre>
  
  <p>I can access the service through the public IP of the node where the pod is running like this <a href="http://129.146.34.181:30000/v2/catalog" rel="noreferrer">http://129.146.34.181:30000/v2/catalog</a>.</p>
  
  <p>Then what I wanted to see if I can access the service through https. I followed the direction  in <a href="https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/#manually-constructing-apiserver-proxy-urls" rel="noreferrer">https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/#manually-constructing-apiserver-proxy-urls</a></p>
  
  <p>I followed the example and used curl to get the resource.
  Here is the command. 129.146.10.66:6443 is my master ip.</p>
  
  <pre><code>curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET  https://129.146.10.66:6443/api/v1/namespaces/mysqlbroker/services/mysqlbrokerservice:8080/proxy/v2/catalog --header "Authorization: Bearer $TOKEN" --insecure
  HTTP/1.0 200 Connection established
  </code></pre>
  
  <p>curl just sits there with no response. I then looked at my pod logs and it does not show that any request received.</p>
  
  <p>Can somebody explain what I am doing wrong here? What's the ideal solution if I want a service to be exposed through https?</p>