<p>I deployed a MySQL pod with the example from the kubernetes website: <a href="https://kubernetes.io/docs/tasks/run-application/run-single-instance-stateful-application/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/run-application/run-single-instance-stateful-application/</a></p>
<p>I can access the pod from the pod network but not from outside the cluster, how can I achieve this? I would want to access the service via MySQL Workbench for easier editing of the Database.</p>
<p>I already tried to setup a NodePort service like this:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: mysql
spec:
  ports:
  - port: 3306
    targetPort: 3006
    nodePort: 30003
  selector:
    app: mysql
  type: NodePort
</code></pre>
<p>with the goal to access the service at :30003 but that does not work.</p>

Herry
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: mysql
spec:
  ports:
  - port: 3306
    targetPort: 3006
    nodePort: 30003
  selector:
    app: mysql
  type: NodePort
</code></pre>
<p>the targetPort is 3006 instead of 3306, it was a typo.</p>
