From e6f7fc31c01138dbe471f28955e1777df20cbd9c Mon Sep 17 00:00:00 2001
From: Tadas Sutkaitis <tadasas@gmail.com>
Date: Tue, 26 Mar 2024 21:26:47 +0200
Subject: [PATCH] Designate: Enable custom annotations

Enable custom annotations for pods [deployments, daemonsets]

Change-Id: I521c74d9f064c73b90c822456e12476cd437b8a8
---
 designate/Chart.yaml                         | 2 +-
 designate/templates/deployment-api.yaml      | 1 +
 designate/templates/deployment-central.yaml  | 1 +
 designate/templates/deployment-mdns.yaml     | 1 +
 designate/templates/deployment-producer.yaml | 1 +
 designate/templates/deployment-sink.yaml     | 1 +
 designate/templates/deployment-worker.yaml   | 1 +
 designate/values_overrides/annotations.yaml  | 9 +++++++++
 releasenotes/notes/designate.yaml            | 1 +
 9 files changed, 17 insertions(+), 1 deletion(-)
 create mode 100644 designate/values_overrides/annotations.yaml

diff --git a/designate/Chart.yaml b/designate/Chart.yaml
index e3aeddd8b6..d5bdd6c2bd 100644
--- a/designate/Chart.yaml
+++ b/designate/Chart.yaml
@@ -14,7 +14,7 @@ apiVersion: v1
 appVersion: v1.0.0
 description: OpenStack-Helm Designate
 name: designate
-version: 0.2.10
+version: 0.2.11
 home: https://docs.openstack.org/designate/latest/
 icon: https://www.openstack.org/themes/openstack/images/project-mascots/Designate/OpenStack_Project_Designate_vertical.jpg
 sources:
diff --git a/designate/templates/deployment-api.yaml b/designate/templates/deployment-api.yaml
index e9df6b6e4d..2bb051e44b 100644
--- a/designate/templates/deployment-api.yaml
+++ b/designate/templates/deployment-api.yaml
@@ -40,6 +40,7 @@ spec:
 {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }}
         configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
         configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }}
+{{ tuple "designate_api" . | include "helm-toolkit.snippets.custom_pod_annotations" | indent 8 }}
     spec:
       serviceAccountName: {{ $serviceAccountName }}
 {{ dict "envAll" $envAll "application" "designate" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
diff --git a/designate/templates/deployment-central.yaml b/designate/templates/deployment-central.yaml
index 02d9f3ca95..abc6f03847 100644
--- a/designate/templates/deployment-central.yaml
+++ b/designate/templates/deployment-central.yaml
@@ -40,6 +40,7 @@ spec:
 {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }}
         configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
         configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }}
+{{ tuple "designate_central" . | include "helm-toolkit.snippets.custom_pod_annotations" | indent 8 }}
     spec:
       serviceAccountName: {{ $serviceAccountName }}
       affinity:
diff --git a/designate/templates/deployment-mdns.yaml b/designate/templates/deployment-mdns.yaml
index d58f630411..0463d0e224 100644
--- a/designate/templates/deployment-mdns.yaml
+++ b/designate/templates/deployment-mdns.yaml
@@ -40,6 +40,7 @@ spec:
 {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }}
         configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
         configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }}
+{{ tuple "designate_mdns" . | include "helm-toolkit.snippets.custom_pod_annotations" | indent 8 }}
     spec:
       serviceAccountName: {{ $serviceAccountName }}
 {{ dict "envAll" $envAll "application" "designate" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
diff --git a/designate/templates/deployment-producer.yaml b/designate/templates/deployment-producer.yaml
index 491dbad854..9b2cc3299f 100644
--- a/designate/templates/deployment-producer.yaml
+++ b/designate/templates/deployment-producer.yaml
@@ -40,6 +40,7 @@ spec:
 {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }}
         configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
         configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }}
+{{ tuple "designate_producer" . | include "helm-toolkit.snippets.custom_pod_annotations" | indent 8 }}
     spec:
       serviceAccountName: {{ $serviceAccountName }}
       affinity:
diff --git a/designate/templates/deployment-sink.yaml b/designate/templates/deployment-sink.yaml
index e577d9d890..8844fa10c2 100644
--- a/designate/templates/deployment-sink.yaml
+++ b/designate/templates/deployment-sink.yaml
@@ -40,6 +40,7 @@ spec:
 {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }}
         configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
         configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }}
+{{ tuple "designate_sink" . | include "helm-toolkit.snippets.custom_pod_annotations" | indent 8 }}
     spec:
       serviceAccountName: {{ $serviceAccountName }}
       affinity:
diff --git a/designate/templates/deployment-worker.yaml b/designate/templates/deployment-worker.yaml
index 74f9c998f7..2ada427e38 100644
--- a/designate/templates/deployment-worker.yaml
+++ b/designate/templates/deployment-worker.yaml
@@ -40,6 +40,7 @@ spec:
 {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }}
         configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
         configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }}
+{{ tuple "designate_worker" . | include "helm-toolkit.snippets.custom_pod_annotations" | indent 8 }}
     spec:
       serviceAccountName: {{ $serviceAccountName }}
       affinity:
diff --git a/designate/values_overrides/annotations.yaml b/designate/values_overrides/annotations.yaml
new file mode 100644
index 0000000000..46c5d881d3
--- /dev/null
+++ b/designate/values_overrides/annotations.yaml
@@ -0,0 +1,9 @@
+---
+annotations:
+  pod:
+    default:
+      custom.tld/key: "value"
+      custom.tld/key2: "value2"
+    designate_api:
+      another.tld/foo: "bar"
+...
diff --git a/releasenotes/notes/designate.yaml b/releasenotes/notes/designate.yaml
index 2f02cfc143..09ff1dbf51 100644
--- a/releasenotes/notes/designate.yaml
+++ b/releasenotes/notes/designate.yaml
@@ -14,4 +14,5 @@ designate:
   - 0.2.8 Remove default policy rules
   - 0.2.9 Define service_type in keystone_authtoken to support application credentials with access rules
   - 0.2.10 Uses uWSGI for API service
+  - 0.2.11 Enable custom annotations for Openstack pods
 ...