Skip to content

Commit 703c003

Browse files
github-actions[bot]upload-charms-docs-bot
and
upload-charms-docs-bot
authored
[discourse-gatekeeper] Update deployment instructions with stable track and trust (#134)
Co-authored-by: upload-charms-docs-bot <[email protected]>
1 parent 6054467 commit 703c003

File tree

3 files changed

+31
-16
lines changed

3 files changed

+31
-16
lines changed

docs/how-to/h-deploy.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,14 @@ juju show-model | yq '.[].type'
6464
The Kafka and ZooKeeper charms can both be deployed as follows:
6565

6666
```commandline
67-
juju deploy kafka-k8s --channel 3/edge -n <kafka-units>
68-
juju deploy zookeeper-k8s --channel 3/edge -n <zookeeper-units>
67+
juju deploy kafka-k8s --channel 3/stable -n <kafka-units> --trust
68+
juju deploy zookeeper-k8s --channel 3/stable -n <zookeeper-units>
6969
```
7070

7171
where `<kafka-units>` and `<zookeeper-units>` -- the number of units to deploy for Kafka and ZooKeeper. We recommend values of at least `3` and `5` respectively.
7272

73+
> **NOTE** The `--trust` option is needed for the Kafka application to work properly, e.g., use NodePort or `juju refresh`. For more information about the trust options usage, see the [Juju documentation](/t/5476#heading--trust-an-application-with-a-credential).
74+
7375
Connect ZooKeeper and Kafka by relating/integrating the charms:
7476

7577
```commandline

docs/how-to/h-manage-units.md

+26-13
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Unit management guide for scaling and running admin utility scripts.
55
## Replication and scaling
66

77
Increasing the number of Kafka brokers can be achieved by adding more units
8-
to the Charmed Kafka K8s application, e.g.
8+
to the Charmed Kafka K8s application:
99

1010
```shell
1111
juju add-unit kafka-k8s -n <num_brokers_to_add>
@@ -18,8 +18,8 @@ It is important to note that when adding more units, the Kafka cluster will not
1818
will be used only when new topics and new partitions are created.
1919

2020
Partition reassignment can still be done manually by the admin user by using the
21-
`/opt/kafka/bin/kafka-reassign-partitions.sh` Kafka bin utility script. Please refer to
22-
its documentation for more information.
21+
`/opt/kafka/bin/kafka-reassign-partitions.sh` Kafka bin utility script. Please refer to the
22+
[Apache Kafka documentation](https://kafka.apache.org/documentation/#basic_ops_partitionassignment) for more information on the script usage.
2323

2424
> **IMPORTANT** Scaling down is currently not supported in the charm automation.
2525
> If partition reassignment is not manually performed before scaling down in order
@@ -29,16 +29,17 @@ its documentation for more information.
2929
## Running Kafka Admin utility scripts
3030

3131
Apache Kafka ships with `bin/*.sh` commands to do various administrative tasks such as:
32+
3233
* `bin/kafka-config.sh` to update cluster configuration
3334
* `bin/kafka-topics.sh` for topic management
3435
* `bin/kafka-acls.sh` for management of ACLs of Kafka users
3536

36-
Please refer to the upstream [Kafka project](https://github.com/apache/kafka/tree/trunk/bin),
37+
Please refer to the upstream [Kafka project](https://github.com/apache/kafka/tree/trunk/bin) or its [documentation](https://kafka.apache.org/documentation/#basic_ops),
3738
for a full list of the bash commands available in Kafka distributions. Also, you can
3839
use `--help` argument for printing a short summary of the argument for a given
3940
bash command.
4041

41-
These scripts can be found in the `/opt/kafka/bin` folder.
42+
These scripts can be found in the `/opt/kafka/bin` folder of the workload container.
4243

4344
> **IMPORTANT** Before running bash scripts, make sure that some listeners have been correctly
4445
> opened by creating appropriate integrations. Please refer to [this table](/t/charmed-kafka-k8s-documentation-reference-listeners/13270) for more
@@ -53,20 +54,22 @@ To run most of the scripts, you need to provide:
5354
### Juju admins of the Kafka deployment
5455

5556
For Juju admins of the Kafka deployment, the bootstrap servers information can
56-
be obtained using
57+
be obtained using the `get-admin-credentials` action output:
5758

5859
```
5960
BOOTSTRAP_SERVERS=$(juju run kafka-k8s/leader get-admin-credentials | grep "bootstrap.servers" | cut -d "=" -f 2)
6061
```
6162

6263
Admin client authentication information is stored in the
6364
`/etc/kafka/client.properties` file present on every Kafka
64-
broker. The content of the file can be accessed using
65+
container. The content of the file can be accessed using `juju ssh` command:
6566

6667
```
67-
juju ssh kafka-k8s/leader `cat /etc/kafka/client.properties`
68+
juju ssh --container kafka kafka-k8s/leader 'cat /etc/kafka/client.properties'
6869
```
6970

71+
where `--container kafka` is to select the Kafka workload container of the unit. By default, the charm operator container is opened.
72+
7073
This file can be provided to the Kafka bin commands via the `--command-config`
7174
argument. Note that `client.properties` may also refer to other files (
7275
e.g. truststore and keystore for TLS-enabled connections). Those
@@ -76,25 +79,35 @@ Commands can be run within a Kafka broker, since both the authentication
7679
file (along with the truststore if needed) and the Charmed Kafka binaries are
7780
already present.
7881

79-
#### Example (listing topics)
82+
#### Listing topics example
83+
84+
For instance, to list the current topics on the Kafka cluster, you can run:
85+
86+
```shell
87+
juju ssh --container kafka kafka-k8s/leader '/opt/kafka/bin/kafka-topics.sh --bootstrap-server $BOOTSTRAP_SERVERS --list --command-config /etc/kafka/client.properties'
88+
```
8089

81-
For instance, in order to list the current topics on the Kafka cluster, you can run:
90+
As long as `BOOTSTRAP_SERVERS` variable contains the information we retrieved earlier in the **Juju admins of the Kafka deployment** section.
91+
92+
For example, a full command without the usage of the variable might look like the following:
8293

8394
```shell
84-
juju ssh kafka-k8s/leader '/opt/kafka/bin/kafka-topics.sh --bootstrap-server $BOOTSTRAP_SERVERS --list --command-config /etc/kafka/client.properties'
95+
juju ssh --container kafka kafka-k8s/leader '/opt/kafka/bin/kafka-topics.sh --bootstrap-server kafka-k8s-0.kafka-k8s-endpoints:9092,kafka-k8s-1.kafka-k8s-endpoints:9092,kafka-k8s-2.kafka-k8s-endpoints:9092,kafka-k8s-3.kafka-k8s-endpoints:9092 --list --command-config /etc/kafka/client.properties'
8596
```
8697

98+
where `kafka-k8s-0.kafka-k8s-endpoints:9092,kafka-k8s-1.kafka-k8s-endpoints:9092,kafka-k8s-2.kafka-k8s-endpoints:9092,kafka-k8s-3.kafka-k8s-endpoints:9092` - is the contents of the `$BOOTSTRAP_SERVERS` variable.
99+
87100
### Juju external users
88101

89102
For external users managed by the [Data Integrator Charm](https://charmhub.io/data-integrator),
90-
the endpoints and credentials can be fetched using the dedicated action
103+
the endpoints and credentials can be fetched using the dedicated action:
91104

92105
```shell
93106
juju run data-integrator/leader get-credentials --format yaml
94107
```
95108

96109
The `client.properties` file can be generated by substituting the relevant information in the
97-
file available on the brokers at `/etc/kafka/client.properties`
110+
file available on the brokers at `/etc/kafka/client.properties`.
98111

99112
To do so, fetch the information using `juju` commands:
100113

docs/tutorial/t-deploy.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ To deploy Charmed Kafka K8s, all you need to do is run the following commands, w
66

77
```shell
88
$ juju deploy zookeeper-k8s -n 3
9-
$ juju deploy kafka-k8s -n 3
9+
$ juju deploy kafka-k8s -n 3 --trust
1010
```
1111

1212
After this, it is necessary to connect them:

0 commit comments

Comments
 (0)