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

无法从库伯内特斯主机获取TCP端口信息-OpenShift Origin-oc

易瀚漠
2023-03-14

我正在跟踪OpenShift的本地集群管理留档。在我运行oc集群之后

[root@user ~]# oc cluster up
Starting OpenShift using openshift/origin:v3.6.0 ...
-- Checking OpenShift client ... OK
-- Checking Docker client ... OK
-- Checking Docker version ... 
   WARNING: Docker version is 1.21, it needs to be >= 1.22
-- Checking for existing OpenShift container ... OK
-- Checking for openshift/origin:v3.6.0 image ... OK
-- Checking Docker daemon configuration ... OK
-- Checking for available ports ... FAIL
   Error: Cannot get TCP port information from Kubernetes host
   Caused By:
     Error: cannot create container using image openshift/origin:v3.6.0
     Caused By:
       Error: Error response from daemon: SHM size must be greater then 0
[root@ip-172-31-0-186 ~]# oc cluster up --loglevel=5
-- Checking OpenShift client ... 
-- Checking Docker client ... 
I0803 04:30:33.543172    1417 up.go:590] No Docker environment variables found. Will attempt default socket.
I0803 04:30:33.543221    1417 up.go:595] No Docker host (DOCKER_HOST) configured. Will attempt default socket.
-- Checking Docker version ... 
I0803 04:30:33.543240    1417 helper.go:114] Retrieving Docker version
I0803 04:30:33.554087    1417 helper.go:120] Docker version results: &types.Version{Version:"1.9.1", APIVersion:"1.21", GitCommit:"78ee77d/1.9.1", GoVersion:"go1.4.2", Os:"linux", Arch:"amd64", KernelVersion:"3.10.0-693.el7.x86_64", Experimental:false, BuildTime:""}
I0803 04:30:33.554126    1417 helper.go:124] APIVersion: 1.21
I0803 04:30:33.554158    1417 up.go:686] Checking that docker API version is at least 1.22

   WARNING: Docker version is 1.21, it needs to be >= 1.22
