Skip to content

Commit 41014f1

Browse files
authored
Merge branch 'main' into enable_MD010
2 parents 5471116 + 93d4e45 commit 41014f1

12 files changed

+229
-344
lines changed

docs/cloud/security/aws-privatelink.md

Lines changed: 109 additions & 106 deletions
Large diffs are not rendered by default.

docs/cloud/security/azure-privatelink.md

Lines changed: 48 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ description: 'How to set up Azure Private Link'
66
keywords: ['azure', 'private link', 'privatelink']
77
---
88

9+
import ScalePlanFeatureBadge from '@theme/badges/ScalePlanFeatureBadge';
910
import azure_pe from '@site/static/images/cloud/security/azure-pe.png';
1011
import azure_privatelink_pe_create from '@site/static/images/cloud/security/azure-privatelink-pe-create.png';
1112
import azure_private_link_center from '@site/static/images/cloud/security/azure-private-link-center.png';
@@ -25,9 +26,7 @@ import azure_privatelink_pe_dns from '@site/static/images/cloud/security/azure-p
2526

2627
# Azure Private Link
2728

28-
:::note
29-
Azure Private Link can be enabled only on ClickHouse Cloud **Production** services. **Development** services are not supported.
30-
:::
29+
<ScalePlanFeatureBadge feature="Azure Private Link"/>
3130

3231
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.
3332

@@ -39,7 +38,7 @@ Unlike AWS and GCP, Azure supports cross-region connectivity via Private Link. T
3938
Additional charges may be applied to inter-region traffic. Please check latest Azure documentation.
4039
:::
4140

42-
Please complete the following steps to enable Azure Private Link:
41+
**Please complete the following steps to enable Azure Private Link:**
4342

4443
1. Obtain Azure connection alias for Private Link
4544
1. Create a Private Endpoint in Azure
@@ -48,58 +47,67 @@ Please complete the following steps to enable Azure Private Link:
4847
1. Access your ClickHouse Cloud service using Private Link
4948

5049

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/).
5255

5356
## Obtain Azure connection alias for Private Link {#obtain-azure-connection-alias-for-private-link}
5457

5558
### Option 1: ClickHouse Cloud console {#option-1-clickhouse-cloud-console}
5659

57-
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.
5861

5962
<img src={azure_privatelink_pe_create} alt="Private Endpoints" />
6063

64+
Make a note of the `Service name` and `DNS name`, it will be needed in the next steps.
65+
6166
### Option 2: API {#option-2-api}
6267

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.
6469

6570
Once you have your API key, set the following environment variables before running any commands:
6671

