我用linkedin巡航控制在minikube上建立了一个Kafka集群。我试图启用巡航控制图形用户界面上的步骤巡航控制用户界面git集线器页面,但它不会工作。
当我从pod中 curl 地址时,它返回我要进入的页面的html代码,但是当我尝试在我的web浏览器中时,页面没有连接。我想我需要通过一个服务来暴露pod,但它也不起作用。我还试图更改cruisecontrol.properties的属性,但什么也没做。
吊舱正在运行:
cruise-control-cbdd6bf54-prfts 1/1 Running 2 23h
kafka-0 1/1 Running 1 23h
kafka-1 1/1 Running 3 23h
kafka-2 1/1 Running 1 23h
pzoo-0 1/1 Running 0 23h
pzoo-1 1/1 Running 0 23h
pzoo-2 1/1 Running 1 23h
topic-cruise-control-metrics-fjdlw 0/1 Completed 0 23h
zoo-0 1/1 Running 1 23h
zoo-1 1/1 Running 1 23h
巡航控制舱
Containers:
cruise-control:
Container ID: docker://b6d43bb8db047480374b19671a761013a2fba39a398215276ffb456a1d9a9f2d
Image: solsson/kafka-cruise-control@sha256:f48acf73d09e6cf56f15fd0b9057cad36b3cee20963a52d263732bf7e5c1aae1
Image ID: docker-pullable://solsson/kafka-cruise-control@sha256:f48acf73d09e6cf56f15fd0b9057cad36b3cee20963a52d263732bf7e5c1aae1
Port: 8090/TCP
Host Port: 0/TCP
State: Running
Started: Tue, 21 Jul 2020 10:32:27 -0300
Last State: Terminated
Reason: Error
Exit Code: 1
Started: Tue, 21 Jul 2020 10:31:47 -0300
Finished: Tue, 21 Jul 2020 10:31:59 -0300
Ready: True
Restart Count: 2
Requests:
cpu: 100m
memory: 512Mi
Readiness: tcp-socket :8090 delay=0s timeout=1s period=10s #success=1 #failure=3
Environment: <none>
Mounts:
/opt/cruise-control/config from config (rw)
/var/run/secrets/kubernetes.io/serviceaccount from default-token-5kp9f (ro)
cruisecontrol.properties属性
configurations for the webserver
# ================================
# HTTP listen port
webserver.http.port=8090
# HTTP listen address
webserver.http.address=0.0.0.0
# Whether CORS support is enabled for API or not
webserver.http.cors.enabled=false
# Value for Access-Control-Allow-Origin
webserver.http.cors.origin=http://localhost:8080/
# Value for Access-Control-Request-Method
webserver.http.cors.allowmethods=OPTIONS,GET,POST
# Headers that should be exposed to the Browser (Webapp)
# This is a special header that is used by the
# User Tasks subsystem and should be explicitly
# Enabled when CORS mode is used as part of the
# Admin Interface
webserver.http.cors.exposeheaders=User-Task-ID
# REST API default prefix
# (dont forget the ending *)
webserver.api.urlprefix=/kafkacruisecontrol/*
# Location where the Cruise Control frontend is deployed
webserver.ui.diskpath=./cruise-control-ui/dist/
# URL path prefix for UI
# (dont forget the ending *)
webserver.ui.urlprefix=/*
抄送服务
Name: cruise-control
Namespace: mindlabs
Labels: <none>
Annotations: Selector: app=cruise-control
Type: ClusterIP
IP: 10.98.201.106
Port: <unset> 8090/TCP
TargetPort: 8090/TCP
Endpoints: 172.18.0.14:8090
Session Affinity: None
Events: <none>
谢谢你的帮助!
2条答案
按热度按时间ax6ht2ek1#
默认情况下,pod只能通过kubernetes集群中的内部ip地址访问。
要从kubernetes虚拟网络外部访问容器,必须将pod作为kubernetes服务公开。
在minikube上,loadbalancer类型使服务可以通过
minikube service
命令。需要两个步骤:对于这种特殊情况,需要用“巡航控制”替换“部署名称”
这将打开一个浏览器窗口,为您的应用程序提供服务并显示应用程序的响应。
nue99wik2#
结果我不得不将本地8090端口转发到集群8090端口。我用以下方法解决了这个问题:
kubectl port-forward svc/cruise-control 8090:8090