Skip to content

Instantly share code, notes, and snippets.

@kodefoundry
Created June 17, 2021 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kodefoundry/fa83f27cea2f90c5c5901e728b635845 to your computer and use it in GitHub Desktop.
Save kodefoundry/fa83f27cea2f90c5c5901e728b635845 to your computer and use it in GitHub Desktop.
kind: ConfigMap
apiVersion: v1
metadata:
name: nginx-config
namespace: ingress-nginx
data:
nginx.tmpl: |
# This is TEST configuration for {{$.Ingress.Name}}/{{$.Ingress.Namespace}}
{{range $ip := split (index $.Ingress.Annotations "custom.nginx.org/test-split-feature") ","}}
# Insert config for test-split-feature: {{trim $ip}};
{{end}}
{{if index $.Ingress.Annotations "custom.nginx.org/feature-a"}}
# Insert config for feature A if the annotation is set
{{end}}
{{with $value := index $.Ingress.Annotations "custom.nginx.org/feature-b"}}
# Print the value assigned to the annotation: {{$value}}
{{end}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment