<p>My company has been running Kuberenetes for over a year now and GitLab for about 6 months.  We recently upgrade to GitLab 9.x and are having trouble trying to figure out what's up with the decision around the CI + app configuration with Kube.  This feature is awesome and would love to get it working in our environment.  </p>

<p>It seems as though GitLab is expecting you to only have one cluster setup with all of your environments inside of that one cluster broken up by namespace which would equal your service/application and app which would equal your environment.  This is what it looks like GitLab wants my Kuberenetes environment to look like, a single cluster with your service broken up into namespaces:</p>

<pre><code>namespace = hello-world
app = development
app = qa
app = production
</code></pre>

<p>where in a real world example we would prefer to have the opposite which would work well with a single cluster as well</p>

<pre><code>DEVELOPMENT CLUSTER
namespace = development
app = hello-world

QA CLUSTER
namespace = qa
app = hello-world

PRODUCTION CLUSTER
namespace = production
app = hello-world
</code></pre>

<p>Having the namespace be the application and the apps be the environment, we wouldn't have the ability to upgrade to the latest version of kube without upgrading all.  Maybe I'm missing something but based on what I'm reading and after testing this out, it looks as though this was the way it was designed.</p>

<p>For reference this is what my CI looks like right now to make the deploy board + terminal happy</p>

<pre><code>development:
    &lt;&lt;: *deploy_definition
    stage: development
    environment: hello-world
    script:
        deploy.sh -a "hello-world"
</code></pre>

<p>but it should look like this</p>

<pre><code>development:
    &lt;&lt;: *deploy_definition
    stage: development
    environment: development
    script:
        deploy.sh -a "hello-world"
</code></pre>

<p>To add to this confusion, they give you only one Kubernetes master to connect to in the integrations tab.</p>

<p><strong>Is this correct, or am I missing something?</strong></p>

<p>You're correct. I found it frustrating too. </p>

<p>But you can use environments even without their kubernetes integration </p>

<pre><code>development:
    &lt;&lt;: *deploy_definition
    stage: development
    environment:
      name: development
      url: https://development.yourdomain.com
    script:
        deploy.sh -a "hello-world"
</code></pre>

<p>Check out the post I wrote recently about the configuration of auto deploy to kubernetes from gitlab.</p>

<p><a href="http://blog.lwolf.org/post/how-to-create-ci-cd-pipeline-with-autodeploy-k8s-gitlab-helm/" rel="nofollow noreferrer">http://blog.lwolf.org/post/how-to-create-ci-cd-pipeline-with-autodeploy-k8s-gitlab-helm/</a></p>
