Skip to content

Instantly share code, notes, and snippets.

@nocentino
Last active September 12, 2021 17:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nocentino/cceb1c999459f25f76029d85e9fed2d3 to your computer and use it in GitHub Desktop.
Save nocentino/cceb1c999459f25f76029d85e9fed2d3 to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mssql-data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 8Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mssql-deployment
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: mssql
template:
metadata:
labels:
app: mssql
spec:
terminationGracePeriodSeconds: 30
hostname: sqldemo1
securityContext:
fsGroup: 10001
containers:
- name: mssql
image: mcr.microsoft.com/mssql/server:2019-latest
ports:
- containerPort: 1433
env:
- name: MSSQL_PID
value: "Developer"
- name: ACCEPT_EULA
value: "Y"
- name: SA_PASSWORD
valueFrom:
secretKeyRef:
name: mssql
key: SA_PASSWORD
volumeMounts:
- name: mssqldb
mountPath: /var/opt/mssql/
- name: mssqlconf
mountPath: /var/opt/mssql/mssql.conf
subPath: mssql.conf
volumes:
- name: mssqldb
persistentVolumeClaim:
claimName: mssql-data
- name: mssqlconf
configMap:
name: mssqlconf
---
apiVersion: v1
kind: Service
metadata:
name: mssql-deployment
spec:
selector:
app: mssql
ports:
- protocol: TCP
port: 31433
targetPort: 1433
type: LoadBalancer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment