我尝试使用manageiq建立与openshift的监控连接。容器提供程序已成功生成。
但问题是这种连接无法刷新。我将身份验证模式设置为httpd,如下所示,
但是,此配置会引发403错误。
有关您的信息,请参阅ssl_error.log和evm.log
== ssl_error.log ==
[Sat Jun 03 00:39:59.440542 2017] [proxy:error] [pid 2049] (111)Connection refused: AH00957: HTTP: attempt to connect to 0.0.0.0:3002 (0.0.0.0) failed
[Sat Jun 03 00:39:59.440548 2017] [proxy:error] [pid 2049] AH00959: ap_proxy_connect_backend disabling worker for (0.0.0.0) for 60s
[Sat Jun 03 00:39:59.440550 2017] [proxy_http:error] [pid 2049] [client 172.17.0.1:43722] AH01114: HTTP: failed to make connection to backend: 0.0.0.0, referer: https://localhost:8443/ems_container/1
[Sat Jun 03 00:39:59.570938 2017] [proxy:error] [pid 2049] (111)Connection refused: AH00957: HTTP: attempt to connect to 0.0.0.0:3001 (0.0.0.0) failed
[Sat Jun 03 00:39:59.570960 2017] [proxy:error] [pid 2049] AH00959: ap_proxy_connect_backend disabling worker for (0.0.0.0) for 60s
[Sat Jun 03 00:39:59.570963 2017] [proxy_http:error] [pid 2049] [client 172.17.0.1:43722] AH01114: HTTP: failed to make connection to backend: 0.0.0.0, referer: https://localhost:8443/ems_container/1
== evm.log ==
[----] E, [2017-06-03T00:43:41.697865 #2327:2ad9e81e2b4c] ERROR -- : MIQ(ManageIQ::Providers::Openshift::ContainerManager::EventCatcher::Runner#start_event_monitor) EMS [console.starter-us-east-1.openshift.com] as [] Event Monitor Thread aborted because [User "gladiator67@naver.com" cannot list all events in the cluster]
[----] E, [2017-06-03T00:43:41.698127 #2327:2ad9e81e2b4c] ERROR -- : [KubeException]: User "gladiator67@naver.com" cannot list all events in the cluster Method:[rescue in block in start_event_monitor]
[----] E, [2017-06-03T00:43:41.698272 #2327:2ad9e81e2b4c] ERROR -- : /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/kubeclient-2.3.0/lib/kubeclient/common.rb:107:in `rescue in handle_exception'
/opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/kubeclient-2.3.0/lib/kubeclient/common.rb:99:in `handle_exception'
/opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/kubeclient-2.3.0/lib/kubeclient/common.rb:258:in `get_entities'
/opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/kubeclient-2.3.0/lib/kubeclient/common.rb:169:in `block (2 levels) in define_entity_methods'
/opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/kubeclient-2.3.0/lib/kubeclient/common.rb:79:in `method_missing'
/opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/bundler/gems/manageiq-gems-pending-e0f3ea8755bf/lib/gems/pending/kubernetes/events/kubernetes_event_monitor.rb:32:in `each'
/var/www/miq/vmdb/app/models/manageiq/providers/kubernetes/container_manager/event_catcher_mixin.rb:41:in `monitor_events'
/var/www/miq/vmdb/app/models/manageiq/providers/base_manager/event_catcher/runner.rb:164:in `block in start_event_monitor'
然后,我如何才能在线监控openshift上自己的项目?在manageiq Docker容器上是不可能的?下面的代码是openshift Java客户端代码,它显示了我的openshift项目。
IClient client = new ClientBuilder("https://console.starter-us-east-1.openshift.com")
.withUserName("gladiator67@naver.com")
.withPassword("111111")
.build();
client.getAuthorizationContext().setToken("is-ildn...");
System.out.println("=======================================================================");
System.out.println(client.getOpenShiftAPIVersion() + ", " + client.getServerReadyStatus());
System.out.println("\n========================Openshift Project====================================");
IProject project = (IProject)client.getResourceFactory().stub(ResourceKind.PROJECT, "josephproject-openshift");
System.out.println("Openshift API version : " + project.getApiVersion()
+", Project namespace : " + project.getNamespace() + ", Project name : " + project.getName());
结果显示我的openshift项目信息。
=======================================================================
v1, ok
========================Openshift Project====================================
Openshift API version : v1, Project namespace : josephproject-openshift, Project name : josephproject-openshift
我以为我可以在manageiq上监控我的openshift项目,就像这些客户端代码一样。
答案 0 :(得分:0)
OpenShift Online无法为您提供足够的访问权限,无法授予应用程序editor
访问权限。授予您cluster-reader
访问权限意味着您可以看到群集中每个项目的列表,对于其他人使用的共享环境而言,这并不是您真正希望为非管理员提供的内容。
您在OpenShift Online中运行ManageIQ的能力将非常有限。它旨在由整个群集的管理员安装,只有在管理员需要时才授予非管理员用户访问权限。