|
| 1 | +--- |
| 2 | +title: Tutorial – Deploy Active Directory Connector |
| 3 | +description: Tutorial to deploy Active Directory Connector |
| 4 | +services: azure-arc |
| 5 | +ms.service: azure-arc |
| 6 | +ms.subservice: azure-arc-data |
| 7 | +author: cloudmelon |
| 8 | +ms.author: melqin |
| 9 | +ms.reviewer: mikeray |
| 10 | +ms.date: 12/10/2021 |
| 11 | +ms.topic: how-to |
| 12 | +--- |
| 13 | + |
| 14 | + |
| 15 | +# Tutorial – Deploy Active Directory Connector |
| 16 | + |
| 17 | +This article explains how to deploy Active Directory Connector Custom Resource. |
| 18 | + |
| 19 | +## What is an Active Directory (AD) connector? |
| 20 | + |
| 21 | +The Active Directory (AD) connector is a Kubernetes native custom resource definition (CRD) that allows you to provide |
| 22 | +SQL Managed Instances running on the same Data Controller an ability to perform Active Directory Authentication. |
| 23 | + |
| 24 | +An Active Directory Connector instance deploys a DNS proxy service that proxies the DNS requests |
| 25 | +coming from the SQL Managed Instance to either of the two upstream DNS services: |
| 26 | +* Active Directory DNS Servers |
| 27 | +* Kubernetes DNS Servers |
| 28 | + |
| 29 | +## Prerequisites |
| 30 | + |
| 31 | +Before you proceed, you must have: |
| 32 | + |
| 33 | +* An instance of Data Controller deployed on a supported version of Kubernetes |
| 34 | +* An Active Directory domain |
| 35 | + |
| 36 | +## Input for deploying Active Directory (AD) Connector |
| 37 | + |
| 38 | +To deploy an instance of Active Directory Connector, several inputs are needed from the Active Directory domain environment. |
| 39 | +These inputs are provided in a YAML spec of AD Connector instance. |
| 40 | + |
| 41 | +Following metadata about the AD domain must be available before deploying an instance of AD Connector: |
| 42 | +* Name of the Active Directory domain |
| 43 | +* List of the domain controllers (fully-qualified domain names) |
| 44 | +* List of the DNS server IP addresses |
| 45 | + |
| 46 | +Following input fields are exposed to the users in the Active Directory Connector spec: |
| 47 | + |
| 48 | +- **Required** |
| 49 | + - **spec.activeDirectory.realm** |
| 50 | + Name of the Active Directory domain in uppercase. This is the AD domain that this instance of AD Connector will be associated with. |
| 51 | + |
| 52 | + - **spec.activeDirectory.domainControllers.primaryDomainController.hostname** |
| 53 | + Fully-qualified domain name of the Primary Domain Controller (PDC) in the AD domain. |
| 54 | + |
| 55 | + If you do not know which domain controller in the domain is primary, you can find out by running this command on any Windows machine joined to the AD domain: `netdom query fsmo`. |
| 56 | + |
| 57 | + - **spec.activeDirectory.dns.nameserverIpAddresses** |
| 58 | + List of Active Directory DNS server IP addresses. DNS proxy service will forward DNS queries in the provided domain name to these servers. |
| 59 | + |
| 60 | + |
| 61 | +- **Optional** |
| 62 | + - **spec.activeDirectory.netbiosDomainName** |
| 63 | + NETBIOS name of the Active Directory domain. This is the short domain name that represents the Active Directory domain. |
| 64 | + |
| 65 | + This is often used to qualify accounts in the AD domain. e.g. if the accounts in the domain are referred to as CONTOSO\admin, then CONTOSO is the NETBIOS domain name. |
| 66 | + |
| 67 | + This field is optional. When not provided, it defaults to the first label of the `spec.activeDirectory.realm` field. |
| 68 | + |
| 69 | + In most domain environments, this is set to the default value but some domain environments may have a non-default value. |
| 70 | + |
| 71 | + - **spec.activeDirectory.domainControllers.secondaryDomainControllers[*].hostname** |
| 72 | + List of the fully-qualified domain names of the secondary domain controllers in the AD domain. |
| 73 | + |
| 74 | + If your domain is served by multiple domain controllers, it is a good practice to provide some of their fully-qualified domain names in this list. This allows high-availability for Kerberos operations. |
| 75 | + |
| 76 | + This field is optional and not needed if your domain is served by only one domain controller. |
| 77 | + |
| 78 | + - **spec.activeDirectory.dns.domainName** |
| 79 | + DNS domain name for which DNS lookups should be forwarded to the Active Directory DNS servers. |
| 80 | + |
| 81 | + A DNS lookup for any name belonging to this domain or its descendant domains will get forwarded to Active Directory. |
| 82 | + |
| 83 | + This field is optional. When not provided, it defaults to the value provided for `spec.activeDirectory.realm` converted to lowercase. |
| 84 | + |
| 85 | + - **spec.activeDirectory.dns.replicas** |
| 86 | + Replica count for DNS proxy service. This field is optional and defaults to 1 when not provided. |
| 87 | + |
| 88 | + - **spec.activeDirectory.dns.preferK8sDnsForPtrLookups** |
| 89 | + Flag indicating whether to prefer Kubernetes DNS server response over AD DNS server response for IP address lookups. |
| 90 | + |
| 91 | + DNS proxy service relies on this field to determine which upstream group of DNS servers to prefer for IP address lookups. |
| 92 | + |
| 93 | + This field is optional. When not provided, it defaults to true i.e. the DNS lookups of IP addresses will be first forwarded to Kubernetes DNS servers. |
| 94 | + |
| 95 | + If Kubernetes DNS servers fail to answer the lookup, the query is then forwarded to AD DNS servers. |
| 96 | + |
| 97 | + |
| 98 | +## Deploy Active Directory (AD) connector |
| 99 | +To deploy an AD connector, create a YAML spec file called `active-directory-connector.yaml`. |
| 100 | +The following example uses an AD domain of name `CONTOSO.LOCAL`. Ensure to replace the values with the ones for your AD domain. |
| 101 | + |
| 102 | +```yaml |
| 103 | +apiVersion: arcdata.microsoft.com/v1beta1 |
| 104 | +kind: ActiveDirectoryConnector |
| 105 | +metadata: |
| 106 | + name: adarc |
| 107 | + namespace: <namespace> |
| 108 | +spec: |
| 109 | + activeDirectory: |
| 110 | + realm: CONTOSO.LOCAL |
| 111 | + domainControllers: |
| 112 | + primaryDomainController: |
| 113 | + hostname: dc1.contoso.local |
| 114 | + secondaryDomainControllers: |
| 115 | + - hostname: dc2.contoso.local |
| 116 | + - hostname: dc3.contoso.local |
| 117 | + dns: |
| 118 | + preferK8sDnsForPtrLookups: false |
| 119 | + nameserverIPAddresses: |
| 120 | + - <DNS Server 1 IP address> |
| 121 | + - <DNS Server 2 IP address> |
| 122 | +``` |
| 123 | +
|
| 124 | +The following command deploys the AD connector instance. Currently, only kube-native approach of deploying is supported. |
| 125 | +
|
| 126 | +```console |
| 127 | +kubectl apply –f active-directory-connector.yaml |
| 128 | +``` |
| 129 | + |
| 130 | +After submitting the deployment of AD Connector instance, you may check the status of the deployment using the following command. |
| 131 | + |
| 132 | +```console |
| 133 | +kubectl get adc -n <namespace> |
| 134 | +``` |
| 135 | + |
| 136 | +## Next steps |
| 137 | + |
| 138 | +* [Deploy SQL Managed Instance with Active Directory Authentication](deploy-active-directory-sql-managed-instance.md). |
| 139 | +* [Connect to AD-integrated Azure Arc-enabled SQL Managed Instance](connect-active-directory-sql-managed-instance.md). |
| 140 | + |
0 commit comments