Having:
An Openshift Cluster version 4.8.18 running on the Azure Openshift Service
A Project in the cluster running a SQL Server 2019 Instance created via
oc new-app
like so:oc new-app mcr.microsoft.com/mssql/server:2019-latest -e ACCEPT_EULA=Y -e SA_PASSWORD="securepa$$@asdf" --name sqlserver
The instance starts properly according to the pod logs and openshift reports OK readiness and liveliness
By connecting via
oc rsh
directly to the container, I am able to interact with the database viasqlcmd
I am trying to connect to the database instance with SSMS v18.10 on Windows 10 via the kubernetes port-forwarding mechanism following this post without success:
oc port-forward pod/sqlserver-aaaaaaaaa-aaaaa 1433:1433
Connections on localhost from SSMS with correct credentials always result in the following error:
Cannot connect to localhost.
Additional information:
A network-related or instance-specific error occured while establishing a connection to SQL Server.
...
Note that:
- I am trying to connect while the
oc port-forward
is running - I tried disabling the Windows 10 firewall and trying to connect without success
- I tried port forwarding from a web application and it worked with the firewall on with the same cluster
What am I missing here?
UPDATE 1
I have been able to connect to the SQL Server Instance by creating a service
of type LoadBalancer
via the External IP created by the service.
127.0.0.1,1433
?containerPort: 1433
. Are you sure you don't need to do something like that withoc new-app
?localhost
, I will give a try to127.0.0.1,1433
oc new-app
I am able to confirm that the port exposed on the pod is 1433