无法从kubernetes上的私人码头中心注册表中提取

时间:2017-05-24 12:30:17

标签: kubernetes google-kubernetes-engine dockerhub

我在谷歌容器引擎上运行k8群集。我无法从私人码头仓库中取出图片。

尝试启动时我得到以下信息:



Name:		ds-expected-date
Namespace:	default
Node:		gke-ds-cluster-1-default-pool-8980b100-l64j/10.132.0.3
Start Time:	Wed, 24 May 2017 13:24:11 +0100
Labels:		<none>
Annotations:	kubernetes.io/limit-ranger=LimitRanger plugin set: cpu request for container ds-expected-date-flask
Status:		Pending
IP:		10.40.0.23
Controllers:	<none>
Containers:
  ds-expected-date-flask:
    Container ID:
    Image:		fluidy/ds-expected-date:latest
    Image ID:
    Port:
    State:		Waiting
      Reason:		ImagePullBackOff
    Ready:		False
    Restart Count:	0
    Requests:
      cpu:		100m
    Environment:	<none>
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-h340m (ro)
Conditions:
  Type		Status
  Initialized 	True
  Ready 	False
  PodScheduled 	True
Volumes:
  default-token-h340m:
    Type:	Secret (a volume populated by a Secret)
    SecretName:	default-token-h340m
    Optional:	false
QoS Class:	Burstable
Node-Selectors:	<none>
Tolerations:	<none>
Events:
  FirstSeen	LastSeen	Count	From							SubObjectPath				Type		Reason		Message
  ---------	--------	-----	----							-------------				--------	------		-------
  21s		21s		1	default-scheduler										Normal		Scheduled	Successfully assigned ds-expected-date to gke-ds-cluster-1-default-pool-8980b100-l64j
  18s		18s		1	kubelet, gke-ds-cluster-1-default-pool-8980b100-l64j	spec.containers{ds-expected-date-flask}	Normal		BackOff		Back-off pulling image "fluidy/ds-expected-date:latest"
  18s		18s		1	kubelet, gke-ds-cluster-1-default-pool-8980b100-l64j						Warning		FailedSync	Error syncing pod, skipping: failed to "StartContainer" for "ds-expected-date-flask" with ImagePullBackOff: "Back-off pulling image \"fluidy/ds-expected-date:latest\""

  20s	6s	2	kubelet, gke-ds-cluster-1-default-pool-8980b100-l64j	spec.containers{ds-expected-date-flask}	Normal	Pulling		pulling image "fluidy/ds-expected-date:latest"
  19s	5s	2	kubelet, gke-ds-cluster-1-default-pool-8980b100-l64j	spec.containers{ds-expected-date-flask}	Warning	Failed		Failed to pull image "fluidy/ds-expected-date:latest": Error response from daemon: unauthorized: authentication required
  19s	5s	2	kubelet, gke-ds-cluster-1-default-pool-8980b100-l64j						Warning	FailedSync	Error syncing pod, skipping: failed to "StartContainer" for "ds-expected-date-flask" with ErrImagePull: "Error response from daemon: unauthorized: authentication required"
&#13;
&#13;
&#13;

我已按照the docs page上的所有说明操作。我确信我正在阅读我的注册表密码 - 如果我在其中添加了duff凭据,则错误会更改为“无效的用户名或密码”。

1 个答案:

答案 0 :(得分:0)

您尚未将群集配置为使用凭据从Docker Hub中提取私有映像。

阅读并应用本指南:https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/

Google容器引擎可以自动从Google容器注册表(http://gcr.io)中提取,考虑使用它而不从私有注册表中提取图像。