You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So for every namespace, dev, tst, acc, prd, i want to generate a namespace like: dev-webserver, dev-proxy etc.
This works for things like configmaps but not for namespace anymore, with a namePrefix and a nameSuffix.
Is there another way to do this? I tried it with a configmap and then use namereference like this:
nameReference:
version: v1
kind: ConfigMap
fieldSpecs:
version: v1
kind: Namespace
path: metadata/name
that works with one environment, but not with 2 or more:
error: accumulating resources: accumulation err='accumulating resources from './prd': '/overlays/prd/tst' must resolve to a file': recursed merging from path 'overlays/prd/tst': may not add resource with an already registered id: Namespace.v1.[noGrp]/webserver.[noNs]
it seems like kustomize does this nameReference after the whole config is loaded and has that base namespace registered.
Is there another way to do this?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I have a question, i have the following setup:
overlays
└── prd
└── kustomization.yaml
├── acc
│ └── kustomization.yaml
├── base
│ ├── kustomization.yaml
│ └── namespaces.yaml
├── dev
│ └── kustomization.yaml
├── kustomization.yaml
├── prd
│ └── kustomization.yaml
└── tst
└── kustomization.yaml
A prd overlay that also has different environments, dev, tst, acc and prd.
And a common base. it's a bit unorthodox setup i know :)
In that base folder:
overlays/prd/base$ cat kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
overlays/prd/base$ cat namespaces.yaml
apiVersion: v1
kind: Namespace
metadata:
name: webserver
apiVersion: v1
kind: Namespace
metadata:
name: proxy
So for every namespace, dev, tst, acc, prd, i want to generate a namespace like: dev-webserver, dev-proxy etc.
This works for things like configmaps but not for namespace anymore, with a namePrefix and a nameSuffix.
Is there another way to do this? I tried it with a configmap and then use namereference like this:
nameReference:
kind: ConfigMap
fieldSpecs:
kind: Namespace
path: metadata/name
that works with one environment, but not with 2 or more:
error: accumulating resources: accumulation err='accumulating resources from './prd': '/overlays/prd/tst' must resolve to a file': recursed merging from path 'overlays/prd/tst': may not add resource with an already registered id: Namespace.v1.[noGrp]/webserver.[noNs]
it seems like kustomize does this nameReference after the whole config is loaded and has that base namespace registered.
Is there another way to do this?
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions