From 95282379a7307a9e984437f72e2b64361d29e95a Mon Sep 17 00:00:00 2001 From: Anders Nierhoff Date: Thu, 11 Jul 2024 07:05:52 +0200 Subject: [PATCH 1/8] Update statefulset.yaml with log-colume and custom annotations --- templates/statefulset.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/templates/statefulset.yaml b/templates/statefulset.yaml index 3876719..0b142e6 100644 --- a/templates/statefulset.yaml +++ b/templates/statefulset.yaml @@ -21,7 +21,8 @@ spec: checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} {{- if not (.Values.deploy.security.secretName) }} checksum/identities: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }} - {{- end }} + {{- end }} + {{- include "infinispan-helm-charts.podAnnotations" . | nindent 8 }} labels: app: infinispan-pod clusterName: {{ include "infinispan-helm-charts.name" . }} @@ -135,6 +136,8 @@ spec: name: config-volume - mountPath: /opt/infinispan/server/data name: data-volume + - mountPath: /opt/infinispan/server/log + name: log-volume - mountPath: /etc/security name: identities-volume {{- if and .Values.deploy.ssl (ne .Values.deploy.ssl.transportSecretName "")}} @@ -166,6 +169,8 @@ spec: - name: data-volume emptyDir: { } {{- end }} + - name: log-volume + emptyDir: { } {{- with .Values.deploy.tolerations }} tolerations: {{- toYaml . | nindent 8 }} From c67ce9255f0c19d938951933dc35fbcfd49a382e Mon Sep 17 00:00:00 2001 From: Anders Nierhoff Date: Thu, 11 Jul 2024 07:07:44 +0200 Subject: [PATCH 2/8] Update helpers.tpl with function for custom pod annotations --- templates/helpers.tpl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/templates/helpers.tpl b/templates/helpers.tpl index 4116e53..12ce4ae 100644 --- a/templates/helpers.tpl +++ b/templates/helpers.tpl @@ -41,6 +41,16 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} {{- end }} +{{/* +Pod custom Annotations +*/}} + +{{- define "infinispan-helm-charts.podAnnotations" -}} +{{- range .Values.deploy.podAnnotations }} +{{ .key }}: {{ .value }} +{{- end }} +{{- end }} + {{/* Pod custom labels */}} From 0fb328a6238fc2a60b8cb99cef4f4568433e1a7a Mon Sep 17 00:00:00 2001 From: Anders Nierhoff Date: Thu, 11 Jul 2024 07:08:30 +0200 Subject: [PATCH 3/8] Update values.yaml with default empty list for custom pod annotations --- values.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/values.yaml b/values.yaml index c08e8cd..ed9aebb 100644 --- a/values.yaml +++ b/values.yaml @@ -76,6 +76,8 @@ deploy: resourceLabels: [] + podAnnotations: [] + podLabels: [] svcLabels: [] From 8d56c25c3ba58c7d49b2a74c07d5c5ceace342e9 Mon Sep 17 00:00:00 2001 From: Anders Nierhoff Date: Thu, 11 Jul 2024 07:09:29 +0200 Subject: [PATCH 4/8] Update values.schema.json.tpl with podAnnotations --- values.schema.json.tpl | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/values.schema.json.tpl b/values.schema.json.tpl index fc46873..4b927bc 100644 --- a/values.schema.json.tpl +++ b/values.schema.json.tpl @@ -311,6 +311,27 @@ } } }, + "podAnnotations": { + "description": "Adds annotations to every pod created", + "items": { + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "key", + "value" + ] + }, + "type": [ + "array", + "null" + ] + }, "podLabels": { "description": "Adds labels to every pod created", "items": { From a49474b439ac73e937d9042aaad21d1b457031e0 Mon Sep 17 00:00:00 2001 From: Anders Nierhoff Date: Thu, 11 Jul 2024 07:10:18 +0200 Subject: [PATCH 5/8] Update values.schema.json with pod annotations --- values.schema.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/values.schema.json b/values.schema.json index 014646b..6ab2c98 100644 --- a/values.schema.json +++ b/values.schema.json @@ -311,6 +311,27 @@ } } }, + "podAnnotations": { + "description": "Adds annotations to every pod created", + "items": { + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "key", + "value" + ] + }, + "type": [ + "array", + "null" + ] + }, "podLabels": { "description": "Adds labels to every pod created", "items": { From 1add15ef58073dbc002eb269644edce7769ec7fc Mon Sep 17 00:00:00 2001 From: Anders Nierhoff Date: Thu, 11 Jul 2024 07:11:06 +0200 Subject: [PATCH 6/8] Update README.md.tpl with podAnnotations --- README.md.tpl | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md.tpl b/README.md.tpl index a3c5a52..6371aa6 100644 --- a/README.md.tpl +++ b/README.md.tpl @@ -37,6 +37,7 @@ Configure your {brandname} cluster by specifying values in the `deploy.*` sectio | `deploy.expose.host` | Specifies the hostname where the {ingress} is exposed, if required. | `""` | | | `deploy.expose.annotations` | Adds annotations to the service that exposes {brandname} on the network. | `{}` | - | | `deploy.logging.categories` | Configures {brandname} cluster log categories and levels. | `{}` | - | +| `deploy.podAnnotations` | Adds annotations to each Infinispan pod that you create. | `{}` | - | | `deploy.podLabels` | Adds labels to each Infinispan pod that you create. | `{}` | - | | `deploy.svcLabels` | Adds labels to each service that you create.| `{}` | - | | `deploy.resourceLabels` | Adds labels to all {brandname} resources including pods and services. | `{}` | - | From 606b14dbd09630a155f1772f5540e42c06c3896d Mon Sep 17 00:00:00 2001 From: Anders Nierhoff Date: Thu, 11 Jul 2024 07:11:42 +0200 Subject: [PATCH 7/8] Update README.md with podAnnotations --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ba886f2..076a1dc 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ Configure your Infinispan cluster by specifying values in the `deploy.*` section | `deploy.expose.host` | Specifies the hostname where the Ingress is exposed, if required. | `""` | | | `deploy.expose.annotations` | Adds annotations to the service that exposes Infinispan on the network. | `{}` | - | | `deploy.logging.categories` | Configures Infinispan cluster log categories and levels. | `{}` | - | +| `deploy.podAnnotations` | Adds annotations to each Infinispan pod that you create. | `{}` | - | | `deploy.podLabels` | Adds labels to each Infinispan pod that you create. | `{}` | - | | `deploy.svcLabels` | Adds labels to each service that you create.| `{}` | - | | `deploy.resourceLabels` | Adds labels to all Infinispan resources including pods and services. | `{}` | - | From c8187f6eb3869f8b27f858ae80e5da17bad62854 Mon Sep 17 00:00:00 2001 From: Anders Nierhoff Date: Fri, 12 Jul 2024 13:29:18 +0200 Subject: [PATCH 8/8] Revert log Volume --- templates/statefulset.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/templates/statefulset.yaml b/templates/statefulset.yaml index 0b142e6..de2c159 100644 --- a/templates/statefulset.yaml +++ b/templates/statefulset.yaml @@ -136,8 +136,6 @@ spec: name: config-volume - mountPath: /opt/infinispan/server/data name: data-volume - - mountPath: /opt/infinispan/server/log - name: log-volume - mountPath: /etc/security name: identities-volume {{- if and .Values.deploy.ssl (ne .Values.deploy.ssl.transportSecretName "")}} @@ -169,8 +167,6 @@ spec: - name: data-volume emptyDir: { } {{- end }} - - name: log-volume - emptyDir: { } {{- with .Values.deploy.tolerations }} tolerations: {{- toYaml . | nindent 8 }}