-- Checking for existing OpenShift container ... 
I0803 04:30:33.554181    1417 helper.go:171] Inspecting docker container "origin"
I0803 04:30:33.555084    1417 helper.go:175] Container "origin" was not found
-- Checking for openshift/origin:v3.6.0 image ... 
I0803 04:30:33.555101    1417 helper.go:143] Inspecting Docker image "openshift/origin:v3.6.0"
I0803 04:30:33.556444    1417 helper.go:146] Image "openshift/origin:v3.6.0" found: &types.ImageInspect{ID:"c6d16974c8a3a5da3ab799533daa2dbd54e56b1f0ebbad59345154fc8e836ff2", RepoTags:[]string{"docker.io/openshift/origin:v3.6.0"}, RepoDigests:[]string{}, Parent:"395d30169bc02cca2e7083926b0fd6f2e6b7034a6de41a811cce0ab7c7473fca", Comment:"", Created:"2017-08-01T18:34:13.736398725Z", Container:"ae53137cc1b98b2f93051589d6aee252e505ac82f8e7a31f5ab49bfc0e9dc91a", ContainerConfig:(*container.Config)(0xc420277b00), DockerVersion:"1.12.6", Author:"", Config:(*container.Config)(0xc4202e2120), Architecture:"amd64", Os:"linux", Size:611206034, VirtualSize:974248741, GraphDriver:types.GraphDriverData{Name:"devicemapper", Data:map[string]string{"DeviceId":"7", "DeviceName":"docker-202:2-25214823-c6d16974c8a3a5da3ab799533daa2dbd54e56b1f0ebbad59345154fc8e836ff2", "DeviceSize":"107374182400"}}, RootFS:types.RootFS{Type:"", Layers:[]string(nil), BaseLayer:""}}
-- Checking Docker daemon configuration ... 
I0803 04:30:33.556503    1417 helper.go:65] Retrieving Docker daemon info
I0803 04:30:33.681753    1417 helper.go:71] Docker daemon info: &types.Info{ID:"IITV:S6LY:XNQS:LA63:VAH6:POZR:RGCW:MFWK:OTI7:DEII:AQK5:FDC6", Containers:0, ContainersRunning:0, ContainersPaused:0, ContainersStopped:0, Images:6, Driver:"devicemapper", DriverStatus:[][2]string{[2]string{"Pool Name", "docker-202:2-25214823-pool"}, [2]string{"Pool Blocksize", "65.54 kB"}, [2]string{"Base Device Size", "107.4 GB"}, [2]string{"Backing Filesystem", ""}, [2]string{"Data file", "/dev/loop0"}, [2]string{"Metadata file", "/dev/loop1"}, [2]string{"Data Space Used", "1.091 GB"}, [2]string{"Data Space Total", "107.4 GB"}, [2]string{"Data Space Available", "18.09 GB"}, [2]string{"Metadata Space Used", "1.339 MB"}, [2]string{"Metadata Space Total", "2.147 GB"}, [2]string{"Metadata Space Available", "2.146 GB"}, [2]string{"Udev Sync Supported", "true"}, [2]string{"Deferred Removal Enabled", "false"}, [2]string{"Deferred Deletion Enabled", "false"}, [2]string{"Deferred Deleted Device Count", "0"}, [2]string{"Data loop file", "/var/lib/docker/devicemapper/devicemapper/data"}, [2]string{"Metadata loop file", "/var/lib/docker/devicemapper/devicemapper/metadata"}, [2]string{"Library Version", "1.02.140-RHEL7 (2017-05-03)"}}, SystemStatus:[][2]string(nil), Plugins:types.PluginsInfo{Volume:[]string(nil), Network:[]string(nil), Authorization:[]string(nil)}, MemoryLimit:true, SwapLimit:true, KernelMemory:false, CPUCfsPeriod:true, CPUCfsQuota:true, CPUShares:false, CPUSet:false, IPv4Forwarding:true, BridgeNfIptables:true, BridgeNfIP6tables:true, Debug:false, NFd:15, OomKillDisable:true, NGoroutines:25, SystemTime:"2017-08-03T04:30:33.681150233-04:00", ExecutionDriver:"native-0.2", LoggingDriver:"json-file", CgroupDriver:"", NEventsListener:0, KernelVersion:"3.10.0-693.el7.x86_64", OperatingSystem:"Red Hat Enterprise Linux Server 7.4 (Maipo)", OSType:"", Architecture:"", IndexServerAddress:"https://index.docker.io/v1/", RegistryConfig:(*registry.ServiceConfig)(0xc4210fb700), NCPU:2, MemTotal:3973541888, DockerRootDir:"/var/lib/docker", HTTPProxy:"", HTTPSProxy:"", NoProxy:"", Name:"ip-172-31-0-186.us-west-2.compute.internal", Labels:[]string(nil), ExperimentalBuild:false, ServerVersion:"1.9.1", ClusterStore:"", ClusterAdvertise:"", SecurityOptions:[]string(nil)}
I0803 04:30:33.681847    1417 helper.go:42] Looking for "172.30.0.0/16" in []*registry.NetIPNet{(*registry.NetIPNet)(0xc4210f1a10), (*registry.NetIPNet)(0xc4210f1a70)}
I0803 04:30:33.681859    1417 helper.go:46] Found "172.30.0.0/16"
-- Checking for available ports ... 
I0803 04:30:33.681920    1417 run.go:181] Creating container named ""
config:
  image: openshift/origin:v3.6.0
  entry point:
    /bin/bash
  command:
    -c
    cat /proc/net/tcp && ( [ -e /proc/net/tcp6 ] && cat /proc/net/tcp6 || true)

host config:
  pid mode: host
  user mode: 
  network mode: host

FAIL
   Error: Cannot get TCP port information from Kubernetes host
   Caused By:
     Error: cannot create container using image openshift/origin:v3.6.0
     Caused By:
       Error: Error response from daemon: SHM size must be greater then 0

我已将kubernetes配置文件放在中。库贝/config。仍然收到相同的错误。库伯内特斯集群应该在同一台机器上?

