apiVersion: apps/v1
kind: Deployment
metadata:
  name: mssql
spec:
  selector:
    matchLabels:
      app: mssql
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  replicas: 1
  template:
    metadata:
      labels:
        app: mssql
    spec:
      securityContext:
        runAsUser: 1000
        runAsGroup: 3000
        fsGroup: 2000
      containers:
      - name: mssql
        image: mcr.microsoft.com/mssql/server
        imagePullPolicy: "IfNotPresent"
        ports:
        - containerPort: 1433
        env:
        - name: ACCEPT_EULA
          value: "Y"
        - name: SA_PASSWORD
          value:  "P@ssw0rd"
        volumeMounts:
        - mountPath: /var/opt/mssql
          name: mssqldb
      volumes:
      - name: mssqldb
        persistentVolumeClaim:
          claimName: mssql-data
