Skip to content

Commit 6a2ca09

Browse files
authored
Merge pull request #98 from pon0marev/additional-tools/kafka
Additional tools/kafka-ui
2 parents 7af6464 + 4c49d6c commit 6a2ca09

File tree

3 files changed

+117
-69
lines changed

3 files changed

+117
-69
lines changed

kafka/tb-kafka-ui.yml

Lines changed: 0 additions & 69 deletions
This file was deleted.

tools /kafka/README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
2+
# Kafka manager with web UI to monitor and maintain Kafka's clusters
3+
4+
## General Information
5+
The container on: [Docker Redpanda Console](https://hub.docker.com/r/redpandadata/console)
6+
7+
You can find the documentation of the service here: [Redpanda Console repository](https://github.com/redpanda-data/console)
8+
9+
## Deployment
10+
By default, the service has 50 mCPU and 100 megabytes of RAM requested resources. This is enough for the normal operation of the service. But this value can be overridden individually for each deployment.
11+
12+
By default, our Redpanda Console deployment is configured to use Kubernetes **tb-kafka** service as a connection endpoint to Kafka. If you use an external broker, please override the `KAFKA_BROKERS` variable to list your kafka brokers, a.g.:
13+
14+
```shell
15+
- name: KAFKA_BROKERS
16+
value: "kafka-broker1:9092,kafka-broker2:9092,kafka-broker3:9092"
17+
```
18+
19+
### Configuring access to Kafka via SASL
20+
21+
Uncomment the variables in the tb-kafka-ui.yml deployment file to use SASL.
22+
23+
For the username and password, the best practice is to use Kubernetes Secrets. Please specify them *(Be sure to change **YOUR_USERNAME** and **YOUR_PASSWORD**)*:
24+
```shell
25+
export SASL_USERNAME=YOUR_USERNAME
26+
export SASL_PASSWORD=YOUR_PASSWORD
27+
28+
kubectl create -n thingsboard secret generic kafka-sasl-credentials \
29+
--from-literal=kafka-sasl-username=$SASL_USERNAME \
30+
--from-literal=kafka-sasl-password=$SASL_PASSWORD
31+
```
32+
33+
Apply the deployment file:
34+
```shell
35+
kubectl apply -f tb-kafka-ui.yml
36+
```
37+
38+
## Connect to UI
39+
40+
We didn't add external access to this tool because it is a system tool. So use port forwarding to the local machine to access the service:
41+
```shell
42+
kubectl port-forward sts/kafka-ui-redpanda 8085:8080
43+
```
44+
45+
goto weblink: http://localhost:8085
46+
47+
48+
If Kafka UI does not need, scale it down:
49+
```shell
50+
kubectl scale --replicas=0 statefulset kafka-ui-redpanda
51+
```

tools /kafka/tb-kafka-ui.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#
2+
# Copyright © 2016-2021 The Thingsboard Authors
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
apiVersion: apps/v1
18+
kind: StatefulSet
19+
metadata:
20+
name: kafka-ui-redpanda
21+
spec:
22+
serviceName: kafka-ui-redpanda
23+
replicas: 1
24+
selector:
25+
matchLabels:
26+
app: kafka-ui-redpanda
27+
template:
28+
metadata:
29+
labels:
30+
app: kafka-ui-redpanda
31+
spec:
32+
containers:
33+
- name: server
34+
imagePullPolicy: IfNotPresent
35+
image: docker.redpanda.com/redpandadata/console:latest
36+
resources:
37+
requests:
38+
cpu: 50m
39+
memory: 100Mi
40+
limits:
41+
cpu: 200m
42+
memory: 400Mi
43+
ports:
44+
- containerPort: 8080
45+
name: http8080
46+
env:
47+
- name: KAFKA_BROKERS
48+
value: "tb-kafka:9092" # put your broker list here. By default - tb-kafka:9092
49+
# Please uncomment lines below if you need access to Kafka with SASL.
50+
# - name: KAFKA_TLS_ENABLED
51+
# value: "true"
52+
# - name: KAFKA_SASL_ENABLED
53+
# value: "true"
54+
# - name: KAFKA_SASL_USERNAME
55+
# valueFrom:
56+
# secretKeyRef:
57+
# name: kafka-sasl-credentials
58+
# key: kafka-sasl-username
59+
# optional: false
60+
# - name: KAFKA_SASL_PASSWORD
61+
# valueFrom:
62+
# secretKeyRef:
63+
# name: kafka-sasl-credentials
64+
# key: kafka-sasl-password
65+
# optional: false
66+
restartPolicy: Always

0 commit comments

Comments
 (0)