>

  • 从docker docs安装最新版本

    要解决依赖关系,请安装容器-selinux(sudo yum install ftp://fr2.rpmfind.net/linux/centos/7.3.1611/extras/x86_64/Packages/container-selinux-2.9-4.el7.noarch.rpm)

    在我尝试启动带有 oc 集群的集群之后。这一次,它在码头工人配置时失败。

    [root@ip-172-31-0-186~]#oc cluster-up使用OpenShift/origin:v3.6.0启动OpenShift…--检查OpenShift客户端…OK--检查Docker客户端…OK--检查Docker版本…OK--查看现有的OpenShift容器…OK--检测OpenShift/origin:v4.6.0映像…OK--检查Docker守护程序配置…FAIL错误:未检测到Docker上的--不安全的注册表参数守护程序解决方案:

    确保Docker守护程序正在使用以下参数运行:-不安全-注册表172.30.0.0/16

    Docs说,更新/etc/sysconf/docker中的--不安全注册表172.30.0.0/16。但对于新版本的docker,该位置没有文件。我以任何方式创建和更新了/etc/sysconf/docker。但仍然会出现上述错误。

  • 共有2个答案

    文建业
    2023-03-14

    对于库伯内特斯或OpenShift的任何特定版本,支持的Docker版本几乎没有落后。

    所以我建议你安装docker而不是docker文档中的最新版本。但是使用 linux 发行版的包管理器进行安装。对于 Fedora 和 CentOS,只需执行以下操作:

    sudo yum install -y docker
    

    完成此操作后,将处理所有依赖项管理,而无需手动安装其他任何内容。

    现在,您已经使用包管理器安装了docker,您将找到/etc/sysconfig/docker。您可以添加这一行--inseure-172.30.0.0/16

    HTH。

    何兴邦
    2023-03-14

    好的,问题是注册表配置不安全。在<code>守护程序中指定不安全的注册表。json/etc/docker中的json,配置如下

    {
       "insecure-registries": [
         "172.30.0.0/16"
       ]
    }
    

    这也是最新的码头工人。

     类似资料:
    • 我已经研究Kubernetes几个星期了,并使用kube lego NGINX示例(https://github.com/jetstack/kube-lego)已使用DigitalOcean上的Rancher成功地将服务部署到Kubernetes群集。 我已经部署了示例静态站点、Wordpress、Laravel、Craft CMS等。所有这些都使用自定义命名空间、部署、秘密、具有外部注册表的容器

    • 我试图设置Kubernetes入口,将外部http流量路由到前端pod(路径/)和后端pod(路径/rest/*),但我总是得到400错误,而不是主nginx索引。html。 所以我在第https://cloud.google.com/kubernetes-engine/docs/tutorials/http-balancer页尝试了谷歌库伯内特斯的例子,但我总是得到400个错误。有什么想法吗?

    • 所以我已经使用库伯内特斯在Google云上设置了我的应用程序。我有一个Pod,我想从需要TCP请求的集群中公开它。 我通过ingress nginx了解到这是可能的,并对此进行了研究。如本文所述,可以通过如下方式设置configMap来完成: ,但它的完整用法没有明确描述,也没有在文档中找到完整的示例。 我已经安装了《安装指南》中提到的ingress nginx,但我不确定下一步将如何暴露我的Po

    • 我在GKE上设置了Istio(Kubernetes入口模式,而不是Istio网关)。但是,我无法使用curl从外部访问 istio ingressgateway LoadBalancer 10.48.11.240 35.222.111.100 15020:30115/TCP,80:31420/TCP,443:32019/TCP,31400:31267/TCP,15029:30180/TCP,150

    • 我怎样才能使用入口呢?我尝试使用NodePort和--Target etPort=1001,我在servicePort中添加了80在。 kubectl公开部署测试--Target-port=1001--type=NodePort 我得到了错误 找不到后端-404 我使用的是正确的方法还是需要遵循其他方法?

    • 是否可以在库伯内特斯中配置入口控制器,仅当传入请求的标头具有特定值时才将HTTP请求路由到服务? 实例 带有以下标头的HTTP请求 应该转发给服务1 带有以下标头的HTTP请求 应该被阻止 如果可能的话,你能详细一点或指向一些文档,因为我找不到这种用例的文档吗