Home > Software design >  is it possible to create two deployments inside one namespace in K8S?
is it possible to create two deployments inside one namespace in K8S?

Time:12-29

I am begginer at K8S, i'm using github actions I have 3 environment (dev, pred-prod, prod) and 3 namespace to each environment, i want to have a second environment (pre-prod-2) into my namespace of pre-production; is it possible ? and how the yaml file will look like ?

Thank you

CodePudding user response:

To create another independent deployment in the same namespace, take your existing Deployment YAML and change the following fields:

  • metadata.name
  • spec.selector.matchLabels.app
  • template.metadata.labels.app

It will be sufficient to just append a "2" to each of these values.

  • Related