title: Pulling container image from GitLab private registry fails after upgrading to Kubernetes v1.6
body: <p>I've setup a Kubenetes cluster to pull container images from the registry of a GitLab private repository. </p>
  
  <p>When I build an image using <code>gitlab-ci.yml</code> - I can use this to successfully login to the registry:</p>
  
  <pre><code>before_script:
    - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
  </code></pre>
  
  <p>When deploying to my Kubernetes cluster, I generate a secret:</p>
  
  <pre><code>- kubectl create secret -n $KUBE_NAMESPACE docker-registry gitlab-registry \
    --docker-server="$CI_REGISTRY" \
    --docker-username="$CI_REGISTRY_USER" \
    --docker-password="$CI_REGISTRY_PASSWORD" \
    --docker-email="$GITLAB_USER_EMAIL" \
    -o yaml --dry-run | kubectl replace -n $KUBE_NAMESPACE --force -f -
  </code></pre>
  
  <p>I then refer to this secret in my Deployment script using <code>imagePullSecrets</code>. This worked fine when my cluster was v1.5. However, since I upgraded to v1.6 I have not been able to pull a container image.</p>
  
  <p>The error I get in my Kubernetes console is:</p>
  
  <pre><code>Failed to pull image "registry.gitlab.com/user/repo:branch": 
  rpc error: code = 2 desc = unauthorized: HTTP Basic: Access denied
  Error syncing pod, skipping: failed to "StartContainer" for "helm-chart" with 
  ErrImagePull: "rpc error: code = 2 desc = unauthorized: HTTP Basic: Access denied"
  </code></pre>
  
  <p>To test, I tried running the following on my own PC:</p>
  
  <pre><code>docker login registry.gitlab.com
  </code></pre>
  
  <p>When I enter my GitLab username and password, everything is fine. However, if I try the following:</p>
  
  <pre><code>docker login \
    -u "gitlab-ci-token" \
    -p "the-auth-code-in-my-secret" \
    registry.gitlab.com
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>Error response from daemon: Get https://registry.gitlab.com/v2/:
  unauthorized: HTTP Basic: Access denied
  </code></pre>
  
  <p>I'm not sure if this is a GitLab issue or a Kubernetes issue. Am I just doing something wrong?</p>