This commit is contained in:
jamesongithub@users.noreply.github.com 2022-05-10 20:05:43 -07:00
Родитель e1f7aa8b7a
Коммит e31c7f5e46
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 84C159EEAE8BE65D
9 изменённых файлов: 95 добавлений и 72 удалений

2
linux/rancher/.gitignore поставляемый
Просмотреть файл

@ -1 +1 @@
jy-sql.yaml
jy-sql.yaml

Просмотреть файл

@ -1,5 +1,5 @@
questions:
- variable: "mssql.conf.eula.accepteula"
- variable: mssql.conf.eula.accepteula
label: Accept the SQL Server EULA
# no current support for html
# description: Accepts the SQL Server <a href="http://go.microsoft.com/fwlink/?LinkId=746388">EULA</a> (any value confirms acceptance).
@ -15,7 +15,7 @@ questions:
default: false
group: SQL Server options
- variable: "mssql.pid"
- variable: mssql.pid
label: SQL Server Edition aka. MSSQL_PID
description: Select a SQL Server Edition
type: enum
@ -31,14 +31,14 @@ questions:
show_if: USE_PRODUCT_KEY=false
group: SQL Server options
- variable: "mssql.pid"
- variable: mssql.pid
label: SQL Server License Key
description: Enter a Product Key of the format "#####-#####-#####-#####-#####"
required: true
show_if: USE_PRODUCT_KEY=true
group: SQL Server options
- variable: "mssql.sa.password"
- variable: mssql.sa.password
label: MSSQL SA user password
description: Sets the SA user password. Password requirements @ https://docs.microsoft.com/en-us/sql/relational-databases/security/password-policy?view=sql-server-ver15#password-complexity
type: password
@ -49,7 +49,12 @@ questions:
required: true
group: SQL Server options
- variable: "mssql.conf.sqlagent.enabled"
- variable: mssql.conf.lcid
label: SQL Server Locale
description: Sets SQL Server Locale
group: SQL Server options
- variable: mssql.conf.sqlagent.enabled
label: Enable SQL Server Agent
description: Enables the SQL Server Agent
type: boolean
@ -63,43 +68,40 @@ questions:
show_subquestion_if: false
group: Container Image Options
subquestions:
- variable: image.repository
default: mcr.microsoft.com/mssql/server
- variable: statefulset.template.spec.containers.sqlServer.image.repository
description: Image Repository
label: Image Repository
- variable: image.pullPolicy
default: IfNotPresent
- variable: statefulset.template.spec.containers.sqlServer.image.pullPolicy
label: Image Pull Policy
type: enum
options:
- IfNotPresent
- Always
- Never
- variable: image.tag
default: 2019-latest
- variable: statefulset.template.spec.containers.sqlServer.image.tag
label: Image Tag
- variable: podSecurityContext.fsGroup
- variable: statefulset.template.spec.securityContext.fsGroup
description: |
Specifies a supplementary group id for all processes of the container.
Specifies a supplementary group id for all pod processes
See https://kubernetes.io/docs/tasks/configure-pod-container/security-context for
additional details.
label: podSecurityContext.fsGroup
group: Kubernetes Pod options
label: statefulset.template.spec.securityContext.fsGroup
group: Kubernetes Statefulset options
- variable: containers.ports.containerPort
- variable: statefulset.template.spec.containers.sqlServer.ports.databaseEngineContainerPort
description: >
Specifies containerPort for SQL Server
label: SQL Server Container Port
group: Kubernetes Pod Options
Specifies containerPort for SQL Server Database Engine
label: SQL Server Database Engine Container Port
group: Kubernetes Statefulset Options
- variable: service.port
- variable: service.spec.ports.sqlServerDatabasePort
description: Kubernetes service port for SQL Server
group: Kubernetes Service Options
label: Kubernetes Service Port
type: int
- variable: storageClass_provisioner
- variable: storageClass.provisioner
description: StorageClass provisioner for SQL Server
group: Kubernetes Storage Options
label: Kubernetes StorageClass Provisioner
@ -111,11 +113,11 @@ questions:
- ebs.csi.aws.com
- pd.csi.storage.gke.io
- variable: "storageClass.type"
- variable: storageClass.type
description: StorageClass Type for Azure Disk CSI
group: Kubernetes Storage Options
label: Kubernetes StorageClass Type
show_if: storageClass_provisioner="disk.csi.azure.com"
show_if: storageClass_provisioner = "disk.csi.azure.com"
type: enum
default: Standard_LRS
options:
@ -128,7 +130,7 @@ questions:
description: StorageClass Type for AWS EBS CSI
group: Kubernetes Storage Options
label: Kubernetes StorageClass Type
show_if: storageClass_provisioner="ebs.csi.aws.com"
show_if: storageClass_provisioner = "ebs.csi.aws.com"
type: enum
default: standard
options:
@ -140,11 +142,11 @@ questions:
- st1
- standard
- variable: "storageClass.type"
- variable: storageClass.type
description: StorageClass Type for GCE PD CSI
group: Kubernetes Storage Options
label: Kubernetes StorageClass Type
show_if: storageClass_provisioner="pd.csi.storage.gke.io"
show_if: storageClass.provisioner = "pd.csi.storage.gke.io"
type: enum
default: pd-standard
options:
@ -152,3 +154,8 @@ questions:
- pd-balanced
- pd-ssd
- pd-extreme
- variable: storage.size
description: Size for Storage Volume in Gibibytes (Gi)
group: Kubernetes Storage Options
label: Kubernetes Storage Size

