How to access private Docker Hub repository from Kubernetes on Vagrant

I am failing to pull from my private Docker Hub repository into my local Kubernetes setup running on Vagrant:

Container "hellonode" in pod "hellonode-n1hox" is waiting to start: image can't be pulled

Failed to pull image "username/hellonode": Error: image username/hellonode:latest not found

I have set up Kubernetes locally via Vagrant as described here and created a secret named "dockerhub" with kubectl create secret docker-registry dockerhub --docker-server= --docker-username=username --docker-password=... --docker-email=... which I supplied as the image pull secret.

I am running Kubernetes 1.2.0.


To pull a private DockerHub hosted image from a Kubernetes YAML:

Run these commands:
DOCKER_USER=Type your dockerhub username, same as when you `docker login`
DOCKER_EMAIL=Type your dockerhub email, same as when you `docker login`
DOCKER_PASSWORD=Type your dockerhub pw, same as when you `docker login`

kubectl create secret docker-registry myregistrykey \
  --docker-server=$DOCKER_REGISTRY_SERVER \
  --docker-username=$DOCKER_USER \
  --docker-password=$DOCKER_PASSWORD \

If your username on DockerHub is DOCKER_USER, and your private repo is called PRIVATE_REPO_NAME, and the image you want to pull is tagged as latest, create this example.yaml file:

apiVersion: v1
kind: Pod
  name: whatever
    - name: whatever
      imagePullPolicy: Always
      command: [ "echo", "SUCCESS" ]
    - name: myregistrykey

Then run:

kubectl create -f example.yaml

Create k8 Secret:

apiVersion: v1
kind: Secret
  name: repositorySecretKey
  .dockerconfigjson: <base64 encoded docker auth config>

Then in pod or rc config mention the secret. Example :

apiVersion: v1
kind: Pod
  name: test-pod
    - name: test-pod
    - name: repositorySecretKey

Docker auth config

   "": {
    "email": ".",
    "auth": "<base64 encoded auth token>"


kubectl create secret docker-registry myregistrykey \
    --docker-server=DOCKER_REGISTRY_SERVER \
    --docker-username=DOCKER_USER \
    --docker-password=DOCKER_PASSWORD \

You can follow these instructions on how to configure nodes to authenticate to a private repository in order to configure the kubelets to make Docker use your credentials, or follow +Phagun Baya's solution with imagePullSecrets that applies to pods.

Need Your Help

Image mysteriously ignoring max-width in Firefox & IE

css internet-explorer firefox responsive-design max

So I'm trying to display images as big as possible with no cropping on any screen size. This means height: 100%; width: auto in landscape and width: 100%; height: auto in portrait.

How do you resize a form to fit its content automatically?

c# .net winforms

I am trying to implement the following behaviour: