<p>I'm following this tutorial on Microservices
<a href="https://www.youtube.com/watch?v=DgVjEo3OGBI" rel="nofollow noreferrer">https://www.youtube.com/watch?v=DgVjEo3OGBI</a></p>
<p>At some point, I deploy a SQL Server image in Kubernetes, using this Yaml file:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: mssql-depl
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mssql
  template:
    metadata:
      labels:
        app: mssql
    spec:
      containers:
        - name: mssql
          image: mcr.microsoft.com/mssql/server:2019-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: mssql5 
                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-srv
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>And the PVC.yaml:</p>
<pre><code>apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: mssql-claim
spec:
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 200Mi
</code></pre>
<p>I then create a secret in Kubernets, holding the password for the SQL Server sa account, and this secret is then used in the Yaml file.</p>
<pre><code>kubectl create secret generic mssql5 --from-literal=SA_PASSWORD=&quot;MyC0m9l&amp;xPassw0rd&quot;
</code></pre>
<p>It should then be possible to connect directly to the SQL Server container on localhost port 1433, using the sa account and the password.</p>
<p>However, I get the &quot;Login failed for user SA&quot; error when trying to connect. I've tried everything, including changing SA_PASSWORD to MSSQL_SA_PASSWORD, changing the complexity of the password, enabling login for the sa user in  SQL Server, which was disabled before and googled like I've never googled before. TCP/IP setting is enabled in SQL Server configuration manager. I cannot get access. Can anyone shed some light on this issue?</p>

Soeren
<p><a href="https://i.stack.imgur.com/jt0c4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jt0c4.png" alt="enter image description here" /></a>
if you turn off that service then it will work</p>
