<p>I am running minikube on MacOS, and want to expose the ip address and port for running this example helm chart -
<a href="https://docs.bitnami.com/kubernetes/how-to/create-your-first-helm-chart/" rel="nofollow noreferrer">https://docs.bitnami.com/kubernetes/how-to/create-your-first-helm-chart/</a></p>

<p>I tried to ping the localhost:58064, but it wouldn't connect.</p>

<pre><code>helm install --dry-run --debug ./mychart --set service.internalPort=8080
[debug] Created tunnel using local port: '58064'

[debug] SERVER: "127.0.0.1:58064"

[debug] Original chart version: ""
[debug] CHART PATH: /Users/me/Desktop/HelmTest/mychart

NAME:   messy-penguin
REVISION: 1
RELEASED: Tue Jun 12 17:56:41 2018
CHART: mychart-0.1.0
USER-SUPPLIED VALUES:
service:
  internalPort: 8080

COMPUTED VALUES:
affinity: {}
image:
  pullPolicy: IfNotPresent
  repository: nginx
  tag: stable
ingress:
  annotations: {}
  enabled: false
  hosts:
  - chart-example.local
  path: /
  tls: []
nodeSelector: {}
replicaCount: 1
resources: {}
service:
  internalPort: 8080
  port: 80
  type: ClusterIP
tolerations: []

HOOKS:
MANIFEST:

---
# Source: mychart/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
  name: messy-penguin-mychart
  labels:
    app: mychart
    chart: mychart-0.1.0
    release: messy-penguin
    heritage: Tiller
spec:
  type: ClusterIP
  ports:
    - port: 80
      targetPort: http
      protocol: TCP
      name: http
  selector:
    app: mychart
    release: messy-penguin
---
# Source: mychart/templates/deployment.yaml
apiVersion: apps/v1beta2
kind: Deployment
metadata:
  name: messy-penguin-mychart
  labels:
    app: mychart
    chart: mychart-0.1.0
    release: messy-penguin
    heritage: Tiller
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mychart
      release: messy-penguin
  template:
    metadata:
      labels:
        app: mychart
        release: messy-penguin
    spec:
      containers:
        - name: mychart
          image: "nginx:stable"
          imagePullPolicy: IfNotPresent
          ports:
            - name: http
              containerPort: 80
              protocol: TCP
          livenessProbe:
            httpGet:
              path: /
              port: http
          readinessProbe:
            httpGet:
              path: /
              port: http
          resources:
            {}
MacBook-Pro:~/Desktop/HelmTest quantum-fusion$ curl 127.0.0.1:58064
curl: (7) Failed to connect to 127.0.0.1 port 58064: Connection refused
</code></pre>

joe the coder
<p>Because <code>minikube</code> is from the docker-machine family, running <code>minikube ip</code> will output the IP address of the virtual machine, and <strong>that</strong> is the IP upon which you should attempt to contact your cluster, not localhost.</p>

<p>Furthermore, <code>[debug] Created tunnel using local port: '58064'</code> is <strong>helm</strong> making a tunnel to the embedded <code>tiller</code> Pod inside your cluster, and is not anything that you should be using at all. That's actually why it is prefixed with <code>[debug]</code>: because it is only useful for extreme circumstances.</p>

<p>Finally, you will need to use <code>kubectl port-forward</code> to reach your deployed Pod since the <code>Service</code> is using a <code>ClusterIP</code>, which as its name implies is only valid inside the cluster. You can also create a second <code>Service</code> of <code>type: NodePort</code> and it will allocate a TCP/IP port on the virtual machine's IP that routes to the <code>port:</code> of the <code>Service</code>. You <em>may</em> be able to inform your Helm chart to do that for you, depending on whether the author exposed that kind of decision through the chart's <code>values.yaml</code>.</p>

<p>The other "asterisk" to that <code>port-forward</code> versus <code>Service</code> of <code>type: NodePort</code> part is that I see in the output a mention of an <code>Ingress</code> resource for <code>chart-example.local</code>, but that pragmatically is only meaningful if you have a running "ingress controller," but if you do, then it <em>already</em> has a TCP/IP port upon which you should contact your cluster, just ensuring that you provide the connection with a <code>curl -H "host: chart-example.local" http://$(minikube ip):${the_ingress_port}</code> so that the ingress controller can route the request to the correct <code>Ingress</code>.</p>