Просмотреть файл

@ -5,8 +5,8 @@ metadata:
data:
mssql.conf: |
[EULA]
accepteula = {{ index .Values "mssql.conf.eula.accepteula" }}
accepteulaml = {{ index .Values "mssql.conf.eula.accepteulaml" }}
accepteula = {{ .Values.mssql.conf.eula.accepteula }}
accepteulaml = {{ .Values.mssql.conf.eula.accepteulaml }}
[coredump]
captureminiandfull = true
@ -16,10 +16,11 @@ data:
hadrenabled = 1
[language]
lcid = 1033
lcid = {{ .Values.mssql.conf.lcid }}
[sqlagent]
enabled = {{ index .Values "mssql.conf.sqlagent.enabled" }}
enabled = {{ .Values.mssql.conf.sqlagent.enabled }}
# control.alternatewritethrough Enable optimized write through flush for O_DSYNC requests
# control.hestacksize Host extension stack size in KB

Просмотреть файл

@ -6,4 +6,4 @@ metadata:
{{- include "sql-server-rancher.labels" . | nindent 4 }}
type: Opaque
data:
mssql_sa_password : {{ index .Values "mssql.sa.password" | b64enc | quote }}
mssql_sa_password : {{ .Values.mssql.sa.password | b64enc | quote }}

Просмотреть файл

@ -7,7 +7,7 @@ metadata:
spec:
clusterIP: None
ports:
- port: {{ .Values.service.port }}
- port: {{ .Values.service.spec.ports.sqlServerDatabasePort }}
targetPort: http
protocol: TCP
selector:

Просмотреть файл

