Skip to content

Commit 4187422

Browse files
committed
docs: add confluent cloud example
1 parent 2f61087 commit 4187422

File tree

5 files changed

+86
-1
lines changed

5 files changed

+86
-1
lines changed

docs/confluent-cloud.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ To use `kafka-gitops` with Confluent Cloud, you'll need to set a few environment
4141

4242
* `KAFKA_BOOTSTRAP_SERVERS`: Your Confluent Cloud cluster URL
4343
* `KAFKA_SASL_JAAS_USERNAME`: Your Confluent Cloud API key
44-
* `KAFKA_SASL_JAAS_USERNAME`: Your Confluent Cloud API secret
44+
* `KAFKA_SASL_JAAS_PASSWORD`: Your Confluent Cloud API secret
4545
* `KAFKA_SECURITY_PROTOCOL`: `SASL_SSL`
4646
* `KAFKA_SASL_MECHANISM`: `PLAIN`
4747
* `KAFKA_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM`: `HTTPS`

examples/confluent-cloud/README.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Confluent Cloud Example
2+
3+
This is a basic example of using `kafka-gitops` with Confluent Cloud.
4+
5+
## Files
6+
- `services.yaml` defines service accounts + generates ACLs
7+
- `topics.yaml` defines topics and their configs
8+
- `users.yaml` defines "user" service accounts and roles (prefixed with `user-{name}`)
9+
10+
## Configuration
11+
12+
The following environment variables need to be set locally or in the build job:
13+
14+
```bash
15+
# For service account creation / listing
16+
export XX_CCLOUD_EMAIL="Your Confluent Cloud email address"
17+
export XX_CCLOUD_PASSWORD="Your Confluent Cloud password"
18+
19+
# For executing against the cluster
20+
export KAFKA_BOOTSTRAP_SERVERS="Your Confluent Cloud cluster URL"
21+
export KAFKA_SASL_JAAS_USERNAME"Your Confluent Cloud API key"
22+
export KAFKA_SASL_JAAS_PASSWORD="Your Confluent Cloud API secret"
23+
export KAFKA_SECURITY_PROTOCOL="SASL_SSL"
24+
export KAFKA_SASL_MECHANISM="PLAIN"
25+
export KAFKA_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM="HTTPS"
26+
27+
# For colored output
28+
export CLICOLOR_FORCE="true"
29+
```
30+
31+
## Service Accounts
32+
33+
Once defining services and users, you can generate service accounts.
34+
35+
**NOTE**: Before running `accounts` or `plan`, ensure you are logged in to Confluent Cloud. Use `ccloud login`.
36+
37+
Create accounts:
38+
39+
```bash
40+
kafka-gitops -f state.yaml accounts
41+
```
42+
43+
## Plan
44+
45+
Generate an execution plan against your Confluent Cloud cluster as so:
46+
47+
```bash
48+
kafka-gitops -f state.yaml plan -o plan.json
49+
```
50+
51+
To disable deletes, you can use:
52+
53+
```bash
54+
kafka-gitops -f state.yaml --no-delete plan -o plan.json
55+
```
56+
57+
This will output a plan file as well as pretty print the plan to standard out.
58+
59+
## Apply
60+
61+
Apply the plan against your Confluent Cloud cluster as so:
62+
63+
```bash
64+
kafka-gitops -f state.yaml apply -p plan.json
65+
```
66+
67+
68+
To disable deletes, you can use:
69+
70+
```bash
71+
kafka-gitops -f state.yaml --no-delete apply -p plan.json
72+
```
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
services:
2+
my-test-service:
3+
type: application
4+
consumes:
5+
- my-test-topic
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
topics:
2+
my-test-topic:
3+
partitions: 6
4+
replication: 3
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
users:
2+
john-doe:
3+
roles:
4+
- operator

0 commit comments

Comments
 (0)