<p>I'm using a simple <code>ballerina</code> code to build my program (simple hello world) with <code>ballerinax/kubernetes</code> annotations. The service is being compiled succesfully and accessible via the specific bind port from local host.</p>

<p>When configuration a kubernetes deployment I'm specifying the image build and push flags:</p>

<pre><code>@kubernetes:Deployment {
    replicas: 2,
    name: "hello-deployment",
    image: "gcr.io/&lt;gct-project-name&gt;/hello-ballerina:0.0.2",
    imagePullPolicy: "always",
    buildImage: true,
    push: true
}
</code></pre>

<p>When building the source code:</p>

<pre><code>ballerina build hello.bal
</code></pre>

<p>This is what I'm getting:</p>

<pre><code>Compiling source
    hello.bal

Generating executable
    ./target/hello.balx
    @docker          - complete 3/3

    Run following command to start docker container:
    docker run -d -p 9090:9090 gcr.io/&lt;gcr-project-name&gt;/hello-ballerina:0.0.2

    @kubernetes:Service              - complete 1/1
    @kubernetes:Deployment           - complete 1/1
error [k8s plugin]: Unable to push docker image: unauthorized: You don't have the needed permissions to perform this operation, and you may have invalid credentials. To authenticate your request, follow the steps in: https://cloud.google.com/container-registry/docs/advanced-authentication
</code></pre>

<p>Note that when pushing it manually via docker on my local machine it works find and the new image is getting pushed. </p>

<p>What am I missing? Is there a way to tell ballerina about docker registry credentials via the <code>kubernetes</code> package?</p>

Shikloshi
<p>Ballerina doesn't support gcloud docker registry yet, but it supports dockerhub. 
Please refer <a href="https://github.com/ballerinax/kubernetes/tree/master/samples/sample6" rel="nofollow noreferrer">sample6</a> for more info. </p>

<p>Basically, you can export docker registry username and password as environment variables.</p>

<p>Please create an issue at <a href="https://github.com/ballerinax/kubernetes/issues" rel="nofollow noreferrer">https://github.com/ballerinax/kubernetes/issues</a> for track this.</p>
