I try to deploy one docker image that I build and is not on a public or private registry.
I use the imagePullPolicy: IfNotPresent
for the Kubernetes deployment.
I use kubeadm v1.12 the error:
Normal Scheduled 35s default-scheduler Successfully assigned default/test-777dd9bc96-chgc7 to ip-10-0-1-154
Normal SandboxChanged 32s kubelet, ip-10-0-1-154 Pod sandbox changed, it will be killed and re-created.
Normal BackOff 30s (x3 over 31s) kubelet, ip-10-0-1-154 Back-off pulling image "test_kube"
Warning Failed 30s (x3 over 31s) kubelet, ip-10-0-1-154 Error: ImagePullBackOff
Normal Pulling 15s (x2 over 34s) kubelet, ip-10-0-1-154 pulling image "test"
Warning Failed 13s (x2 over 33s) kubelet, ip-10-0-1-154 Failed to pull image "test": rpc error: code = Unknown desc = Error response from daemon: pull access denied for test_kube, repository does not exist or may require 'docker login'
Warning Failed 13s (x2 over 33s) kubelet, ip-10-0-1-154 Error: ErrImagePull
My deployment file:
apiVersion: apps/v1beta1
kind: Deployment
vmetadata:
name: test-kube
spec:
template:
metadata:
labels:
app: test
spec:
containers:
- name: test
image: test
imagePullPolicy: IfNotPresent
ports:
- containerPort: 3000
env:
- name: SECRET-KUBE
valueFrom:
secretKeyRef:
name: secret-test
key: username
docker images]
REPOSITORY TAG
test latest
test test
In the deployment file i tried with
image: test and with image: test:test
The same error:
Error: ErrImagePull