Open derrickburns opened 2 years ago
I would like to work on this.
Try escaping the dot.
Example:
- name: controller.podAnnotations."prometheus\.io/scrape"
value: "true"
- name: controller.podAnnotations."prometheus\.io/port"
value: "10254"
We are facing issues also with service account annotations:
- name: controller.serviceAccount.annotations."eks\\.amazonaws\\.com/role-arn"
also this:
- name: controller.serviceAccount.annotations."eks\.amazonaws\.com\/role-arn"
also this:
- name: controller.serviceAccount.annotations."eks\.amazonaws\.com/role-arn"
nothing seems to work, can you assist?
@avifreege try
- name: controller.serviceAccount.annotations.eks\.amazonaws\.com/role-arn
Anyone figured out what is a proper way to escape annotations? Example above does not seem to work for me, my case is:
name: argo-workflows.server.ingress.annotations.alb\.ingress\.kubernetes\.io/group.name
None of the variants worked, all attempts end up with actual annotation being like:
alb=map[ingress:map[kubernetes:map[io/group:map[name:some-value]]]]
{{- if and (.Values.ingressNginx) (.Values.ingressNginx.enable) -}}
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: ingress-nginx
namespace: {{ .Values.argoNamespace | default "argo-cd" }}
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: {{ .Values.argoProject | default "default" }}
source:
repoURL: {{ .Values.repoUrl }}
path: config/addons/ingress-controllers/ingress-nginx
targetRevision: {{ .Values.targetRevision }}
helm:
values: |
ingress-nginx:
{{- omit .Values.ingressNginx "destinationNamespace" | toYaml | nindent 10 }}
parameters:
- name: ingress-nginx.controller.service.annotations.\external-dns\.alpha\.kubernetes\.io/hostname
value: {{ .Values.hostname }}
destination:
server: {{ .Values.destinationServer | default "https://kubernetes.default.svc" }}
namespace: {{ .Values.ingressNginx.destinationNamespace }}
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- ApplyOutOfSyncOnly=true
- CreateNamespace=true
retry:
limit: 1
backoff:
duration: 5s
factor: 2
maxDuration: 1m
{{- end -}}
I originally tried the native helm format, i.e.
- name: controller.podAnnotations."prometheus\.io/port"
value: "10254"
That did not work, but it did work after dropping the quotes
- name: controller.podAnnotations.prometheus\.io/port
value: "10254"
I would like to pass an annotation via helm parameters in the Application CRD such as:
However, this does not work:
According to the k8s spec for annotations, the slash and period are allowed:
On the flattener side, there is a related bug here.
Your
flatVal
function does not check for the presence of dots in the key. Therefore, the key gets mis-interpreted when flattened.