无法从Kubernetes host-Openshift Origin-oc获取TCP端口信息

时间:2017-08-03 08:34:26

标签: openshift-origin

我正在关注Openshift的Local Cluster Management文档。 在我运行oc cluster up

之后
[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

我已在.kube/config中放置了kubernetes配置文件。仍然得到同样的错误。 Kubernetes集群应该在同一台机器上吗?

UPDATE-1

  1. docker docs

  2. 安装最新版本
  3. 要解决依赖关系,请安装container-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

  4. 尝试使用oc cluster up启动群集后。这次,它在docker配置上失败了。

    [root @ ip-172-31-0-186~] #oc cluster up 使用openshift / origin启动OpenShift:v3.6.0 ... - 检查OpenShift客户端......好的 - 检查Docker客户端......好的 - 检查Docker版本......好的 - 检查现有的OpenShift容器......好的 - 检查openshift / origin:v3.6.0 image ... OK - 检查Docker守护程序配置...失败 错误:未在Docker守护程序上检测到--insecure-registry参数 解决方案:

    使用以下参数确保Docker守护程序正在运行:     --insecure-registry 172.30.0.0/16

  5. 文档说,更新--insecure-registry 172.30.0.0/16中的/etc/sysconf/docker。但对于新版本的docker,该位置没有文件。我创建和更新/etc/sysconf/docker的任何方式。但仍然遇到上述错误。

2 个答案:

答案 0 :(得分:0)

好的,问题是注册表配置不安全。使用以下配置

daemon.json的{​​{1}}中指定不安全的注册表
/etc/docker

这也是最新的码头工作者。

答案 1 :(得分:0)

对于任何特定版本的Kubernetes或OpenShift,支持的Docker版本都不落后。

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

sudo yum install -y docker

完成后,所有依赖关系管理都将得到处理,您不需要手动安装任何其他内容。

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

HTH。