Skip to content

Commit d84a4d8

Browse files
kbatuigasmicheleRP
andauthored
Update Iceberg catalog doc for Cloud (single source) (#1113)
Co-authored-by: Michele Cyran <michele@redpanda.com>
1 parent 6ed318a commit d84a4d8

File tree

1 file changed

+117
-5
lines changed

1 file changed

+117
-5
lines changed

modules/manage/partials/iceberg/use-iceberg-catalogs.adoc

Lines changed: 117 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ For production deployments, Redpanda recommends using an external REST catalog t
1111

1212
After you have selected a catalog type at the cluster level and xref:{about-iceberg-doc}#enable-iceberg-integration[enabled the Iceberg integration] for a topic, you cannot switch to another catalog type.
1313

14-
ifndef::env-cloud[]
1514
== Connect to a REST catalog
1615

1716
Connect to an Iceberg REST catalog using the standard https://github.com/apache/iceberg/blob/main/open-api/rest-catalog-open-api.yaml[REST API^] supported by many catalog providers. Use this catalog integration type with REST-enabled Iceberg catalog services, such as https://docs.databricks.com/en/data-governance/unity-catalog/index.html[Databricks Unity^] and https://other-docs.snowflake.com/en/opencatalog/overview[Snowflake Open Catalog^].
@@ -34,14 +33,125 @@ Redpanda uses the bearer token unconditionally and does not attempt to refresh t
3433

3534
For REST catalogs that use self-signed certificates, also configure these properties:
3635

37-
* config_ref:iceberg_rest_catalog_trust_file,true,properties/cluster-properties[`iceberg_rest_catalog_trust_file`]: The path to a file containing a certificate chain to trust for the REST catalog.
38-
* config_ref:iceberg_rest_catalog_crl_file,true,properties/cluster-properties[`iceberg_rest_catalog_crl_file`]: The path to the certificate revocation list for the specified trust file.
36+
* config_ref:iceberg_rest_catalog_trust,true,properties/cluster-properties[`iceberg_rest_catalog_trust`]: The contents of a certificate chain to trust for the REST catalog.
37+
ifndef::env-cloud[]
38+
** Or, use config_ref:iceberg_rest_catalog_trust_file,true,properties/cluster-properties[`iceberg_rest_catalog_trust_file`] to specify the path to the certificate chain file.
39+
endif::[]
40+
* config_ref:iceberg_rest_catalog_crl,true,properties/cluster-properties[`iceberg_rest_catalog_crl`]: The contents of a certificate revocation list for `iceberg_rest_catalog_trust`.
41+
ifndef::env-cloud[]
42+
** Or, use config_ref:iceberg_rest_catalog_crl_file,true,properties/cluster-properties[`iceberg_rest_catalog_crl_file`] to specify the path to the certificate revocation list file.
43+
endif::[]
3944

4045
See xref:reference:properties/cluster-properties.adoc[Cluster Configuration Properties] for the full list of cluster properties to configure for a catalog integration.
4146

47+
ifdef::env-cloud[]
48+
=== Store a secret for REST catalog authentication
49+
50+
To store a secret that you can reference in your catalog authentication cluster properties, you must create the secret using `rpk` or the Data Plane API. Secrets are stored in the secret management solution of your cloud provider. Redpanda retrieves the secrets at runtime.
51+
52+
For more information, see xref:manage:rpk/intro-to-rpk.adoc[] and xref:manage:api/cloud-api-overview.adoc[].
53+
54+
If you need to configure any of the following properties, you must set their values using secrets:
55+
56+
* `iceberg_rest_catalog_client_secret`
57+
* `iceberg_rest_catalog_crl`
58+
* `iceberg_rest_catalog_token`
59+
* `iceberg_rest_catalog_trust`
60+
61+
To create a new secret:
62+
63+
[tabs]
64+
=====
65+
rpk::
66+
+
67+
--
68+
Run the following `rpk` command:
69+
70+
[,bash]
71+
----
72+
rpk security secret create --name <secret-name> --value <secret-value> --scopes redpanda_cluster
73+
----
74+
--
75+
76+
Cloud API::
77+
+
78+
--
79+
. Authenticate and make a `GET /v1/clusters/\{id}` request to xref:manage:api/cloud-dataplane-api.adoc#get-data-plane-api-url[retrieve the Data Plane API URL] for your cluster.
80+
. Make a request to xref:api:ROOT:cloud-dataplane-api.adoc#post-/v1/secrets[`POST /v1/secrets`]. You must use a Base64-encoded secret.
81+
+
82+
[,bash]
83+
----
84+
curl -X POST "https://<dataplane-api-url>/v1/secrets" \
85+
-H 'accept: application/json'\
86+
-H 'authorization: Bearer <token>'\
87+
-H 'content-type: application/json' \
88+
-d '{"id":"<secret-name>","scopes":["SCOPE_REDPANDA_CLUSTER"],"secret_data":"<secret-value>"}'
89+
----
90+
+
91+
You must include the following values:
92+
93+
- `<dataplane-api-url>`: The base URL for the Data Plane API.
94+
- `<token>`: The API key you generated during authentication.
95+
- `<secret-name>`: The name of the secret you want to add. The secret name is also its ID. Use only the following characters: `^[A-Z][A-Z0-9_]*$`.
96+
- `<secret-value>`: The Base64-encoded secret.
97+
- This scope: `"SCOPE_REDPANDA_CLUSTER"`.
98+
99+
+
100+
The response returns the name and scope of the secret.
101+
102+
You can now <<use-a-secret-in-cluster-configuration,reference the secret in your cluster configuration>>.
103+
104+
--
105+
=====
106+
107+
=== Use a secret in cluster configuration
108+
109+
To set the cluster property to use the value of the secret, use `rpk` or the Control Plane API.
110+
111+
For example, to use a secret for the `iceberg_rest_catalog_client_secret` property, run:
112+
113+
[tabs]
114+
=====
115+
rpk::
116+
+
117+
--
118+
[,bash]
119+
----
120+
rpk cluster config set iceberg_rest_catalog_client_secret ${secrets.<secret-name>}
121+
----
122+
--
123+
124+
Cloud API::
125+
+
126+
--
127+
Make a request to the xref:api:ROOT:cloud-controlplane-api.adoc#patch-/v1/clusters/-cluster.id-[`PATCH /v1/clusters/<cluster-id>`] endpoint of the Control Plane API.
128+
129+
[,bash]
130+
----
131+
curl -H "Authorization: Bearer <token>" -X PATCH \
132+
"https://api.cloud.redpanda.com/v1/clusters/<cluster-id>" \
133+
-H 'accept: application/json'\
134+
-H 'content-type: application/json' \
135+
-d '{"cluster_configuration": {
136+
"custom_properties": {
137+
"iceberg_rest_catalog_client_secret": "${secrets.<secret-name>}"
138+
}
139+
}
140+
}'
141+
----
142+
143+
You must include the following values:
144+
145+
- `<cluster-id>`: The ID of the Redpanda cluster.
146+
- `<token>`: The API key you generated during authentication.
147+
- `<secret-name>`: The name of the secret you created earlier.
148+
--
149+
=====
150+
endif::[]
151+
42152
=== Example REST catalog configuration
43153

