Create Azure Arc-enabled sqlmi instance using OpenShift tool
本文最后更新于:2024年8月9日 晚上
Create Azure Arc-enabled sqlmi instance using OpenShift tool
Microsoft official doc reference
Overview Steps:
https://docs.microsoft.com/en-us/azure/azure-arc/data/create-data-controller-using-kubernetes-native-tools#overview
- Create the custom resource definitions for the Arc data controller, Azure SQL managed instance, and PostgreSQL Hyperscale.
- Create a namespace in which the data controller will be created.
- Create the bootstrapper service including the replica set, service account, role, and role binding.
- Create a secret for the data controller administrator username and password.
- Create the webhook deployment job, cluster role and cluster role binding.
- Create the data controller.
- Create sqlmi instance.
Prerequisites
kubectl
oroc
command installed on your local machine
installkubectl
how to:https://kubernetes.io/docs/tasks/tools/
installoc
how to:https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/
Setup
k8s cluster
oropenshift
cluster(skipped on-premise)Create an Azure Red Hat OpenShift cluster with
azure-cli
https://docs.microsoft.com/en-us/azure/openshift/tutorial-create-cluster
when
openshift
cluster setup complete:1
2
3
4
5
6
7
8
9
10# will need for authentication
az ad sp create-for-rbac --name jason-azarc --role Contributor --scopes /subscriptions/<subscription ID>/resourceGroups/<group Name>
{
"appId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"displayName": "jason-azarc",
"password": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"tenant": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
#
# note down the appID and passwordConnect to an Azure Red Hat OpenShift cluster
https://docs.microsoft.com/en-us/azure/openshift/tutorial-connect-cluster
1
2
3
4
5
6
7
8
9
10
11
12
13
14# list console login info
az aro list-credentials --name ocluster --resource-group az-arc
# list azure openshift cluster info
PS C:\Users\hubo> az aro list -o table
Name ResourceGroup Location ProvisioningState WorkerCount URL
-------- --------------- ---------- ------------------- ------------- -----------------------------------------------------------
ocluster az-arc eastus Succeeded 4 https://console-openshift-console.xxxxxxx.io/
# login in openshift
[root@azk8s-oc ~]# oc login <API URL> -u kubeadmin -p <password>
Login successful.
You have access to 68 projects, the list has been suppressed. You can list all projects with 'oc projects'
Using project "default".
Welcome! See 'oc help' to get started
Create a namespace in which the data controller will be created
1 |
|
if use
openshift
cluster, need to edit namespace
1 |
|
Create the custom resource definitions
1 |
|
Create the bootstrapper service
Make sure image version is
v1.8.0_2022-06-14
, latest versionv1.9.0_2022-07-12
have pull issue
1 |
|
Create secrets for the metrics and logs dashboards
1 |
|
linux
andPowershell
they have different encode results , that’s a little confused which one should we use to sqlmi logon authentication.
Create the webhook deployment job, cluster role and cluster role binding
1 |
|
Create the data controller
1 |
|
Create Azure Arc-enabled SQL Managed Instance using Kubernetes tools
Template :
https://raw.githubusercontent.com/microsoft/azure_arc/main/arc_data_services/deploy/yaml/sqlmi.yaml
https://www.cnblogs.com/aboa/p/sqlmi.html
1 |
|
1 |
|