首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在OpenShift源文件中公开服务不起作用

在OpenShift源文件中公开服务不起作用
EN

Stack Overflow用户
提问于 2017-03-21 19:43:24
回答 1查看 1.1K关注 0票数 1

我是新使用OpenShift原产地。我使用安装了一个主节点和两个节点。一切看起来都很好。我可以访问http://10.1.10.1:8443的仪表板。但是,当我想公开一个服务时,问题就出现了,我就这样做了:

  1. 我通过仪表板部署了一个tomcat容器。
  2. 然后,我创建了一个路由,以便通过主机公开tomcat,也可以通过仪表板公开,但是当我进入http://10.1.10.1:8080 (主ip:公开端口)时,出现了拒绝连接的情况。

OS版本

代码语言:javascript
复制
CentOS Linux release 7.3.1611 (Core)

OC版本

代码语言:javascript
复制
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

不可接受/主机

代码语言:javascript
复制
# 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诊断命令只显示两个警告:

代码语言:javascript
复制
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').

请你说明一下这件事好吗?提前谢谢。

EN

回答 1

Stack Overflow用户

发布于 2017-03-22 23:17:07

我也遇到过类似的问题。我确实配置了ansible容器。我可以知道您部署了tomcat应用程序的哪种用户吗?您是使用用户'developer/developer‘还是创建了另一个用户?可能的原因可能是您的用户权限不足(在我的经验中是这样的)。我建议你两件事,

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

2)如果您的用户没有足够的角色,那么执行此操作就可以使所提取的图像正常工作。(例如:$$ oc adm策略+-scc-to-user anyuid -z默认)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42936752

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档