Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit 70ea8fa

Browse files
cbleckerrwestMSFT
authored andcommitted
Update OpenShift quickstart
1 parent 0fd5da7 commit 70ea8fa

1 file changed

Lines changed: 17 additions & 25 deletions

File tree

docs/linux/quickstart-sql-server-containers-azure.md

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: "Quickstart: Deploy a SQL Server container cluster on Azure"
33
description: This tutorial shows how to deploy a SQL Server high availability solution with Azure Kubernetes Service or Azure Red Hat OpenShift.
44
author: rwestMSFT
55
ms.author: randolphwest
6-
ms.date: 08/18/2022
6+
ms.date: 07/31/2023
77
ms.service: sql
88
ms.subservice: linux
99
ms.topic: quickstart
@@ -19,10 +19,10 @@ This quickstart demonstrates how to configure a highly available SQL Server inst
1919

2020
This quickstart uses the following command line tools to manage the cluster.
2121

22-
|Cluster service|Command line tool|
23-
|---|---|
24-
|Azure Kubernetes Service (AKS)|[kubectl](https://kubernetes.io/docs/reference/kubectl/) (Kubernetes CLI)|
25-
|Azure Red Hat OpenShift|[oc](https://docs.openshift.com/container-platform/4.12/cli_reference/openshift_cli/getting-started-cli.html) (OpenShift CLI)|
22+
| Cluster service | Command line tool |
23+
| --- | --- |
24+
| Azure Kubernetes Service (AKS) | [kubectl](https://kubernetes.io/docs/reference/kubectl/) (Kubernetes CLI) |
25+
| Azure Red Hat OpenShift | [oc](https://docs.openshift.com/container-platform/4.12/cli_reference/openshift_cli/getting-started-cli.html) (OpenShift CLI) |
2626

2727
## Prerequisites
2828

@@ -174,28 +174,17 @@ For a database in a Kubernetes cluster, you must use persisted storage. You can
174174

175175
### [OpenShift](#tab/oc)
176176

177-
For a database in an OpenShift cluster, you must use persisted storage. You can configure a [persistent volume](https://docs.openshift.com/container-platform/4.12/storage/persistent_storage/persistent_storage_local/persistent-storage-local.html) and [persistent volume claim](https://docs.openshift.com/container-platform/4.12/storage/persistent_storage/persistent_storage_local/persistent-storage-local.html#create-local-pvc_persistent-storage-local) in the OpenShift cluster using the following steps:
177+
For a database in an OpenShift cluster, you must use persisted storage. You can configure a [persistent volume](https://docs.openshift.com/container-platform/latest/storage/persistent_storage/persistent-storage-azure.html) and [persistent volume claim](https://docs.openshift.com/container-platform/latest/storage/persistent_storage/persistent-storage-azure.html#creating-the-persistent-volume-claim) in the OpenShift cluster using the following steps:
178178

179179
1. Create a manifest to define the storage class and the persistent volume claim. The manifest specifies the storage provisioner, parameters, and reclaim policy. The OpenShift cluster uses this manifest to create the persistent storage.
180180

181-
1. The following YAML example defines a storage class and persistent volume claim. The storage class provisioner is `azure-disk`, because this OpenShift cluster is in Azure. The storage account type is `Standard_LRS`. The persistent volume claim is named `mssql-data`. The persistent volume claim metadata includes an annotation connecting it back to the storage class.
181+
1. The following YAML example defines a persistent volume claim using the default storage class. The persistent volume claim is named `mssql-data`.
182182

183183
```yaml
184-
kind: StorageClass
185-
apiVersion: storage.k8s.io/v1
186-
metadata:
187-
name: azure-disk
188-
provisioner: kubernetes.io/azure-disk
189-
parameters:
190-
storageaccounttype: Standard_LRS
191-
kind: Managed
192-
---
193184
kind: PersistentVolumeClaim
194185
apiVersion: v1
195186
metadata:
196187
name: mssql-data
197-
annotations:
198-
volume.beta.kubernetes.io/storage-class: azure-disk
199188
spec:
200189
accessModes:
201190
- ReadWriteOnce
@@ -215,7 +204,6 @@ For a database in an OpenShift cluster, you must use persisted storage. You can
215204
The persistent volume is automatically created as an Azure storage account, and bound to the persistent volume claim.
216205

217206
```output
218-
storageclass "azure-disk" created
219207
persistentvolumeclaim "mssql-data" created
220208
```
221209

@@ -270,7 +258,7 @@ For a database in an OpenShift cluster, you must use persisted storage. You can
270258

271259
The container hosting the SQL Server instance is described as a Kubernetes *deployment object*. The deployment creates a *replica set*. The replica set creates the *pod*.
272260

273-
You will create a manifest to describe the container, based on the SQL Server [mssql-server-linux](https://hub.docker.com/_/microsoft-mssql-server) Docker image.
261+
You create a manifest to describe the container, based on the SQL Server [mssql-server-linux](https://hub.docker.com/_/microsoft-mssql-server) Docker image.
274262

275263
- The manifest references the `mssql-server` persistent volume claim, and the `mssql` secret that you already applied to the Kubernetes cluster.
276264
- The manifest also describes a [service](https://kubernetes.io/docs/concepts/services-networking/service/). This service is a load balancer. The load balancer guarantees that the IP address persists after SQL Server instance is recovered.
@@ -358,7 +346,7 @@ You will create a manifest to describe the container, based on the SQL Server [m
358346

359347
When Kubernetes deploys the container, it refers to the secret named `mssql` to get the value for the password.
360348

361-
- `securityContext`: Defines privilege and access control settings for a pod or container. In this case it's specified at the pod level, so all containers adhere to that security context. In the security context, we define the `fsGroup` with the value `10001`, which is the Group ID (GID) for the `mssql` group. This value means that all processes of the container are also part of the supplementary GID `10001` (`mssql`). The owner for volume `/var/opt/mssql` and any files created in that volume will be GID `10001` (the `mssql` group).
349+
- `securityContext`: Defines privilege and access control settings for a pod or container. In this case, it's specified at the pod level, so all containers adhere to that security context. In the security context, we define the `fsGroup` with the value `10001`, which is the Group ID (GID) for the `mssql` group. This value means that all processes of the container are also part of the supplementary GID `10001` (`mssql`). The owner for volume `/var/opt/mssql` and any files created in that volume will be GID `10001` (the `mssql` group).
362350

363351
> [!WARNING]
364352
> By using the `LoadBalancer` service type, the SQL Server instance is accessible remotely (via the Internet) at port 1433.
@@ -415,7 +403,7 @@ You will create a manifest to describe the container, based on the SQL Server [m
415403
kubectl.exe exec <nameOfSqlPod> -it -- /bin/bash
416404
```
417405

418-
You are able to see the username as `mssql` if you run `whoami`. `mssql` is a non-root user.
406+
You can see the username as `mssql` if you run `whoami`. `mssql` is a non-root user.
419407

420408
```console
421409
whoami
@@ -425,7 +413,7 @@ You will create a manifest to describe the container, based on the SQL Server [m
425413

426414
The container hosting the SQL Server instance is described as an OpenShift *deployment object*. The deployment creates a *replica set*. The replica set creates the *pod*.
427415

428-
You will create a manifest to describe the container, based on the SQL Server [mssql-server-linux](https://hub.docker.com/_/microsoft-mssql-server) Docker image.
416+
You create a manifest to describe the container, based on the SQL Server [mssql-server-linux](https://hub.docker.com/_/microsoft-mssql-server) Docker image.
429417

430418
- The manifest references the `mssql-server` persistent volume claim, and the `mssql` secret that you already applied to the OpenShift cluster.
431419
- The manifest also describes a [service](https://docs.openshift.com/container-platform/4.12/networking/understanding-networking.html). This service is a load balancer. The load balancer guarantees that the IP address persists after SQL Server instance is recovered.
@@ -451,7 +439,7 @@ You will create a manifest to describe the container, based on the SQL Server [m
451439
terminationGracePeriodSeconds: 30
452440
hostname: mssqlinst
453441
securityContext:
454-
fsGroup: 10001
442+
fsGroupChangePolicy: OnRootMismatch
455443
containers:
456444
- name: mssql
457445
image: mcr.microsoft.com/mssql/server:2022-latest
@@ -464,6 +452,10 @@ You will create a manifest to describe the container, based on the SQL Server [m
464452
cpu: "2000m"
465453
ports:
466454
- containerPort: 1433
455+
securityContext:
456+
capabilities:
457+
add:
458+
- NET_BIND_SERVICE
467459
env:
468460
- name: MSSQL_PID
469461
value: "Developer"
@@ -513,7 +505,7 @@ You will create a manifest to describe the container, based on the SQL Server [m
513505

514506
When OpenShift deploys the container, it refers to the secret named `mssql` to get the value for the password.
515507

516-
- `securityContext`: Defines privilege and access control settings for a pod or container. In this case it's specified at the pod level, so all containers adhere to that security context. In the security context, we define the `fsGroup` with the value `10001`, which is the Group ID (GID) for the `mssql` group. This value means that all processes of the container are also part of the supplementary GID `10001` (`mssql`). The owner for volume `/var/opt/mssql` and any files created in that volume will be GID `10001` (the `mssql` group).
508+
- `securityContext`: Defines privilege and access control settings for a pod or container. There are settings applied at both the pod and container level. At the pod level, this option defines the `fsGroupChangePolicy` with the value `OnRootMismatch`. This ensures that the `fsGroup` selected by OpenShift is used for all the files in the `/var/opt/mssql` volume. At the container level, this option permits the `NET_BIND_SERVICE` capability, which allows the container to bind to ports lower than 1024.
517509

518510
> [!WARNING]
519511
> By using the `LoadBalancer` service type, the SQL Server instance is accessible remotely (via the Internet) at port 1433.

0 commit comments

Comments
 (0)