Created
October 28, 2021 07:48
-
-
Save cosminilie/0d514bff55cab657493fd8dffa775bfe to your computer and use it in GitHub Desktop.
sqlserver_k8s.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: mssqld | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: mssql | |
strategy: | |
type: Recreate | |
template: | |
metadata: | |
labels: | |
app: mssql | |
spec: | |
securityContext: | |
fsGroup: 10001 | |
containers: | |
- name: mssql | |
image: 'mcr.microsoft.com/mssql/server:2017-latest' | |
ports: | |
- containerPort: 1433 | |
env: | |
- name: ACCEPT_EULA | |
value: "Y" | |
- name: MSSQL_PID | |
value: "Express" | |
- name: SA_PASSWORD | |
valueFrom: | |
secretKeyRef: | |
name: mssql | |
key: SA_PASSWORD | |
volumeMounts: | |
- name: mssql-system | |
mountPath: /var/opt/mssql | |
- name: mssql-backup | |
mountPath: /mnt | |
volumes: | |
- name: mssql-system | |
hostPath: | |
path: /tmp/data | |
type: DirectoryOrCreate | |
- name: mssql-backup | |
hostPath: | |
path: /tmp/backup | |
type: DirectoryOrCreate | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: mssqld | |
spec: | |
selector: | |
app: mssql | |
ports: | |
- protocol: TCP | |
port: 1433 | |
targetPort: 1433 | |
type: ClusterIP | |
--- | |
apiVersion: v1 | |
kind: Secret | |
metadata: | |
name: mssql | |
type: Opaque | |
data: | |
SA_PASSWORD: xxxxxxSomePassword!21 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment