Skip to content

Instantly share code, notes, and snippets.

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}};
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: api-ingress
annotations:
#nginx.ingress.kubernetes.io/rewrite-target: /
kubernetes.io/ingress.class: "nginx"
custom.nginx.org/feature-a: "on"
custom.nginx.org/feature-b: "513"
spec:
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-config
namespace: ingress-nginx
data:
nginx.tmpl: |
{{ $all := . }}
{{ $servers := .Servers }}
{{ $cfg := .Cfg }}
apiVersion: v1
kind: Namespace
metadata:
name: ingress-nginx
labels:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/instance: ingress-nginx
---
# Source: ingress-nginx/templates/controller-serviceaccount.yaml