0
votes

I have this Kubernetes Job instance:

      apiVersion: batch/v1
      kind: Job
      metadata:
        name: job
      spec:
        template:
          spec:
            containers:
              name: job
              image: 172.30.34.145:5000/myproj/app:latest
              command: ["/bin/sh", "-c", "$(COMMAND)"]
              serviceAccount: default
              serviceAccountName: default
            restartPolicy: Never

How can I write the image name so it always pull from within my own namespace.

I'd like to set it like this:

image: app:latest

But it fails saying it's unable to pull the image

1
The question is not very clear for me. The Service-IP is probably pointing to your openshift docker registry. From your openshift project (kubernetes namespace) myproj you can pull the image from your registry.DenCowboy
I found a solution. Will post here soon.caruccio
@caruccio I'm interested in your solutionDanny
@Danny turns out I did not had a solution. sorry :(caruccio

1 Answers

0
votes

To pull from a different repository then dockerhub you need to specify the host:port part in the image name. As far as I am aware at this point there is no option to change to location of default registry in docker daemon.

If you are very fixed on the idea, you could fiddle with DNS so it resolves to your image registry instead of dockers one, but that would cut you off from docker hub completely.