<p>i'm trying to test locally some microservices .NET Core with Minikube.
I've 2 microservices that comunicate with each other and with a container with mssql by clusterIP.
It works all fine, but i can't connect directly to mssql from SQL Management Studio.</p>
<p>Here the deployment of mssql:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: mssql-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mssql
  template:
    metadata:
      labels:
        app: mssql
    spec:
      containers:
      - name: mssql
        image: mcr.microsoft.com/mssql/server:2017-latest
        ports:
        - containerPort: 1433
        env:
        - name: MSSQL_PID
          value: &quot;Express&quot;
        - name: ACCEPT_EULA
          value: &quot;Y&quot;
        - name: SA_PASSWORD
          valueFrom: 
            secretKeyRef:
              name: mssql
              key: SA_PASSWORD
        volumeMounts:
          - mountPath: /var/opt/mssql/data
            name: mssqldb
      volumes:
        - name: mssqldb
          persistentVolumeClaim:
            claimName: mssql-claim
---
apiVersion: v1
kind: Service
metadata: 
  name: mssql-clusterip-service
spec:
  type: ClusterIP
  selector:
    app: mssql
  ports: 
    - name: mssql
      protocol: TCP
      port: 1433
      targetPort: 1433
---
apiVersion: v1
kind: Service
metadata: 
  name: mssql-loadbalancer
spec:
  type: LoadBalancer
  selector:
    app: mssql
  ports: 
   -  protocol: TCP
      port: 1433
      targetPort: 1433
</code></pre>
<p>I've tried also with NodePort but i can't access it by &quot;localhost, 1433&quot;
Any idea of how can i access it externally?</p>
<p>Thanks</p>

user1477747
<p>There is a different way to access your app from external world. If you use the <code>LoadBalancer</code> type service then you can do the following steps to access your app from external(for only minikube):</p>
<ol>
<li>Run the below command in different terminal:</li>
</ol>
<pre><code>minikube tunnel
</code></pre>
<ol start="2">
<li>Get the services</li>
</ol>
<pre><code>kubectl get svc
</code></pre>
<p>The output looks like:</p>
<pre><code>$ kubectl get svc
NAME                 TYPE           CLUSTER-IP      EXTERNAL-IP     PORT(S)          AGE
kubernetes           ClusterIP      10.96.0.1       &lt;none&gt;          443/TCP          20m
mssql-loadbalancer   LoadBalancer   10.102.149.78   10.102.149.78   1433:30373/TCP   16s
</code></pre>
<ol start="3">
<li>open in your browser (make sure there is no proxy set)</li>
</ol>
<pre><code>http://REPLACE_WITH_EXTERNAL_IP:1443
</code></pre>
<p>You can also use a port-forwarding mechanism to access your app like:</p>
<pre><code>kubectl port-forward service/&lt;your service&gt; 1443:1443
</code></pre>
<p>Ref: <a href="https://minikube.sigs.k8s.io/docs/handbook/accessing/" rel="nofollow noreferrer">https://minikube.sigs.k8s.io/docs/handbook/accessing/</a></p>
