hallowed-apartment-22484
04/10/2023, 12:26 AMExternalDNS
, are not specific to a particular developer's namespace.
What would be the recommended way to manage deployments that are done at the cluster level vs deployments done for a particular namespace. (I know my wording is confusing - i'm not really sure the best way to phrase the question 😛 )garden deploy
step which has the unfortunate problem that if one dev runs garden deploy
(which deploys their code into their own namespace, and ExternalDNS into the default
namespace), a second dev also deploys, and then the first dev runs garden delete environment ...
, then ExternalDNS will be taken down while the second dev's services are still upquaint-dress-831
04/11/2023, 7:53 AMproject.garden.yml
file declaring resources like ExternalDNS and cert-manager (should you use it) in the default
namespace. Your devs would have their own project.garden.yml
that creates per-developer namespaces based on e.g. their local username https://docs.garden.io/reference/template-strings/modules#usd-local.username
I'm a big fan of our opinionated guide on namespaces if you want a reference for environments https://docs.garden.io/guides/namespaces#an-opinionated-guide-on-using-namespaces
Using it as a template, your project.garden.yml
for your globally installed services might look like thisyaml
kind: Project
name: my-project
variables:
global-env-name: default
environments:
- name: global
defaultNamespace: ${var.global-env-name}
providers:
- name: kubernetes
namespace: ${environment.namespace} # <--- Ensure the K8s namespace matches the Garden namespace
defaultHostname: ${var.hostname}
# ...
project.garden.yml
might look like:
yaml
kind: Project
name: my-project
variables:
dev-env-name: my-project-${local.username}
environments:
- name: dev
defaultNamespace: ${var.dev-env-name}
providers:
- name: kubernetes
namespace: ${environment.namespace} # <--- Ensure the K8s namespace matches the Garden namespace
defaultHostname: ${var.hostname}
# ...
hallowed-apartment-22484
04/11/2023, 4:40 PMquaint-dress-831
04/12/2023, 8:08 AMbright-policeman-43626
04/14/2023, 6:00 PMhallowed-apartment-22484
04/18/2023, 1:57 AMbright-policeman-43626
04/18/2023, 7:29 AM