Skip to main content

Connecting

Connecting to a database created by the MSSQL Provider is the same as connecting to any instance managed by the MSSQL Operator — the provider creates the underlying operator resource and its Services.

Services​

TopologyService to useNotes
Standalone<name> (headless) or <name>-exposedUse <name>-exposed when a serviceType other than ClusterIP is set.
Availability Group<name>-primary (read-write)Follows failover to the current primary.
Availability Group<name>-replicas (read-only)Routes to readable secondaries.

Connection details​

Once the Instance is ready, the provider publishes its connection details in the Secret <name>-conn:

KeyValue
type / providermssql
hostHost to connect to: the operator-reported address (the external one when the Service is exposed), otherwise the in-cluster DNS name of <name> (standalone) or <name>-primary (Availability Group)
port1433
usernamesa
passwordSA password
urisqlserver://sa:<password>@<host>:1433, with the password URL-encoded
readOnlyHostAvailability Group only: the read-only <name>-replicas Service
kubectl get secret <name>-conn -o jsonpath='{.data.uri}' | base64 -d

Retrieve the SA password​

The provider stores the SA password in the Secret everest-secrets-<name>. Retrieve it with:

kubectl get secret everest-secrets-<name> -o jsonpath='{.data.MSSQL_SA_PASSWORD}' | base64 -d

Connect​

For port-forwarding, sqlcmd examples, LoadBalancer/NodePort access, and TLS certificate trust, follow the operator's Connecting guide — everything there applies to provider-managed instances.

kubectl port-forward svc/<name>-primary 1433:1433
sqlcmd -S "tcp:localhost,1433" -U sa -P "$SA_PASSWORD" -C -Q "SELECT @@VERSION"