2

我在这里遵循 Kubernetes 指南:https ://kubernetes.io/docs/tasks/configure-pod-container/assign-cpu-ram-container/

当我运行这个命令时:

kubectl create -f http://k8s.io/docs/tasks/configure-pod-container/cpu-ram.yaml

大约 30 秒后,我收到以下消息:

Unable to connect to the server: dial tcp 172.17.0.1:4321: i/o timeout

我在网上尝试了很多建议(包括在 Stack Overflow 上),但无法弄清楚。我在 Google Cloud Platform 上使用 Google Cloud Shell 并尝试设置 Kubernetes(通过其网站上的官方 Kubernetes 指南)。这是输出gcloud info

Google Cloud SDK [145.0.0]
Platform: [Linux, x86_64]
Python Version: [2.7.9 (default, Jun 29 2016, 13:08:31)  [GCC 4.9.2]]
Python Location: [/usr/bin/python2]
Site Packages: [Disabled]
Installation Root: [/google/google-cloud-sdk]
Installed Components:
  kubectl: []
  app-engine-python: [1.9.50]
  pubsub-emulator: [2017.02.07]
  gsutil-nix: [4.18]
  gsutil: [4.22]
  cloud-datastore-emulator: [1.2.1]
    disable_update_check: [True]
  app-engine-java: [1.9.49]
  gcloud: []
  core: [2017.02.21]
  datalab: [20170215]
  gcloud-deps: [2017.02.21]
  beta: [2016.01.12]
  bq: [2.0.24]
  alpha: [2016.01.12]
  datalab-nix: [20170105]
  core-nix: [2016.11.07]
  app-engine-go-linux-x86_64: [1.9.50]
  app-engine-go: []
  app-engine-php: [ ]
  gcloud-deps-linux-x86_64: [2017.02.21]
  gcd-emulator: [v1beta3-1.0.0]
  kubectl-linux-x86_64: [1.5.2]
  bq-nix: [2.0.24]
System PATH: [/google/google-cloud-sdk/bin:/usr/local/nvm/versions/node/v6.9.2/bin:/home/_removed_/gopath/bin:/google/gopath/bin:/usr/local/go/bin:/gradle-2.12/bin:/apache-maven-3.3.9/bin:/google/google-cloud-sdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/google/go_appengine:/google/google_appengine]
Cloud SDK on PATH: [True]
Kubectl on PATH: [/google/google-cloud-sdk/bin/kubectl]

WARNING: There are old versions of the Google Cloud Platform tools on your system PATH.
  /google/google_appengine/endpointscfg.py
  /google/go_appengine/dev_appserver.py
  /google/google_appengine/dev_appserver.py
  /google/go_appengine/endpointscfg.py

Installation Properties: [/google/google-cloud-sdk/properties]
User Config Directory: [/tmp/tmp.XKaUThqtJm]
Active Configuration Name: [cloudshell-29694]
Active Configuration Path: [/tmp/tmp.XKaUThqtJm/configurations/config_cloudshell-29694]

Account: [_removed_@gmail.com]
Project: [_removed_]

Current Properties:
  [metrics]
    environment: [devshell]
  [core]
    check_gce_metadata: [False]
    project: [_removed_]
    account: [_removed_@gmail.com]
    disable_usage_reporting: [False]
  [compute]
    region: [us-central1]
    gce_metadata_read_timeout_sec: [5]
    zone: [us-central1-b]
  [component_manager]
    disable_update_check: [True]

Logs Directory: [/tmp/tmp.XKaUThqtJm/logs]
Last Log File: [/tmp/tmp.XKaUThqtJm/logs/2017.02.27/21.51.45.088860.log]
4

1 回答 1

2

您正在尝试Pod在不存在的集群中安排 a 。在创建资源之前,您需要配置底层集群。

我建议您阅读https://k8s.io上的文档,以了解 Kubernetes 及其构建块。该文档也是了解如何配置 Kubernetes 集群的好地方。在 Google Cloud 上,这非常简单。

于 2017-03-01T07:14:57.077 回答