Skip to content

Commit dd80c7b

Browse files
authored
Merge pull request #189859 from dnethi/patch-14
updated backups sc requirements
2 parents 4770ace + cc346ec commit dd80c7b

File tree

1 file changed

+47
-75
lines changed

1 file changed

+47
-75
lines changed

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

Lines changed: 47 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +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

33-
This is an example yaml file:
38+
> [!NOTE]
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.
3441
35-
```yaml
36-
apiVersion: v1
37-
data:
38-
password: <your base64 encoded password>
39-
username: <your base64 encoded username>
40-
kind: Secret
41-
metadata:
42-
name: sql1-login-secret
43-
type: Opaque
44-
---
45-
apiVersion: sql.arcdata.microsoft.com/v1
46-
kind: SqlManagedInstance
47-
metadata:
48-
name: sql1
49-
annotations:
50-
exampleannotation1: exampleannotationvalue1
51-
exampleannotation2: exampleannotationvalue2
52-
labels:
53-
examplelabel1: examplelabelvalue1
54-
examplelabel2: examplelabelvalue2
55-
spec:
56-
security:
57-
adminLoginSecret: sql1-login-secret
58-
scheduling:
59-
default:
60-
resources:
61-
limits:
62-
cpu: "2"
63-
memory: 4Gi
64-
requests:
65-
cpu: "1"
66-
memory: 2Gi
67-
services:
68-
primary:
69-
type: LoadBalancer
70-
storage:
71-
backups:
72-
volumes:
73-
- className: default # Use default configured storage class or modify storage class based on your Kubernetes environment
74-
size: 5Gi
75-
data:
76-
volumes:
77-
- className: default # Use default configured storage class or modify storage class based on your Kubernetes environment
78-
size: 5Gi
79-
datalogs:
80-
volumes:
81-
- className: default # Use default configured storage class or modify storage class based on your Kubernetes environment
82-
size: 5Gi
83-
logs:
84-
volumes:
85-
- className: default # Use default configured storage class or modify storage class based on your Kubernetes environment
86-
size: 5Gi
87-
```
42+
### Example yaml file
43+
44+
See the following example of a yaml file:
45+
46+
:::code language="yaml" source="~/azure_arc_sample/arc_data_services/deploy/yaml/sqlmi.yaml":::
8847

8948
### Customizing the login and password
9049

91-
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.
9251

9352
> [!NOTE]
94-
> 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 .
9554
> Follow the [password complexity policy](/sql/relational-databases/security/password-policy#password-complexity).
9655
9756
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.
@@ -116,11 +75,11 @@ echo -n '<your string to encode here>' | base64
11675

11776
### Customizing the name
11877

119-
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`
12079

12180
### Customizing the resource requirements
12281

123-
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.
12483

12584
> [!NOTE]
12685
> You can learn more about [Kubernetes resource governance](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes).
@@ -129,18 +88,31 @@ Requirements for resource limits and requests:
12988
- The cores limit value is **required** for billing purposes.
13089
- The rest of the resource requests and limits are optional.
13190
- The cores limit and request must be a positive integer value, if specified.
132-
- The minimum of 1 cores is required for the cores request, if specified.
133-
- The memory value format follows the Kubernetes notation.
134-
- A minimum of 2Gi is required for memory request, if specified.
135-
- 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.
13695

13796
### Customizing service type
13897

139-
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.
14099

141100
### Customizing storage
142101

143-
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).
144116

145117
## Creating the SQL managed instance
146118

@@ -158,7 +130,7 @@ kubectl create -n <your target namespace> -f <path to your yaml file>
158130
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:
159131

160132
> [!NOTE]
161-
> 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.
162134

163135
```console
164136
kubectl get sqlmi/sql1 --namespace arc
@@ -168,7 +140,7 @@ kubectl get sqlmi/sql1 --namespace arc
168140
kubectl get pods --namespace arc
169141
```
170142

171-
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:
172144

173145
```console
174146
kubectl describe pod/<pod name> --namespace arc
@@ -177,9 +149,9 @@ kubectl describe pod/<pod name> --namespace arc
177149
#kubectl describe pod/sql1-0 --namespace arc
178150
```
179151

180-
## Troubleshooting creation problems
152+
## Troubleshoot deployment problems
181153

182-
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).
183155

184156
## Next steps
185157

0 commit comments

Comments
 (0)