Rodrigo replied, but I will echo some of his comments.. On Tue, Oct 31, 2017 at 7:08 AM, <rgoncal...@gmail.com> wrote: > On Tuesday, October 31, 2017 at 7:41:45 AM UTC, Rodrigo Campos wrote: >> On Mon, Oct 30, 2017 at 03:34:00AM -0700, rgoncal...@gmail.com wrote: >> > I'm trying to figure out what's the best approach to deploy multiple >> > versions of the same software in kubernetes without relying on namespaces. >> > According to the docs: >> > >> > "It is not necessary to use multiple namespaces just to separate slightly >> > different resources, such as different versions of the same software: use >> > labels to distinguish resources within the same namespace." >> > >> > The only way (that I know of) to separate multiple versions of same >> > software on the same namespace is naming services in accordance to >> > software version, adjust the selector field and tag pods appropriately. >> > This has maintenance overhead and I'm required to reference services with >> > a different name according to the desired version. I don't think this is a >> > solution. >> >> Why not? What is the problem you want to solve? >> >> > >> > I don't see any other way besides using namespaces. What am I missing >> > something? >> >> I think services is the way to do it, with labels on deplyoments, but I >> might be >> missing the details of what you want to do. Can you pelase elaborate? > > Basically I want to be able to deploy two distinct versions of the same > software on the same kubernetes cluster. This is a cluster used for > development and it's usual to have multiple versions of the same software > (ex. maintenance version and evolution version).
You can create as many Deployments (or DaemonSets, or Jobs, or Pods...) as you want in a given Namespace. The only rule is that they have to have different names. If you want to select between them, they probably need different labels, too. Example: deploy foobar v1 as "foobar-v1" with labels "app=foobar, version=v1" deploy foobar v2 as "foobar-v2" with labels "app=foobar, version=v2" All the pods will run in the same Namespace. > I can create one namespace for each version, but I'd rather not because I'd > like to limit resource usage per software, not per software version. But > without using namespaces, the only way (like I said, that I'm aware of), is > to codify the version of the service on the name (serviceA-v1.1; > serviceA-trunk; etc...). Definitely I don't want to do that. Doing that > implies changing kubernetes deployment descriptors, clients must change the > service they reference, etc... not a good idea. I don't know what you mean by resource usage. If you mean youwant to limit quota, then yes one namespace is good at that. If you mean actual CPU/memory usage on a machine, Namespaces are the wrong stage of the deployment. Can you clarify what you are trying to prevent? Simply put you are asking for something that doesn't make sense. You want them to be in the same namespace, but not have different names. That is exactly what Namespaces are for - being able to reuse the same relative-names. Assuming that these versions are different for a reason, your clients HAVE TO know which one they want, right? Or are you just load-balancing across versions, and clients don't care which version they get? -- You received this message because you are subscribed to the Google Groups "Kubernetes user discussion and Q&A" group. To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-users+unsubscr...@googlegroups.com. To post to this group, send email to kubernetes-users@googlegroups.com. Visit this group at https://groups.google.com/group/kubernetes-users. For more options, visit https://groups.google.com/d/optout.