É um RELATÓRIO DE BUGS ou SOLICITAÇÃO DE RECURSO ?: BUG
Versão do Kubernetes (use a versão do kubectl):
Client Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.2", GitCommit:"08e099554f3c31f6e6f07b448ab3ed78d0520507", GitTreeState:"clean", BuildDate:"2017-01-12T04:57:25Z", GoVersion:"go1.7.4", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.3", GitCommit:"029c3a408176b55c30846f0faedf56aae5992e9b", GitTreeState:"clean", BuildDate:"2017-02-15T06:34:56Z", GoVersion:"go1.7.4", Compiler:"gc", Platform:"linux/amd64"}
Ambiente:
Provedor de nuvem ou configuração de hardware: 2 GB de RAM / 50 GB HDD VM
SO (por exemplo, de / etc / os-release):
NAME = "Ubuntu"
VERSÃO = "16.04 LTS (Xenial Xerus)"
ID = ubuntu
ID_LIKE = debian
PRETTY_NAME = "Ubuntu 16.04 LTS"
VERSION_ID = "16.04"
HOME_URL = " http://www.ubuntu.com/ "
SUPPORT_URL = " http://help.ubuntu.com/ "
BUG_REPORT_URL = " http://bugs.launchpad.net/ubuntu/ "
UBUNTU_CODENAME = xenial
Kernel (por exemplo, uname -a):
Linux ubuntu 4.4.0-21-generic # 37-Ubuntu SMP Seg 18 de abril 18:33:37 UTC 2016 x86_64 x86_64 x86_64 GNU / Linux
Ferramentas de instalação: kubeadm, kubectl, docker
Outros : NA
O que aconteceu: ImagePullBackOff ao puxar de um repositório privado
O que você esperava que acontecesse: ele deveria puxar a imagem do repositório privado
Como reproduzi-lo (o mínimo e precisamente possível):
root<strong i="5">@ubuntu</strong>:~# vi /etc/systemd/system/docker.service.d/private-registry.conf
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd --insecure-registry 123.456.789.0:9595
docker login 123.456.789.0:9595
informação do docker
Recipientes: 87
Em execução: 18
Pausado: 0
Parado: 69
Imagens: 175
Versão do servidor: 1.12.3
Driver de armazenamento: aufs
Dir raiz: / var / lib / docker / aufs
Sistema de arquivos de apoio: extfs
Dirs: 384
Compatível com Dirperm1: verdadeiro
Driver de registro: arquivo json
Driver Cgroup: cgroupfs
Plugins:
Volume: local
Rede: sobreposição nula de ponte de host
Enxame: inativo
Runtimes: runc
Tempo de execução padrão: runc
Opções de segurança: apparmor seccomp
Versão do kernel: 4.4.0-21-genérico
Sistema operacional: Ubuntu 16.04 LTS
OSType: linux
Arquitetura: x86_64
CPUs: 1
Memória total: 1,937 GiB
Nome: ubuntu
ID: FXD7: JQJZ: HO3R : D2NK: RWYL: 7DCY : PC2M: 43PM: MA7C: QSPN: 4RGS : 5W6H
Docker Root Dir: / var / lib / docker
Modo de depuração (cliente): falso
Modo de depuração (servidor): falso
Registro: https://index.docker.io/v1/
AVISO: Sem suporte para limite de troca
Registros inseguros:
123.456.789.0:9595
127.0.0.0/8
docker -v
Docker versão 1.12.3, compilação 6b644ec
Iniciar o kubeadm no mestre
kubeadm init --token 123456.1234567890123456 --api-advertise-endereços 192.168.91.133
Criou a rede weive
kubectl apply -f https://git.io/weave-kube
apiVersion: v1
kind: Pod
metadata:
name: test-pod
labels:
name: test
spec:
containers:
- image: 123.456.789.0:9595/test
name: test
ports:
- containerPort: 8443
imagePullSecrets:
- name: my-secret
Name: test-pod
Namespace: default
Node: ubuntu-child/192.168.91.134
Start Time: Thu, 16 Feb 2017 12:26:56 +0530
Labels: name=test
Status: Pending
IP: 10.44.0.2
Controllers: <none>
Containers:
test:
Container ID:
Image: 123.456.789.0:9595/test
Image ID:
Port: 8443/TCP
State: Waiting
Reason: ErrImagePull
Ready: False
Restart Count: 0
Volume Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from default-token-vkj94 (ro)
Environment Variables: <none>
Conditions:
Type Status
Initialized True
Ready False
PodScheduled True
Volumes:
default-token-vkj94:
Type: Secret (a volume populated by a Secret)
SecretName: default-token-vkj94
QoS Class: BestEffort
Tolerations: <none>
Events:
FirstSeen LastSeen Count From SubObjectPath Type Reason Message
--------- -------- ----- ---- ------------- -------- ------ -------
9s 9s 1 {default-scheduler } Normal Scheduled Successfully assigned test-pod to ubuntu-child
7s 7s 1 {kubelet ubuntu-child} spec.containers{test} Normal Pulling pulling image "123.456.789.0:9595/test"
7s 7s 1 {kubelet ubuntu-child} spec.containers{test} Warning Failed Failed to pull image "123.456.789.0:9595/test": Error: image test:latest not found
7s 7s 1 {kubelet ubuntu-child} Warning FailedSync Error syncing pod, skipping: failed to "StartContainer" for "test" with ErrImagePull: "Error: image test:latest not found"
7s 7s 1 {kubelet ubuntu-child} spec.containers{test} Normal BackOff Back-off pulling image "123.456.789.0:9595/test"
7s 7s 1 {kubelet ubuntu-child} Warning FailedSync Error syncing pod, skipping: failed to "StartContainer" for "test" with ImagePullBackOff: "Back-off pulling image \"123.456.789.0:9595/test\""
Do escravo e do mestre, eu poderia puxar o repositório privado. Mas, o problema existe quando kubectl tenta extrair a imagem do repositório privado, embora eu tenha adicionado meu segredo na definição do pod.
O problema existia devido ao número da porta. Depois de colocar o número da porta, ele começou a funcionar conforme o esperado.
kubectl create secret docker-registry my-secret --docker-server=123.456.789.0:9595 --docker-username=admin --docker-password=XXXX [email protected]
Não era um bug real, mas para a solução, consulte http://stackoverflow.com/questions/42267164/kubectl-not-able-to-pull-the-image-from-private-repository
Comentários muito úteis
O problema existia devido ao número da porta. Depois de colocar o número da porta, ele começou a funcionar conforme o esperado.
kubectl create secret docker-registry my-secret --docker-server=123.456.789.0:9595 --docker-username=admin --docker-password=XXXX [email protected]