title: Kubernetes & Gitlab: How to store password for private registry?
body: <p>I want to run my application that is hosted in a private container registry on a Kubernetes cluster. I followed the instructions <a href="https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/" rel="nofollow noreferrer">here</a> and created a secret like this:</p>
  
  <pre><code>kubectl create secret docker-registry regcred --docker-server=&lt;your-registry-server&gt; \
        --docker-username=&lt;your-name&gt; \
        --docker-password=&lt;your-pword&gt; \
        --docker-email=&lt;your-email&gt;
  </code></pre>
  
  <p>which is used in my deployment like this:</p>
  
  <pre><code>      containers:
        - image: registry.gitlab.com/xxxxx/xxxx
          name: dockerdemo
          resources: {}
        imagePullSecrets:
        - name: regcred
  </code></pre>
  
  <p>K8s is now able to pull the image from my private registry. Anyhow I don't feel comfortable that my user and password are stored in plain text in the cluster. Is there a better/more secure way to give the K8s cluster access to the registry maybe by a token?</p>