当前位置: 首页 > 知识库问答 >
问题:

暴露OpenShift Origin中的服务不工作

西门威
2023-03-14

我是使用OpenShift Origin的新手。我已经使用ansible openshift安装了1个主节点和2个节点。一切似乎都正常。我可以访问http://10.1.10.1:8443.但当我想公开服务时,问题就出现了,所以我这样做了:

  1. 我通过Dashboard部署了一个Tomcat容器。
  2. 然后,我创建了一个路由,以便通过主服务器暴露Tomcat,也通过仪表板,但当我去http://10.1.10.1:8080(主IP:暴露端口)不起作用时,会出现连接拒绝。

操作系统版本

CentOS Linux release 7.3.1611 (Core)

超频版本

oc v1.4.1+3f9807a
kubernetes v1.4.0+776c994
features: Basic-Auth GSSAPI Kerberos SPNEGO
Server https://10.1.10.1:8443
openshift v1.4.1+3f9807a
kubernetes v1.4.0+776c994

安西/主机

# Create an OSEv3 group that contains the masters and nodes groups 
[OSEv3:children] 
masters
nodes
#etcd

# Set variables common for all OSEv3 hosts 
[OSEv3:vars] 
ansible_user=root
ansible_become=true
deployment_type=origin 
openshift_release=1.4.1
containerized=true 
openshift_router_selector='router=true'
openshift_registry_selector='registry=true'
enable_docker_excluder=false 
enable_excluders=false
os_firewall_use_firewalld=false 

# enable htpasswd auth 
openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', 'challenge': 'true', 'kind': 'HTPasswdPasswordIdentityProvider', 'filename': '/etc/origin/master/htpasswd'}]
openshift_master_htpasswd_users={'admin': '$apr1$zgSjCrLt$1KSuj66CggeWSv.D.BXOA1', 'user': '$apr1$.gw8w9i1$ln9bfTRiD6OwuNTG5LvW50'}

# host group for masters 
[masters]
10.1.10.1 openshift_public_hostname=10.1.10.1 openshift_hostname=os-master

# host group for etcd, should run on a node that is not schedulable
#[etcd]
#54.175.0.44 

# host group for worker nodes, we list master node here so that
# openshift-sdn gets installed. We mark the master node as not 
# schedulable. 
[nodes]
10.1.10.1openshift_hostname=10.1.10.1 openshift_schedulable=false
10.1.10.2openshift_hostname=10.1.10.2openshift_node_labels="{'router':'true','registry':'true'}"
10.1.10.3 openshift_hostname=10.1.10.3 openshift_node_labels="{'router':'true','registry':'true'}"

oc adm diagnostics命令仅显示2个警告:

WARN:  [DH0005 from diagnostic MasterConfigCheck@openshift/origin/pkg/diagnostics/host/check_master_config.go:52]
       Validation of master config file '/etc/origin/master/master-config.yaml' warned:
       assetConfig.loggingPublicURL: Invalid value: "": required to view aggregated container logs in the console
       assetConfig.metricsPublicURL: Invalid value: "": required to view cluster metrics in the console
       auditConfig.auditFilePath: Required value: audit can now be logged to a separate file
WARN:  [DClu0003 from diagnostic NodeDefinition@openshift/origin/pkg/diagnostics/cluster/node_definitions.go:112]
       Node 10.1.10.1 is ready but is marked Unschedulable.
       This is usually set manually for administrative reasons.
       An administrator can mark the node schedulable with:
           oadm manage-node 10.1.10.1 --schedulable=true

       While in this state, pods should not be scheduled to deploy on the node.
       Existing pods will continue to run until completed or evacuated (see
       other options for 'oadm manage-node').

你能解释一下吗?。提前感谢。

共有1个答案

祝宾白
2023-03-14

我遇到过类似的问题。我确实已经配置了 ansible 容器。我可以知道您部署了哪种类型的用户 tomcat 应用程序吗?您是使用用户“开发者/开发者”还是创建了其他用户?可能的原因可能是您的用户权限不足(根据我的经验)。我会建议你两件事,

1) 通过执行此操作检查路由器/服务配置是否正确

2) 如果您的用户没有足够的角色,请执行此操作或此操作以使拉取的图像正常工作。(示例:$$$oc adm policy add scc to user anyuid-z default)

 类似资料:
  • 主要内容:1. 概述,2.本地暴露,3 远程暴露1. 概述 Dubbo 服务暴露有两种方式 本地暴露,JVM 本地调用。配置如下: 远程暴露,网络远程通信。配置如下: 在不配置 scope 的情况下,默认两种方式都暴露 2.本地暴露 2.1 doExportUrls 本地暴露服务的顺序图如下: ServiceConfig#export() 方法中,会在配置初始化完成后,调用顺序图的起点 #doExportUrls() 方法,开始暴露服务。代码如

  • 主要内容:1.概述,2.doExportUrls,3. Protocol1.概述 Dubbo 服务暴露有两种方式 本地暴露,JVM 本地调用。配置如下: <dubbo:service scope=“local” /> <dubbo:service scope=“remote” /> 在不配置 scope 的情况下,默认两种方式都暴露。 2.doExportUrls 本地暴露服务的顺序图如下: 我们看到 ServiceConfig#export() 方法中,会在配置初始

  • 24.2 使用RMI暴露服务 使用Spring的RMI支持,你可以通过RMI基础架构透明地暴露你的服务。完成Spring的RMI设置后,你基本上具有类似于远程EJB配 置,除了没有对安全上下文传递和远程事务传递的标准支持。当使用RMI调用器时,Spring对这些额外的调用上下文提供了钩子,你可以在此插入安全框架 或者自定义的安全凭证。 24.2.1 使用RmiServiceExporter导出服务

  • 18.2. 使用RMI暴露服务 使用Spring的RMI支持,你可以通过RMI基础设施透明的暴露你的服务。设置好Spring的RMI支持后,你会看到一个和远程EJB接口类似的配置,只是没有对安全上下文传递和远程事务传递的标准支持。当使用RMI调用器时,Spring对这些额外的调用上下文提供了钩子,你可以在此插入安全框架或者定制的安全证书。 18.2.1. 使用 RmiServiceExporter

  • 本文向大家介绍说说 Dubbo 服务暴露的过程。相关面试题,主要包含被问及说说 Dubbo 服务暴露的过程。时的应答技巧和注意事项,需要的朋友参考一下 Dubbo 会在 Spring 实例化完 bean 之后,在刷新容器最后一步发布 ContextRefreshEvent 事件的时候,通知实现了 ApplicationListener 的 ServiceBean 类进行回调 onApplicati

  • 我正在使用spring Boot2.0.4,并希望公开我的执行器endpoint。当向application.yml仅添加以下信息时,健康状况将被公开。 当我运行http://localhost:8080/acturet时,我会得到