apiVersion: apps/v1
kind: Deployment
metadata:
  name: mssql-sample-deployment
spec:
  selector:  
    matchLabels:
      app: mssql-sample-deployment
      tier: database
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: mssql-sample-deployment
        tier: database
    spec:
      terminationGracePeriodSeconds: 10
      containers:
      - image: mcr.microsoft.com/mssql/server:2017-CU24-ubuntu-16.04
        name: mssql
        ports:
        - containerPort: 1433
        env:
        - name: ACCEPT_EULA
          value: "Y"
        - name: SA_PASSWORD
          valueFrom:
            secretKeyRef:
              name: mssql-sample-secret
              key: SA_PASSWORD
        volumeMounts:
        - name: mssql-persistent-storage
          mountPath: /var/opt/mssql
      volumes:
      - name: mssql-persistent-storage
        persistentVolumeClaim:
          claimName: mssql-sample-data-claim
