<p>Trying to apply deployment.yaml but I got error illegal base64 data at input byte 8.</p>

<p>In my config.json</p>

<pre><code>"auths": {
        "https://index.docker.io/v1/": {
            "auth": "16c...ad7"
        }
    }
</code></pre>

<p>I have put token from the docker hub</p>

<p>Register the secret</p>

<pre><code>kubectl create secret generic regcred --from-file=.dockerconfigjson=C:\Users\Herman\.docker\config.json --type=kubernetes.io/dockerconfigjson
</code></pre>

<p>in my .yaml my imagePullSecrets: - name: regcred</p>

<p>anybody can help?</p>

Herman
<p>In my case, the the <code>oauth2accesstoken</code> part wasn't base64 encoded as well. So once I made sure that part was also base64 encoded, along with the token in the same string, it worked.</p>
<p><strong>Example Setup for oAuth and GCR</strong></p>
<pre><code>ACCESS_TOKEN=$(gcloud auth print-access-token)
export BASE_64_GCR_AUTH_TOKEN=$(echo &quot;oauth2accesstoken:${ACCESS_TOKEN}&quot; | base64 -w 0)
</code></pre>
