datawire / forge

Define and run multi-container apps in Kubernetes
http://forge.sh
Apache License 2.0
416 stars 43 forks source link

creating namespaces in your manifests is awkward #140

Open rhs opened 6 years ago

rhs commented 6 years ago

If you want your resources to be created in a namespace, you need to put that namespace at the top of all your yaml files. This is not only awkward, but it runs into a race condition if you happen to use the same namespace across separate services.

The race occurs if you run a single forge deploy command that includes the separate services when the namespace does not yet exist. Because apply performs an "upsert" by doing a query on the client and deciding whether to do a create or update, the two clients will end up racing.

mumoshu commented 6 years ago

@rhs Just curious(=not believing it's the solution), but could we upsert a namespace from within a "ns-only" forge service, and then make all the other forge services depend on the "ns-only" service? Are you referring to that case, right?