-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handling of namereference prefixed by namespace. #1367
Comments
There is a workaround using a variable (as variable where intended to be used). With the following input: varReference:
- path: metadata/annotations/nginx.ingress.kubernetes.io\/auth-tls-secret
kind: Ingress kind: Kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
namePrefix: prefix-
nameSuffix: -suffix
resources:
- ingress.yaml
- secrets.yaml
configurations:
- kustomizeconfig.yaml
vars:
- name: TLS_SECRET_NAME
objref:
apiVersion: v1
kind: Secret
name: auth-tls-secret apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress1
annotations:
ingress.kubernetes.io/auth-secret: secret1
nginx.ingress.kubernetes.io/auth-secret: secret1
nginx.ingress.kubernetes.io/auth-tls-secret: ns1/$(TLS_SECRET_NAME)
spec:
rules:
- host: CNAME.DOMAIN.COM
http:
paths:
- path: /
backend:
serviceName: testsvc
servicePort: 80 The output would is: apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
ingress.kubernetes.io/auth-secret: prefix-secret1-suffix
nginx.ingress.kubernetes.io/auth-secret: prefix-secret1-suffix
nginx.ingress.kubernetes.io/auth-tls-secret: ns1/prefix-auth-tls-secret-suffix
name: prefix-ingress1-suffix
spec:
rules:
- host: CNAME.DOMAIN.COM
http:
paths:
- backend:
serviceName: testsvc
servicePort: 80
path: / |
The namereference transformation can currently deal properly with the following structure: list of string, configuration that fits in the namereference config:
list of map, configuration that fits in the namereference config:
what @mmb did highlight is that there a structure that can't be describe efficiently yet: Instead of - path: metadata/annotations/nginx.ingress.kubernetes.io\/auth-tls-secret
kind: Ingress - path: metadata/annotations/nginx.ingress.kubernetes.io\/auth-tls-secret
pattern: (namespace/)?name
kind: Ingress and have the pattern initialize to name |
This issue is created to track what @mmb discovered in the handling of secretName transformations when used nginx.ingress related annotations (see PR
By default kustomize does not convert the secretName reference in the annotation:
For the deployment to work, the annotation needs to look like:
Here is the output:
The text was updated successfully, but these errors were encountered: