You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This guide shows how to use Azure Private Link to provide private connectivity via a virtual network between Azure (including customer-owned and Microsoft Partner services) and ClickHouse Cloud. Azure Private Link simplifies the network architecture and secures the connection between endpoints in Azure by eliminating data exposure to the public internet.
33
32
@@ -39,7 +38,7 @@ Unlike AWS and GCP, Azure supports cross-region connectivity via Private Link. T
39
38
Additional charges may be applied to inter-region traffic. Please check latest Azure documentation.
40
39
:::
41
40
42
-
Please complete the following steps to enable Azure Private Link:
41
+
**Please complete the following steps to enable Azure Private Link:**
43
42
44
43
1. Obtain Azure connection alias for Private Link
45
44
1. Create a Private Endpoint in Azure
@@ -48,58 +47,67 @@ Please complete the following steps to enable Azure Private Link:
48
47
1. Access your ClickHouse Cloud service using Private Link
49
48
50
49
51
-
Find complete Terraform example for Azure Private Link [here](https://github.com/ClickHouse/terraform-provider-clickhouse/tree/main/examples/PrivateLinkAzure).
50
+
## Attention {#attention}
51
+
ClickHouse attempts to group your services to reuse the same published [Private Link service](https://learn.microsoft.com/en-us/azure/private-link/private-link-service-overview) within the Azure region. However, this grouping is not guaranteed, especially if you spread your services across multiple ClickHouse organizations.
52
+
If you already have Private Link configured for other services in your ClickHouse organization, you can often skip most of the steps because of that grouping and proceed directly to the final step: [Add the Private Endpoint GUID to your service(s) allow list](#add-private-endpoint-guid-to-services-allow-list).
53
+
54
+
Find Terraform examples at the ClickHouse [Terraform Provider repository](https://github.com/ClickHouse/terraform-provider-clickhouse/tree/main/examples/).
52
55
53
56
## Obtain Azure connection alias for Private Link {#obtain-azure-connection-alias-for-private-link}
In the ClickHouse Cloud console, open the service that you would like to connect via PrivateLink, then open the **Settings** menu. Click on the **Set up private endpoint** button. Copy the **Service name** which will be used for setting up Private Link.
60
+
In the ClickHouse Cloud console, open the service that you would like to connect via PrivateLink, then open the **Settings** menu. Click on the **Set up private endpoint** button. Make a note of the `Service name` and `DNS name` which will be used for setting up Private Link.
Make a note of the `Service name` and `DNS name`, it will be needed in the next steps.
65
+
61
66
### Option 2: API {#option-2-api}
62
67
63
-
Before you get started, you'll need a ClickHouse Cloud API key. You can [create a new key](/cloud/manage/openapi) or use an existing one. Note that you will need an **Admin** key to manage the Private Link configuration.
68
+
Before you get started, you'll need a ClickHouse Cloud API key. You can [create a new key](/cloud/manage/openapi) or use an existing one.
64
69
65
70
Once you have your API key, set the following environment variables before running any commands:
66
71
67
72
```bash
68
-
REGION=<region code, use Azure format>
73
+
REGION=<region code, use Azure format, for example: westus3>
69
74
PROVIDER=azure
70
75
KEY_ID=<Key ID>
71
76
KEY_SECRET=<Key secret>
72
77
ORG_ID=<set ClickHouse organization ID>
78
+
SERVICE_NAME=<Your ClickHouse service name>
73
79
```
74
80
75
-
Obtain an instance ID from your region:
76
-
77
-
You'll need at least one ClickHouse Cloud service deployed in the specified region to perform this step.
81
+
Get your ClickHouse `INSTANCE_ID` by filtering by region, provider and service name:
78
82
79
-
```bash
80
-
curl --silent --user ${KEY_ID:?}:${KEY_SECRET:?} https://api.clickhouse.cloud/v1/organizations/${ORG_ID:?}/services | jq ".result[] | select (.region==\"${REGION:?}\" and .provider==\"${PROVIDER:?}\") | .id " -r | head -1 | tee instance_id
81
-
```
82
-
83
-
Create an `INSTANCE_ID` environment variable using the ID you received in the previous step:
Make a note of the `endpointServiceId`. You'll use it in the next step.
100
100
101
101
## Create a Private Endpoint in Azure {#create-private-endpoint-in-azure}
102
102
103
+
:::important
104
+
This section covers ClickHouse-specific details for configuring ClickHouse via Azure Private Link. Azure-specific steps are provided as a reference to guide you on where to look, but they may change over time without notice from the Azure cloud provider. Please consider Azure configuration based on your specific use case.
105
+
106
+
Please note that ClickHouse is not responsible for configuring the required Azure private endpoints, DNS records.
107
+
108
+
For any issues related to Azure configuration tasks, contact Azure Support directly.
109
+
:::
110
+
103
111
In this section, we're going to create a Private Endpoint in Azure. You can use either the Azure Portal or Terraform.
104
112
105
113
### Option 1: Using Azure Portal to create a Private Endpoint in Azure {#option-1-using-azure-portal-to-create-a-private-endpoint-in-azure}
@@ -204,85 +212,24 @@ Under properties, find `resourceGuid` field and copy this value:
204
212
205
213
## Setting up DNS for Private Link {#setting-up-dns-for-private-link}
206
214
207
-
You need will need to create a Private DNS zone (`${location_code}.privatelink.azure.clickhouse.cloud`) and attach it to your VNet to access resources via Private Link.
208
-
209
-
### Create Private DNS zone {#create-private-dns-zone}
210
-
211
-
**Option 1: Using Azure portal**
212
-
213
-
Please follow the following guide to [create an Azure private DNS zone using the Azure Portal](https://learn.microsoft.com/en-us/azure/dns/private-dns-getstarted-portal).
214
-
215
-
**Option 2: Using Terraform**
216
-
217
-
Use the following Terraform template to create a Private DNS zone:
### Create a virtual network link {#create-a-virtual-network-link}
255
-
256
-
To link the private DNS zone to a virtual network, you'll need create a virtual network link.
257
-
258
-
**Option 1: Using Azure Portal**
259
-
260
-
Please follow the following guide to [link the virtual network to your private DNS zone](https://learn.microsoft.com/en-us/azure/dns/private-dns-getstarted-portal#link-the-virtual-network).
261
-
262
-
**Option 2: Using Terraform**
215
+
:::note
216
+
There are various ways to configure DNS. Please set up DNS according to your specific use case.
217
+
:::
263
218
264
-
Use the following Terraform template to link the virtual network to your private DNS zone:
219
+
You need to point "DNS name", taken from [Obtain Azure connection alias for Private Link](#obtain-azure-connection-alias-for-private-link) step, to Private Endpoint IP address. This ensures that services/components within your VPC/Network can resolve it properly.
Set the `VPC_ENDPOINT` environment variable using data from the [Obtaining the Private Endpoint `resourceGuid`](#obtaining-private-endpoint-resourceguid) step.
259
+
Set the `ENDPOINT_ID` environment variable using data from the [Obtaining the Private Endpoint `resourceGuid`](#obtaining-private-endpoint-resourceguid) step.
313
260
314
261
Run the following command to add the Private Endpoint:
315
262
@@ -351,7 +298,7 @@ EOF
351
298
After adding or removing a Private Endpoint, run the following command to apply it to your organization:
## Access your ClickHouse Cloud service using Private Link {#access-your-clickhouse-cloud-service-using-private-link}
421
368
422
-
Each service with Private Link enabled has a public and private endpoint. In order to connect using Private Link, you need to use a private endpoint which will be `privateDnsHostname`.
369
+
Each service with Private Link enabled has a public and private endpoint. In order to connect using Private Link, you need to use a private endpoint which will be `privateDnsHostname`<sup>API</sup> or `DNS name`<sup>console</sup> taken from [Obtain Azure connection alias for Private Link](#obtain-azure-connection-alias-for-private-link).
423
370
424
-
:::note
425
-
Private DNS hostname is only available from your Azure VNet. Do not try to resolve the DNS host from a machine that resides outside of Azure VNet.
426
-
:::
427
371
428
372
### Obtaining the Private DNS Hostname {#obtaining-the-private-dns-hostname}
You should receive a response similar to the following:
@@ -467,19 +411,18 @@ Use the `privateDnsHostname` to connect to your ClickHouse Cloud service using P
467
411
468
412
### Test DNS setup {#test-dns-setup}
469
413
470
-
All DNS records from the `${region_code}.privatelink.azure.clickhouse.cloud.` zone should be pointed to the internal IP address from the [*Create a Private Endpoint in Azure*](#create-private-endpoint-in-azure) step. In this example, the region is `westus3`.
where "dns name" `privateDnsHostname`<sup>API</sup> or `DNS name`<sup>console</sup> from [Obtain Azure connection alias for Private Link](#obtain-azure-connection-alias-for-private-link)
0 commit comments