问题描述
我有一个在AWS上运行的现成的Kubernetes集群,并安装了 kube-up
脚本。我想运行一些私有Docker Hub存储库中的容器。但是我仍然收到一个未找到错误: > kubectl get pod
NAME READY状态RESTARTS AGE
maestro-kubetest-d37hr 0/1错误:image csats / maestro:最新未找到0 22m
我创建了一个包含 .dockercfg
文件的秘密。我已经通过运行脚本发布了,证实了这一点: p>
> kubectl get secrets docker-hub-csatsinternal -o yaml | grep dockercfg:| cut -f 2 -d:|碱基64 -D> 〜/ .dockercfg
> docker pull csats / maestro
最新:从csats / maestro拉出
我确认了'不使用的新格式,我的看起来像这样: p>
> cat〜/ .dockercfg
{https://index.docker.io/v1/\":{\"auth\":\"REDACTED BASE64 STRING HERE,email:[email protected]}}
我尝试过 这是我的复制控制器的YAML: 任何想法? Docker在 您实际想要的是: 注意事项: 然后你 base64 编码并用作 再次注意 I have an off-the-shelf Kubernetes cluster running on AWS, installed with the I've created a secret containing a I've confirmed I'm not using the new format of .dockercfg script, mine looks like this: I've tried running the Base64 encode on Debian instead of OS X, no luck there. (It produces the same string, as might be expected.) Here's the YAML for my Replication Controller: Any ideas? Docker generates a what you actually want is: note 3 things: then you base64 encode that and use as data for the Note again the 这篇关于Kubernetes imagePullSecrets不工作;获得“图像未找到”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
---
kind:ReplicationController
apiVersion:v1
元数据:
名称:maestro-kubetest
规格:
副本:1
选择器:
应用程序:maestro
生态系统:kubetest
版本:1
模板:
元数据:
标签:
应用程序:maestro
生态系统:kubetest
版本:1
规格:
imagePullSecrets :
- 名称:docker-hub-csatsinternal
容器:
- 名称:maestro
图像:csats / maestro
imagePullPolicy:
restartPolicy:Always
dnsPolicy:ClusterFirst
kubectl版本
:
客户端版本:version.Info {Major :1,次要:0,GitVersion:v1.0.3,GitCommit: 61C6ac5f350253a4dc002aee97b7db7ff01ee4ca,GitTreeState:clean}
服务器版本:version.Info {Major:1,Minor:0,GitVersion:v1.0.3,GitCommit:61c6ac5f350253a4dc002aee97b7db7ff01ee4ca,GitTreeState:clean }
〜/ .docker /
$ b中生成一个 config.json
$ b它看起来像:
{
auths:{
index.docker.io / v1 /:{
auth:ZmFrZXBhc3N3b3JkMTIK,
email:[email protected]
}
}
}
{https://index.docker.io/v1/:{auth:XXXXXXXXXXXXXX,email:[email protected]}}
auths
wrap
https://
前面的
URL
.dockercfg
名称的数据
apiVersion:v1
kind:Secret
元数据:
名称:注册表
数据:
.dockercfg:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ==
类型:kubernetes。 io / dockercfg
.dockercfg
行一行(base64往往生成多行字符串)kube-up
script. I would like to run some containers that are in a private Docker Hub repository. But I keep getting a "not found" error: > kubectl get pod
NAME READY STATUS RESTARTS AGE
maestro-kubetest-d37hr 0/1 Error: image csats/maestro:latest not found 0 22m
.dockercfg
file. I've confirmed it works by running the script posted here: > kubectl get secrets docker-hub-csatsinternal -o yaml | grep dockercfg: | cut -f 2 -d : | base64 -D > ~/.dockercfg
> docker pull csats/maestro
latest: Pulling from csats/maestro
> cat ~/.dockercfg
{"https://index.docker.io/v1/":{"auth":"REDACTED BASE64 STRING HERE","email":"[email protected]"}}
---
kind: "ReplicationController"
apiVersion: "v1"
metadata:
name: "maestro-kubetest"
spec:
replicas: 1
selector:
app: "maestro"
ecosystem: "kubetest"
version: "1"
template:
metadata:
labels:
app: "maestro"
ecosystem: "kubetest"
version: "1"
spec:
imagePullSecrets:
- name: "docker-hub-csatsinternal"
containers:
- name: "maestro"
image: "csats/maestro"
imagePullPolicy: "Always"
restartPolicy: "Always"
dnsPolicy: "ClusterFirst"
kubectl version
:Client Version: version.Info{Major:"1", Minor:"0", GitVersion:"v1.0.3", GitCommit:"61c6ac5f350253a4dc002aee97b7db7ff01ee4ca", GitTreeState:"clean"}
Server Version: version.Info{Major:"1", Minor:"0", GitVersion:"v1.0.3", GitCommit:"61c6ac5f350253a4dc002aee97b7db7ff01ee4ca", GitTreeState:"clean"}
config.json
file in ~/.docker/
It looks like:{
"auths": {
"index.docker.io/v1/": {
"auth": "ZmFrZXBhc3N3b3JkMTIK",
"email": "[email protected]"
}
}
}
{"https://index.docker.io/v1/": {"auth": "XXXXXXXXXXXXXX", "email": "[email protected]"}}
auths
wrapping https://
in front of theURL .dockercfg
nameapiVersion: v1
kind: Secret
metadata:
name: registry
data:
.dockercfg: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX==
type: kubernetes.io/dockercfg
.dockercfg
line is one line (base64 tends to generate a multi-line string)