I’m trying to redirect the url through ingress server-snippet annotation in helm chart.
The below hardcoded approach in helm values.yaml works. Is there a way to parametrize the example.com and feed it into helm template command.
keycloak:
ingress:
annotations:
nginx.ingress.kubernetes.io/server-snippet: |
location = /
{ rewrite ^ https://example.com/auth permanent; break; }
I tried
OPTION 1 :
URL="https://example.com"
URL_OVERRIDE="|
location = /
{ rewrite ^ ${URL}/auth permanent; break; }"
CHARTS_OPTIONS+=" --set keycloak.ingress.annotations.nginx.ingress.kubernetes.io/server-snippet=$URL_OVERRIDE"
OPTION 2:
URL="https://example.com"
CHARTS_OPTIONS+=" --set keycloak.ingress.annotations.nginx.ingress.kubernetes.io/server-snippet=|
location = /
{ rewrite ^ ${URL}/auth permanent; break; }"
helm template command fails with message
Error: expected at most two arguments, unexpected arguments: =, /, {, rewrite, ^, https://example.com/auth, permanent;, break;, }*