-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathoptional-kafka-ui.sh
executable file
·57 lines (51 loc) · 993 Bytes
/
optional-kafka-ui.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env bash
set -e
# Turn colors in this script off by setting the NO_COLOR variable in your
# environment to any value:
#
# $ NO_COLOR=1 test.sh
NO_COLOR=${NO_COLOR:-""}
if [ -z "$NO_COLOR" ]; then
header=$'\e[1;33m'
reset=$'\e[0m'
else
header=''
reset=''
fi
function header_text {
echo "$header$*$reset"
}
header_text "Installing Kafka UI"
kubectl apply -n kafka -f - << EOF
apiVersion: v1
kind: Service
metadata:
name: kafka-ui
namespace: kafka
spec:
type: NodePort
ports:
- name: http
port: 8080
selector:
app: kafka-ui
---
apiVersion: v1
kind: Pod
metadata:
name: kafka-ui
namespace: kafka
labels:
app: kafka-ui
spec:
containers:
- env:
- name: KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS
value: my-cluster-kafka-bootstrap.kafka.svc:9092
- name: KAFKA_CLUSTERS_0_NAME
value: my-cluster
image: quay.io/openshift-knative/kafka-ui:0.1.0
name: user-container
---
EOF
minikube service -n kafka kafka-ui