Skip to content

Commit cb3312e

Browse files
kbatuigasmicheleRP
andauthored
How to pass in secrets to cluster config (#283)
* Add secrets management content * Revert to original include directive * Add manage secrets to What's new * Cross reference doc for setting config property * Apply suggestions from automated review * Correct notation for referencing secret in API * Explicitly mention that Control Plane API is first called to retrieve URL * Update secret might take a while to process * Apply suggestions * Apply suggestions from code review Co-authored-by: Michele Cyran <[email protected]> * Update local-antora-playbook.yml * Update local-antora-playbook.yml --------- Co-authored-by: Michele Cyran <[email protected]>
1 parent e5c92ce commit cb3312e

File tree

2 files changed

+91
-3
lines changed

2 files changed

+91
-3
lines changed

modules/get-started/pages/whats-new-cloud.adoc

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,18 @@ Iceberg topics are supported for BYOC clusters in AWS and GCP.
2929

3030
You can now xref:manage:cluster-maintenance/config-cluster.adoc[configure certain cluster properties] with `rpk cluster config` or with the Cloud API. For example, you can enable and manage xref:manage:iceberg/about-iceberg-topics.adoc[Iceberg topics], xref:develop:data-transforms/index.adoc[data transforms], and xref:manage:audit-logging.adoc[audit logging]. Available properties are listed in xref:reference:properties/cluster-properties.adoc[Cluster Configuration Properties].
3131

32-
Iceberg topics properties are available for clusters running Redpanda version 25.1 or later.
32+
Iceberg topics properties are available for clusters running Redpanda version 25.1 or later.
33+
34+
=== Manage secrets for cluster configuration
35+
36+
Redpanda Cloud now supports managing secrets that you can reference in cluster properties, for example, to configure Iceberg topics. You can create, update, and delete secrets and reference a secret in cluster properties using `rpk` or the Cloud API.
37+
38+
See also:
39+
40+
* Manage secrets using xref:reference:rpk/rpk-security/rpk-security-secret.adoc[`rpk security secret`]
41+
* Manage secrets using the xref:manage:api/cloud-dataplane-api.adoc#manage-secrets[Data Plane API]
42+
* Reference a secret in a cluster property using xref:reference:rpk/rpk-cluster/rpk-cluster-config-set.adoc[`rpk cluster config set`]
43+
* Reference a secret in a cluster property using the xref:manage:cluster-maintenance/config-cluster.adoc[Control Plane API]
3344

3445
=== Data transforms: GA
3546

modules/manage/pages/api/cloud-dataplane-api.adoc

Lines changed: 79 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ The xref:manage:api/cloud-api-overview.adoc#cloud-api-architecture[data plane] c
1515
BYOC or Dedicated::
1616
+
1717
--
18-
To retrieve the Data Plane API URL of a cluster, make a request to xref:api:ROOT:cloud-controlplane-api.adoc#get-/v1/clusters/-id-[`GET /v1/clusters/\{id}`].
18+
To retrieve the Data Plane API URL of a cluster, make a request to the xref:api:ROOT:cloud-controlplane-api.adoc#get-/v1/clusters/-id-[`GET /v1/clusters/\{id}`] endpoint of the Control Plane API.
1919
--
2020
2121
Serverless::
2222
+
2323
--
24-
To retrieve the Data Plane API URL of a cluster, make a request to xref:api:ROOT:cloud-controlplane-api.adoc#get-/v1/serverless/clusters/-id-[`GET /v1/serverless/clusters/\{id}`].
24+
To retrieve the Data Plane API URL of a cluster, make a request to the xref:api:ROOT:cloud-controlplane-api.adoc#get-/v1/serverless/clusters/-id-[`GET /v1/serverless/clusters/\{id}`] endpoint of the Control Plane API.
2525
--
2626
======
2727

@@ -100,6 +100,83 @@ curl -X POST "<dataplane-api-url>/v1/topics" \
100100
-d '{"name":"<topic-name>"}'
101101
----
102102

103+
=== Manage secrets
104+
105+
Secrets are stored externally in your cloud provider’s secret management service. Redpanda fetches the secrets when you reference them in cluster properties.
106+
107+
==== Create a secret
108+
109+
Make a request to xref:api:ROOT:cloud-dataplane-api.adoc#post-/v1/secrets[`POST /v1/secrets`]. You must use a Base64-encoded secret.
110+
111+
[,bash]
112+
----
113+
curl -X POST "https://<dataplane-api-url>/v1/secrets" \
114+
-H "accept: application/json" \
115+
-H "authorization: Bearer <token>" \
116+
-H "content-type: application/json" \
117+
-d '{"id":"<secret-name>","scopes":["SCOPE_REDPANDA_CLUSTER"],"secret_data":"<secret-value>"}'
118+
----
119+
120+
You must include the following values:
121+
122+
- `<dataplane-api-url>`: The base URL for the Data Plane API.
123+
- `<token>`: The API key you generated during authentication.
124+
- `<secret-name>`: The name of the secret you want to add. Use only the following characters: `^[A-Z][A-Z0-9_]*$`.
125+
- `<secret-value>`: The Base64-encoded secret.
126+
- This scope: `"SCOPE_REDPANDA_CLUSTER"`.
127+
128+
The response returns the name and scope of the secret.
129+
130+
You can then use the Control Plane API or `rpk` to xref:manage:cluster-maintenance/config-cluster.adoc[set a cluster property value] to reference a secret, using the secret name.
131+
132+
For the Control Plane API, you must use the following notation with the secret name in the request body to correctly reference the secret:
133+
134+
```bash
135+
"iceberg_rest_catalog_client_secret": "${secrets.<secret-name>}"
136+
```
137+
138+
==== Update a secret
139+
140+
Make a request to xref:api:ROOT:cloud-dataplane-api.adoc#put-/v1/secrets/-id-[`PUT /v1/secrets/\{id}`]. You can only update the secret value, not its name. You must use a Base64-encoded secret.
141+
142+
[,bash]
143+
----
144+
curl -X PUT "https://<dataplane-api-url>/v1/secrets/<secret-name>" \
145+
-H "accept: application/json" \
146+
-H "authorization: Bearer <token>" \
147+
-H "content-type: application/json" \
148+
-d '{"scopes":["SCOPE_REDPANDA_CLUSTER"],"secret_data":"<new-secret-value>"}'
149+
----
150+
151+
You must include the following values:
152+
153+
- `<dataplane-api-url>`: The base URL for the Data Plane API.
154+
- `<secret-name>`: The name of the secret you want to update. The secret's name is also its ID.
155+
- `<token>`: The API key you generated during authentication.
156+
- This scope: `"SCOPE_REDPANDA_CLUSTER"`.
157+
- `<new-secret-value>`: Your new Base64-encoded secret.
158+
159+
The response returns the name and scope of the secret. It might take several minutes for the new secret value to propagate to any cluster properties that reference it.
160+
161+
==== Delete a secret
162+
163+
Before you delete a secret, make sure that you remove references to it from your cluster configuration.
164+
165+
Make a request to xref:api:ROOT:cloud-dataplane-api.adoc#delete-/v1/secrets/-id-[`DELETE /v1/secrets/\{id}`].
166+
167+
[,bash]
168+
----
169+
curl -X DELETE "https://<dataplane-api-url>/v1/secrets/<secret-name>" \
170+
-H "accept: application/json" \
171+
-H "authorization: Bearer <token>" \
172+
----
173+
174+
You must include the following values:
175+
176+
- `<dataplane-api-url>`: The base URL for the Data Plane API.
177+
- `<secret-name>`: The name of the secret you want to delete.
178+
- `<token>`: The API key you generated during authentication.
179+
103180
=== Use Redpanda Connect
104181

105182
Use the API to manage xref:develop:connect/about.adoc[Redpanda Connect pipelines] in Redpanda Cloud.

0 commit comments

Comments
 (0)