Skip to content

Commit cc346ec

Browse files
committed
Update files for acrolinx
1 parent 30e9a7d commit cc346ec

File tree

1 file changed

+44
-77
lines changed

1 file changed

+44
-77
lines changed

articles/azure-arc/data/create-sql-managed-instance-using-kubernetes-native-tools.md

Lines changed: 44 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,56 @@
11
---
2-
title: Create a SQL managed instance using Kubernetes tools
3-
description: Create a SQL managed instance using Kubernetes tools
2+
title: Create a SQL Managed Instance using Kubernetes tools
3+
description: Deploy Azure Arc-enabled SQL Managed Instance using Kubernetes tools.
44
services: azure-arc
55
ms.service: azure-arc
66
ms.subservice: azure-arc-data
77
author: dnethi
88
ms.author: dinethi
99
ms.reviewer: mikeray
10-
ms.date: 07/30/2021
10+
ms.date: 02/28/2022
1111
ms.topic: how-to
1212
---
1313

14-
# Create Azure SQL managed instance using Kubernetes tools
14+
# Create Azure Arc-enabled SQL Managed Instance using Kubernetes tools
1515

16+
This article demonstrates how to deploy Azure SQL Managed Instance for Azure Arc with Kubernetes tools.
1617

1718
## Prerequisites
1819

1920
You should have already created a [data controller](plan-azure-arc-data-services.md).
2021

21-
To create a SQL managed instance using Kubernetes tools, you will need to have the Kubernetes tools installed. The examples in this article will use `kubectl`, but similar approaches could be used with other Kubernetes tools such as the Kubernetes dashboard, `oc`, or `helm` if you are familiar with those tools and Kubernetes yaml/json.
22+
To create a SQL managed instance using Kubernetes tools, you will need to have the Kubernetes tools installed. The examples in this article will use `kubectl`, but similar approaches could be used with other Kubernetes tools such as the Kubernetes dashboard, `oc`, or `helm` if you are familiar with those tools and Kubernetes yaml/json.
2223

