I'm traying to create a Pod from a docker private image. For this i have created a secret like this:
kubectl create secret docker-registry $SECRETNAME --docker-server=$DOCKER_REGISTRY_SERVER --docker-username=$DOCKER_USER --docker-password=$DOCKER_PASSWORD --docker-email=$DOCKER_EMAIL
and then in the pod yml file,
apiVersion: v1
kind: Pod
metadata:
name: website.com
labels:
app: website
spec:
containers:
- name: my-web
image: company/web:1.0.2
imagePullPolicy: Always
command: [ "echo", "SUCCESS" ]
ports:
- name: web-port
containerPort: 8080
imagePullSecrets:
- name: docker-hub-key
When I run "kubectl create -f web-pod.yml", and then I run "kubectl get pod website.com" I get the following error:
Please help, thanks in advance
Since the fail is at the initial stage, this is probably an issue with authentication or repository-(image/tags access). Please verify that the repository name is valid and that the image version specified is available in the repository.
If all has been verified and the issue still persists, try do the following:
Try pull the image using kubectl command like below:
$ kubectl run <deployment-name> --image=<repo>/<image>:<version> --port=8080
If the above command is successful, then it will help you rule out auth/access issues. If the issue is not solved, go through the logs to get more specifics on the problem.