0

I have created a sample application which needs be run inside a kubernetes cluster. For now I am trying to replicate the same environment in my local machine by using Minikube.

Here I have a .Net Core WebAPI service which need to be connect to a MSSQL database. The service is running inside the cluster my the database is in my local machine. I have also created a service to access my MSSQL database engine which at outside the cluster but in my local machine. Here is my configuration file.

My local ip address is 192.168.8.100.

apiVersion: v1
kind: Service
metadata:
  name: mssql
spec:
    ports:
        - protocol: TCP
          port: 3050
          targetPort: 1433

apiVersion: v1
kind: Endpoints
metadata:
    name: mssql
subsets:
    - addresses:
        - ip: "192.168.8.100"
      ports:
        - port: 1433

Pod Connection String

Server=mssql\MSSQLSERVER2017,3050;Database=product-db;User Id=sa;Password=pwd@123;MultipleActiveResultSets=true;

But with the above configuration, it doesn't seems working and throw a connection error. Can someone please tell me where I am doing wrong.

Thanks in advance.

Daybreaker
  • 1,037
  • 5
  • 20
  • 42
  • Which 'vm-driver' you used to create minikube cluster? Also did you see thise both SO cases: https://stackoverflow.com/questions/50952240/connect-to-local-database-from-inside-minikube-cluster and explanation why you should use specific IP address: https://stackoverflow.com/a/34732276/11148139 ? – PjoterS Apr 09 '20 at 18:27
  • @PjoterS I am using windows. Hyper-V driver – Daybreaker Apr 10 '20 at 06:20
  • Did you configure your firewall rules? Could you provide output of your interfaces? If you would create a ubuntu pod, could you curl anything outside? – PjoterS Apr 13 '20 at 16:57

0 Answers0