2324
[Install the kubectl tool](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
2425

2526
## Overview
2627

27-
To create a SQL managed instance, you need to create a Kubernetes secret to store your system administrator login and password securely and a SQL managed instance custom resource based on the SqlManagedInstance custom resource definition.
28+
To create a SQL Managed Instance, you need to:
29+
1. Create a Kubernetes secret to store your system administrator login and password securely
30+
1. Create a SQL Managed Instance custom resource based on the `SqlManagedInstance` custom resource definition
31+
32+
Define both of these items in a yaml file.
2833

2934
## Create a yaml file
3035

31-
You can use the [template yaml](https://raw.githubusercontent.com/microsoft/azure_arc/main/arc_data_services/deploy/yaml/sqlmi.yaml) file as a starting point to create your own custom SQL managed instance yaml file. Download this file to your local computer and open it in a text editor. It is useful to use a text editor such as [VS Code](https://code.visualstudio.com/download) that support syntax highlighting and linting for yaml files.
36+
Use the [template yaml](https://raw.githubusercontent.com/microsoft/azure_arc/main/arc_data_services/deploy/yaml/sqlmi.yaml) file as a starting point to create your own custom SQL managed instance yaml file. Download this file to your local computer and open it in a text editor. Use a text editor such as [VS Code](https://code.visualstudio.com/download) that support syntax highlighting and linting for yaml files.
3237

3338
> [!NOTE]
34-
>Note: Starting with the February release, a ReadWriteMany (RWX) capable storage class needs to be specified for backups. Learn more about [access modes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes)
35-
If no storage class is specified for backups, the default storage class in kubernetes is used and if this is not RWX capable, the Arc SQL Managed Instance installation may not succeed.
39+
> Beginning with the February, 2022 release, `ReadWriteMany` (RWX) capable storage class needs to be specified for backups. Learn more about [access modes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes).
40+
> If no storage class is specified for backups, the default storage class in Kubernetes is used. If the default is not RWX capable, the SQL Managed Instance installation may not succeed.
3641
42+
### Example yaml file
3743

38-
This is an example yaml file:
44+
See the following example of a yaml file:
3945

40-
```yaml
41-
apiVersion: v1
42-
data:
43-
password: <your base64 encoded password>
44-
username: <your base64 encoded username>
45-
kind: Secret
46-
metadata:
47-
name: sql1-login-secret
48-
type: Opaque
49-
---
50-
apiVersion: sql.arcdata.microsoft.com/v1
51-
kind: SqlManagedInstance
52-
metadata:
53-
name: sql1
54-
annotations:
55-
exampleannotation1: exampleannotationvalue1
56-
exampleannotation2: exampleannotationvalue2
57-
labels:
58-
examplelabel1: examplelabelvalue1
59-
examplelabel2: examplelabelvalue2
60-
spec:
61-
security:
62-
adminLoginSecret: sql1-login-secret
63-
scheduling:
64-
default:
65-
resources:
66-
limits:
67-
cpu: "2"
68-
memory: 4Gi
69-
requests:
70-
cpu: "1"
71-
memory: 2Gi
72-
services:
73-
primary:
74-
type: LoadBalancer
75-
storage:
76-
backups:
77-
volumes:
78-
- className: default # Use default configured storage class or modify storage class based on your Kubernetes environment
79-
size: 5Gi
80-
data:
81-
volumes:
82-
- className: default # Use default configured storage class or modify storage class based on your Kubernetes environment
83-
size: 5Gi
84-
datalogs:
85-
volumes:
86-
- className: default # Use default configured storage class or modify storage class based on your Kubernetes environment
87-
size: 5Gi
88-
logs:
89-
volumes:
90-
- className: default # Use default configured storage class or modify storage class based on your Kubernetes environment
91-
size: 5Gi
92-
```
46+
:::code language="yaml" source="~/azure_arc_sample/arc_data_services/deploy/yaml/sqlmi.yaml":::
9347

9448
### Customizing the login and password
9549

96-
A Kubernetes secret is stored as a base64 encoded string - one for the username and one for the password. You will need to base64 encode a system administrator login and password and place them in the placeholder location at `data.password` and `data.username`. Do not include the `<` and `>` symbols provided in the template.
50+
A Kubernetes secret is stored as a base64 encoded string - one for the username and one for the password. You will need to base64 encode a system administrator login and password and place them in the placeholder location at `data.password` and `data.username`. Do not include the `<` and `>` symbols provided in the template.
9751

9852
> [!NOTE]
99-
> For optimum security, using the value 'sa' is not allowed for the login .
53+
> For optimum security, using the value `sa` is not allowed for the login .
10054
> Follow the [password complexity policy](/sql/relational-databases/security/password-policy#password-complexity).
10155
10256
You can use an online tool to base64 encode your desired username and password or you can use built in CLI tools depending on your platform.
@@ -121,11 +75,11 @@ echo -n '<your string to encode here>' | base64
12175

12276
### Customizing the name
12377

124-
The template has a value of 'sql1' for the name attribute. You can change this but it must be characters that follow the DNS naming standards. You must also change the name of the secret to match. For example, if you change the name of the SQL managed instance to 'sql2', you must change the name of the secret from 'sql1-login-secret' to 'sql2-login-secret'
78+
The template has a value of `sql1` for the name attribute. You can change this value, but it must include characters that follow the DNS naming standards. You must also change the name of the secret to match. For example, if you change the name of the SQL managed instance to `sql2`, you must change the name of the secret from `sql1-login-secret` to `sql2-login-secret`
12579

12680
### Customizing the resource requirements
12781

128-
You can change the resource requirements - the RAM and core limits and requests - as needed.
82+
You can change the resource requirements - the RAM and core limits and requests - as needed.
12983

13084
> [!NOTE]
13185
> You can learn more about [Kubernetes resource governance](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes).
@@ -134,18 +88,31 @@ Requirements for resource limits and requests:
13488
- The cores limit value is **required** for billing purposes.
13589
- The rest of the resource requests and limits are optional.
13690
- The cores limit and request must be a positive integer value, if specified.
137-
- The minimum of 1 cores is required for the cores request, if specified.
138-
- The memory value format follows the Kubernetes notation.
139-
- A minimum of 2Gi is required for memory request, if specified.
140-
- As a general guideline, you should have 4GB of RAM for each 1 core for production use cases.
91+
- The minimum of 1 core is required for the cores request, if specified.
92+
- The memory value format follows the Kubernetes notation.
93+
- A minimum of 2 Gi is required for memory request, if specified.
94+
- As a general guideline, you should have 4 GB of RAM for each 1 core for production use cases.
14195

14296
### Customizing service type
14397

144-
The service type can be changed to NodePort if desired. A random port number will be assigned.
98+
The service type can be changed to NodePort if desired. A random port number will be assigned.
14599

146100
### Customizing storage
147101

148-
You can customize the storage classes for storage to match your environment. If you are not sure which storage classes are available you can run the command `kubectl get storageclass` to view them. The template has a default value of 'default'. This means that there is a storage class _named_ 'default' not that there is a storage class that _is_ the default. You can also optionally change the size of your storage. You can read more about [storage configuration](./storage-configuration.md).
102+
You can customize the storage classes for storage to match your environment. If you are not sure which storage classes are available, run the command `kubectl get storageclass` to view them.
103+
104+
The template has a default value of `default`.
105+
106+
For example
107+
108+
```yml
109+
storage:
110+
data:
111+
volumes:
112+
- className: default
113+
```
114+
115+
This example means that there is a storage class named `default` - not that there is a storage class that is the default. You can also optionally change the size of your storage. For more information, see [storage configuration](./storage-configuration.md).
149116

150117
## Creating the SQL managed instance
151118

@@ -163,7 +130,7 @@ kubectl create -n <your target namespace> -f <path to your yaml file>
163130
Creating the SQL managed instance will take a few minutes to complete. You can monitor the progress in another terminal window with the following commands:
164131

165132
> [!NOTE]
166-
> The example commands below assume that you created a SQL managed instance named 'sql1' and Kubernetes namespace with the name 'arc'. If you used a different namespace/SQL managed instance name, you can replace 'arc' and 'sqlmi' with your names.
133+
> The example commands below assume that you created a SQL managed instance named `sql1` and Kubernetes namespace with the name `arc`. If you used a different namespace/SQL managed instance name, you can replace `arc` and `sqlmi` with your names.
167134

168135
```console
169136
kubectl get sqlmi/sql1 --namespace arc
@@ -173,7 +140,7 @@ kubectl get sqlmi/sql1 --namespace arc
173140
kubectl get pods --namespace arc
174141
```
175142

176-
You can also check on the creation status of any particular pod by running a command like below. This is especially useful for troubleshooting any issues.
143+
You can also check on the creation status of any particular pod. Run `kubectl describe pod ...`. Use this command to troubleshoot any issues. For example:
177144

178145
```console
179146
kubectl describe pod/<pod name> --namespace arc
@@ -182,9 +149,9 @@ kubectl describe pod/<pod name> --namespace arc
182149
#kubectl describe pod/sql1-0 --namespace arc
183150
```
184151

185-
## Troubleshooting creation problems
152+
## Troubleshoot deployment problems
186153

187-
If you encounter any troubles with creation, please see the [troubleshooting guide](troubleshoot-guide.md).
154+
If you encounter any troubles with the deployment, please see the [troubleshooting guide](troubleshoot-guide.md).
188155

189156
## Next steps
190157

0 commit comments

Comments
 (0)