@ -12,7 +12,7 @@ spec:
{{- include "sql-server-rancher.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
{{- with .Values.statefulset.template.metadata.annotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
@ -20,21 +20,21 @@ spec:
{{- include "sql-server-rancher.selectorLabels" . | nindent 8 }}
spec:
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- toYaml .Values.statefulset.template.spec.securityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
command:
- /bin/bash
- -c
- /opt/mssql/bin/sqlservr
image: {{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
image: {{ .Values.statefulset.template.spec.containers.sqlServer.image.repository }}:{{ .Values.statefulset.template.spec.containers.sqlServer.image.tag | default .Chart.AppVersion }}
imagePullPolicy: {{ .Values.statefulset.template.spec.containers.sqlServer.image.pullPolicy }}
ports:
- containerPort: {{ .Values.containers.ports.containerPort }}
- containerPort: {{ .Values.statefulset.template.spec.containers.sqlServer.ports.databaseEngineContainerPort }}
env:
# prefer mssql-config over env vars
# prefer mssql-config ConfigMap over env vars
- name: MSSQL_PID
value: {{ index .Values "mssql.pid" }}
value: {{ .Values.mssql.pid }}
- name: MSSQL_SA_PASSWORD
valueFrom:
secretKeyRef:
@ -58,5 +58,5 @@ spec:
- ReadWriteOnce
resources:
requests:
storage: 8Gi
storageClassName: {{ index .Values "storageClass_provisioner" | default "default" }}
storage: {{ .Values.storage.size }}Gi
storageClassName: {{ .Values.storageClass.provisioner | default "default" }}

Просмотреть файл

@ -1,22 +1,22 @@
{{- if index .Values "storageClass_provisioner" -}}
{{- if .Values.storageClass.provisioner -}}
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: {{ index .Values "storageClass_provisioner" }}
provisioner: {{ index .Values "storageClass_provisioner" }}
name: {{ .Values.storageClass.provisioner }}
provisioner: {{ .Values.storageClass.provisioner }}
reclaimPolicy: Delete
allowVolumeExpansion: true
mountOptions:
- noatime
parameters:
{{- if eq (index .Values "storageClass_provisioner") "disk.csi.azure.com" }}
storageAccountType: {{ index .Values "storageClass.type" }}
{{- if eq .Values.storageClass.provisioner "disk.csi.azure.com" }}
storageAccountType: {{ .Values.storageClass.type }}
fsType: xfs
{{- else if eq (index .Values "storageClass_provisioner") "ebs.csi.aws.com" }}
{{- else if eq .Values.storageClass.provisioner "ebs.csi.aws.com" }}
csi.storage.k8s.io/fstype: xfs
type: {{ index .Values "storageClass.type" }}
{{- else if eq (index .Values "storageClass_provisioner") "pd.csi.storage.gke.io" }}
type: {{ .Values.storageClass.type }}
{{- else if eq .Values.storageClass.provisioner "pd.csi.storage.gke.io" }}
csi.storage.k8s.io/fstype: xfs
type: {{ index .Values "storageClass.type" }}
type: {{ .Values.storageClass.type }}
{{- end }}
{{- end -}}

Просмотреть файл

@ -1,5 +1,8 @@
# since a default SA_PASSWORD is not set, this is used for helm lint and helm debug, otherwise unused
mssql.sa.password: Sfr9nxVVkbMVGTQweKmD
mssql:
sa:
password: Sfr9nxVVkbMVGTQweKmD
# storageClass_provisioner: disk.csi.azure.com
# storageClass.type: Standard_LRS
storageClass:
provisioner: disk.csi.azure.com
type: Standard_LRS

Просмотреть файл

@ -1,23 +1,35 @@
---
mssql.pid: Developer
mssql.conf.eula.accepteula: true
mssql.conf.eula.accepteulaml: true
mssql.conf.sqlagent.enabled: true
mssql:
pid: Developer
conf:
eula:
accepteula: true
accepteulaml: true
lcid: 1033 # english
sqlagent:
enabled: true
image:
repository: mcr.microsoft.com/mssql/server
pullPolicy: IfNotPresent
tag: 2019-latest
containers:
ports:
containerPort: 1433
podAnnotations: {}
podSecurityContext:
fsGroup: 10001
statefulset:
template:
metadata:
annotations: {}
spec:
containers:
sqlServer:
image:
repository: mcr.microsoft.com/mssql/server
pullPolicy: IfNotPresent
tag: 2019-latest
ports:
databaseEngineContainerPort: 1433
securityContext:
fsGroup: 10001
service:
port: 1433
spec:
ports:
sqlServerDatabasePort: 1433
storage:
size: 8