<p>I'm trying to figure out ways to automate k8s deployments in an EKS cluster. I'm trying to set up namespaces for each specific environment. One for dev, one for staging, and one for production. My production namespace is in a separate region and also in a separate cluster (dev &amp; staging are in one cluster). I'm a little new to this concept, but does it make sense to have each respective application load balancer in it's respective namespace? Is that practice common or best practice? Any ideas on automating deployments would be appreciated.</p>

<p>Hi <a href="https://stackoverflow.com/users/12145078/dave-michaels">Dave Michaels</a>,
I assume there are two questions in your post above:</p>
<ol>
<li><p>If we use a dedicated namespace in the same cluster (dev &amp; staging setup), can we use a dedicated load balancer for each of these namespaces? Is this good practice.
Answer: Yes. As you are using the namespace concept for each environment in the same cluster, it is Ok to create a dedicated load balancer (promise me you will use ingress :)) in each of these namespaces as we need an easier way to access those environments. To be frank, I am not a fan of using namespaces for environments, because as your cluster grows and lots of microservices getting added to it, you might want to use namespace for another reason eg., namespace per team or domain to have granular access rights. But I have seen teams using it for different environments successfully as well.</p>
</li>
<li><p>Suggest automated Kubernetes deployments possibilities?
This is a large topic by itself.
As your microservices grow, you will have multiple Kubernetes manifests to handle, first thing I will suggest is to either use a configuration manager like <a href="https://kustomize.io/" rel="nofollow noreferrer">Kustomize</a> or a package manager like <a href="https://helm.sh/" rel="nofollow noreferrer">Helm</a> to segregate variables from actual manifests, this will help to easily automate deployment across environments (same cluster or different clusters). Coming to actual deployment automation, if there is no existing CD in place I would suggest exploring tools that support natively Kubernetes that supports GitOps, like <a href="https://fluxcd.io/" rel="nofollow noreferrer">FluxCD</a> or <a href="https://argoproj.github.io/argo-cd/" rel="nofollow noreferrer">ArgoCD</a> etc</p>
</li>
</ol>