6772
```bash
68-
REGION=<region code, use Azure format>
73+
REGION=<region code, use Azure format, for example: westus3>
6974
PROVIDER=azure
7075
KEY_ID=<Key ID>
7176
KEY_SECRET=<Key secret>
7277
ORG_ID=<set ClickHouse organization ID>
78+
SERVICE_NAME=<Your ClickHouse service name>
7379
```
7480

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:
7882

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:
84-
85-
```bash
86-
INSTANCE_ID=$(cat instance_id)
83+
```shell
84+
INSTANCE_ID=$(curl --silent --user "${KEY_ID:?}:${KEY_SECRET:?}" \
85+
"https://api.clickhouse.cloud/v1/organizations/${ORG_ID:?}/services" | \
86+
jq ".result[] | select (.region==\"${REGION:?}\" and .provider==\"${PROVIDER:?}\" and .name==\"${SERVICE_NAME:?}\") | .id " -r)
8787
```
8888

8989
Obtain your Azure connection alias and Private DNS hostname for Private Link:
9090

9191
```bash
92-
curl --silent --user ${KEY_ID:?}:${KEY_SECRET:?} https://api.clickhouse.cloud/v1/organizations/${ORG_ID:?}/services/${INSTANCE_ID:?}/privateEndpointConfig | jq .result
92+
curl --silent --user "${KEY_ID:?}:${KEY_SECRET:?}" "https://api.clickhouse.cloud/v1/organizations/${ORG_ID:?}/services/${INSTANCE_ID:?}/privateEndpointConfig" | jq .result
9393
{
94-
"endpointServiceId": "production-westus3-0-0.63c890a9-4d32-48cc-a08c-8cd92dfb1ad3.westus3.azure.privatelinkservice",
95-
...
94+
"endpointServiceId": "production-westus3-0-0.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.westus3.azure.privatelinkservice",
95+
"privateDnsHostname": "xxxxxxxxxx.westus3.privatelink.azure.clickhouse.cloud"
9696
}
9797
```
9898

9999
Make a note of the `endpointServiceId`. You'll use it in the next step.
100100

101101
## Create a Private Endpoint in Azure {#create-private-endpoint-in-azure}
102102

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+
103111
In this section, we're going to create a Private Endpoint in Azure. You can use either the Azure Portal or Terraform.
104112

105113
### 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:
204212

205213
## Setting up DNS for Private Link {#setting-up-dns-for-private-link}
206214

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:
218-
219-
```json
220-
resource "azurerm_private_dns_zone" "clickhouse_cloud_private_link_zone" {
221-
name = "${var.location}.privatelink.azure.clickhouse.cloud"
222-
resource_group_name = var.resource_group_name
223-
}
224-
```
225-
226-
### Create a wildcard DNS record {#create-a-wildcard-dns-record}
227-
228-
Create a wildcard record and point to your Private Endpoint:
229-
230-
**Option 1: Using Azure Portal**
231-
232-
1. Open the `MyAzureResourceGroup` resource group and select the `${region_code}.privatelink.azure.clickhouse.cloud` private zone.
233-
2. Select + Record set.
234-
3. For Name, type `*`.
235-
4. For IP Address, type the IP address you see for Private Endpoint.
236-
5. Select **OK**.
237-
238-
<img src={azure_pl_dns_wildcard} alt="Private Link DNS Wildcard Setup" />
239-
240-
**Option 2: Using Terraform**
241-
242-
Use the following Terraform template to create a wildcard DNS record:
243-
244-
```json
245-
resource "azurerm_private_dns_a_record" "example" {
246-
name = "*"
247-
zone_name = var.zone_name
248-
resource_group_name = var.resource_group_name
249-
ttl = 300
250-
records = ["10.0.0.4"]
251-
}
252-
```
253-
254-
### 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+
:::
263218

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.
265220

266-
```json
267-
resource "azurerm_private_dns_zone_virtual_network_link" "example" {
268-
name = "test"
269-
resource_group_name = var.resource_group_name
270-
private_dns_zone_name = var.zone_name
271-
virtual_network_id = var.virtual_network_id
272-
}
273-
```
274221

275222
### Verify DNS setup {#verify-dns-setup}
276223

277-
Any record within the `westus3.privatelink.azure.clickhouse.cloud` domain should be pointed to the Private Endpoint IP. (10.0.0.4 in this example).
224+
`xxxxxxxxxx.westus3.privatelink.azure.clickhouse.cloud` domain should be pointed to the Private Endpoint IP. (10.0.0.4 in this example).
278225

279226
```bash
280-
nslookup instance-id.westus3.privatelink.azure.clickhouse.cloud.
281-
Server: 127.0.0.53
282-
Address: 127.0.0.53#53
227+
nslookup xxxxxxxxxx.westus3.privatelink.azure.clickhouse.cloud.
228+
Server: 127.0.0.53
229+
Address: 127.0.0.53#53
283230

284231
Non-authoritative answer:
285-
Name: instance-id.westus3.privatelink.azure.clickhouse.cloud
232+
Name: xxxxxxxxxx.westus3.privatelink.azure.clickhouse.cloud
286233
Address: 10.0.0.4
287234
```
288235

@@ -309,7 +256,7 @@ ENDPOINT_ID=<Private Endpoint resourceGuid>
309256
REGION=<region code, use Azure format>
310257
```
311258