44-
For example, if you have Redpanda cluster configuration properties set to connect to a REST catalog:
154+
Suppose you configure the following Redpanda cluster properties for connecting to a REST catalog:
45155

46156
[,yaml]
47157
----
@@ -52,7 +162,7 @@ iceberg_rest_catalog_client_id: <rest-connection-id>
52162
iceberg_rest_catalog_client_secret: <rest-connection-secret>
53163
----
54164

55-
And you use Apache Spark as a processing engine, configured to use a catalog named `streaming`:
165+
If you use Apache Spark as a processing engine, your Spark configuration might look like the following. This example uses a catalog named `streaming`:
56166

57167
[,spark]
58168
----
@@ -78,6 +188,8 @@ SELECT * FROM streaming.redpanda.<table-name>;
78188

79189
The Iceberg table name is the name of your Redpanda topic. Redpanda puts the Iceberg table into a namespace called `redpanda`, creating the namespace if necessary.
80190

191+
// Hide section in Cloud until Snowflake doc is single sourced
192+
ifndef::env-cloud[]
81193
TIP: You may need to explicitly create a table for the Iceberg data in your query engine. For an example, see xref:manage:iceberg/redpanda-topics-iceberg-snowflake-catalog.adoc[].
82194
endif::[]
83195

0 commit comments

Comments
 (0)