<p>In Kubernetes, is it possible to use a Configmap for the value of an annotation? The reason I want to do this is to reuse an IP whitelist across multiple ingresses. Alternatively, is there another way to approach this problem?</p>

<p>Unfortunately, no feature does it in Kubernetes. But as <a href="https://stackoverflow.com/users/4501268/iomv">iomv</a> wrote, you could try to use <a href="https://docs.helm.sh/using_helm/#quickstart-guide" rel="nofollow noreferrer">helm.</a></p>

<p>Helm allows you to use variables in your charts, for example:</p>

<pre><code>metadata:
{{- if .Values.controller.service.annotations }}
  annotations:
{{ toYaml .Values.controller.service.annotations | indent 4 }}
{{- end }}
  labels:
{{- if .Values.controller.service.labels }}
{{ toYaml .Values.controller.service.labels | indent 4 }}
{{- end }}
    app: {{ template "nginx-ingress.name" . }}
    chart: {{ .Chart.Name }}-{{ .Chart.Version }}
    component: "{{ .Values.controller.name }}"
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
  name: {{ template "nginx-ingress.controller.fullname" . }}
</code></pre>

<p>This part of code is from the <a href="https://github.com/kubernetes/charts/blob/master/stable/nginx-ingress/templates/controller-service.yaml" rel="nofollow noreferrer">nginx-ingress</a> chart.
As you see, you can fetch this chart and update the values as you need.</p>