312-
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.
313260

314261
Run the following command to add the Private Endpoint:
315262

@@ -351,7 +298,7 @@ EOF
351298
After adding or removing a Private Endpoint, run the following command to apply it to your organization:
352299

353300
```bash
354-
curl --silent --user ${KEY_ID:?}:${KEY_SECRET:?} -X PATCH -H "Content-Type: application/json" https://api.clickhouse.cloud/v1/organizations/${ORG_ID:?} -d @pl_config_org.json
301+
curl --silent --user "${KEY_ID:?}:${KEY_SECRET:?}" -X PATCH -H "Content-Type: application/json" "https://api.clickhouse.cloud/v1/organizations/${ORG_ID:?}" -d @pl_config_org.json
355302
```
356303

357304
## Add the Private Endpoint GUID to your service(s) allow list {#add-private-endpoint-guid-to-services-allow-list}
@@ -414,16 +361,13 @@ EOF
414361
After adding or removing a Private Endpoint to the services allow list, run the following command to apply it to your organization:
415362

416363
```bash
417-
curl --silent --user ${KEY_ID:?}:${KEY_SECRET:?} -X PATCH -H "Content-Type: application/json" https://api.clickhouse.cloud/v1/organizations/${ORG_ID:?}/services/${INSTANCE_ID?} -d @pl_config.json | jq
364+
curl --silent --user "${KEY_ID:?}:${KEY_SECRET:?}" -X PATCH -H "Content-Type: application/json" "https://api.clickhouse.cloud/v1/organizations/${ORG_ID:?}/services/${INSTANCE_ID:?}" -d @pl_config.json | jq
418365
```
419366

420367
## Access your ClickHouse Cloud service using Private Link {#access-your-clickhouse-cloud-service-using-private-link}
421368

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).
423370

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-
:::
427371

428372
### Obtaining the Private DNS Hostname {#obtaining-the-private-dns-hostname}
429373

@@ -447,7 +391,7 @@ INSTANCE_ID=<Instance ID>
447391
Run the following command:
448392

449393
```bash
450-
curl --silent --user ${KEY_ID:?}:${KEY_SECRET:?} https://api.clickhouse.cloud/v1/organizations/${ORG_ID:?}/services/${INSTANCE_ID:?}/privateEndpointConfig | jq .result
394+
curl --silent --user "${KEY_ID:?}:${KEY_SECRET:?}" "https://api.clickhouse.cloud/v1/organizations/${ORG_ID:?}/services/${INSTANCE_ID:?}/privateEndpointConfig" | jq .result
451395
```
452396

453397
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
467411

468412
### Test DNS setup {#test-dns-setup}
469413

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`.
471-
472414
Run the following command:
473415

474416
```bash
475-
nslookup abcd.westus3.privatelink.azure.clickhouse.cloud.
417+
nslookup <dns name>
476418
```
419+
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)
477420

478421
You should receive the following response:
479422

480423
```response
481424
Non-authoritative answer:
482-
Name: abcd.westus3.privatelink.azure.clickhouse.cloud
425+
Name: <dns name>
483426
Address: 10.0.0.4
484427
```
485428

@@ -536,8 +479,7 @@ INSTANCE_ID=<Instance ID>
536479
Run the following command to check Private Endpoint filters:
537480

538481
```bash
539-
curl --silent --user ${KEY_ID:?}:${KEY_SECRET:?} -X GET -H "Content-Type: application/json" https://api.clickhouse.cloud/v1/organizations/${ORG_ID:?}/services/${INSTANCE_ID:?} | jq .result.privateEndpointIds
540-
[]
482+
curl --silent --user "${KEY_ID:?}:${KEY_SECRET:?}" -X GET -H "Content-Type: application/json" "https://api.clickhouse.cloud/v1/organizations/${ORG_ID:?}/services/${INSTANCE_ID:?}" | jq .result.privateEndpointIds
541483
```
542484

543485
## More information {#more-information}

0 commit comments

Comments
 (0)