From a24765818899c5b49027558fadae4abd9a561eef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolo=CC=80=20Ciraci?= Date: Thu, 5 Dec 2024 15:27:06 +0100 Subject: [PATCH 1/4] fix(namespace): add explicit namespace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nicolò Ciraci --- .gitignore | 129 ++++++++++++++++++++++++++++++++++ templates/_helpers.tpl | 12 ++++ templates/configmap.yaml | 1 + templates/deployment.yaml | 1 + templates/hpa.yaml | 1 + templates/ingress.yaml | 1 + templates/networkpolicy.yaml | 1 + templates/service.yaml | 1 + templates/serviceaccount.yaml | 1 + values.yaml | 1 + 10 files changed, 149 insertions(+) diff --git a/.gitignore b/.gitignore index e3343cd..6a29be6 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,130 @@ +# Created by https://www.toptal.com/developers/gitignore/api/macos,intellij+all,helm +# Edit at https://www.toptal.com/developers/gitignore?templates=macos,intellij+all,helm + +### Helm ### +# Chart dependencies +**/charts/*.tgz + +### Intellij+all ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### Intellij+all Patch ### +# Ignore everything but code style settings and run configurations +# that are supposed to be shared within teams. + +.idea/* + +!.idea/codeStyles +!.idea/runConfigurations + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### macOS Patch ### +# iCloud generated files +*.icloud + +# End of https://www.toptal.com/developers/gitignore/api/macos,intellij+all,helm test-output.xml diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index da7b610..4fbd57d 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -1,3 +1,15 @@ +{{/* +Allow the release namespace to be overridden for multi-namespace deployments in combined charts +*/}} +{{- define "tika-helm.namespace" -}} + {{- if .Values.namespaceOverride -}} + {{- .Values.namespaceOverride -}} + {{- else -}} + {{- .Release.Namespace -}} + {{- end -}} +{{- end -}} + + {{/* Expand the name of the chart. */}} diff --git a/templates/configmap.yaml b/templates/configmap.yaml index a26e972..b588c95 100644 --- a/templates/configmap.yaml +++ b/templates/configmap.yaml @@ -21,6 +21,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ .Chart.Name }}-config + namespace: {{ include "tika-helm.namespace" . }} data: tika-config.xml: |- {{ .Values.tikaConfig | indent 4 }} diff --git a/templates/deployment.yaml b/templates/deployment.yaml index de1d352..1c99894 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -20,6 +20,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "tika-helm.fullname" . }} + namespace: {{ include "tika-helm.namespace" . }} labels: {{- include "tika-helm.labels" . | nindent 4 }} spec: diff --git a/templates/hpa.yaml b/templates/hpa.yaml index 3c162ed..e46040f 100644 --- a/templates/hpa.yaml +++ b/templates/hpa.yaml @@ -21,6 +21,7 @@ apiVersion: {{ .Values.autoscaling.apiVersion }} kind: HorizontalPodAutoscaler metadata: name: {{ include "tika-helm.fullname" . }} + namespace: {{ include "tika-helm.namespace" . }} labels: {{- include "tika-helm.labels" . | nindent 4 }} spec: diff --git a/templates/ingress.yaml b/templates/ingress.yaml index 716fd6d..3a330e1 100644 --- a/templates/ingress.yaml +++ b/templates/ingress.yaml @@ -34,6 +34,7 @@ apiVersion: extensions/v1beta1 kind: Ingress metadata: name: {{ $fullName }} + namespace: {{ include "tika-helm.namespace" . }} labels: {{- include "tika-helm.labels" . | nindent 4 }} {{- with .Values.ingress.annotations }} diff --git a/templates/networkpolicy.yaml b/templates/networkpolicy.yaml index 4241840..3ea4d58 100644 --- a/templates/networkpolicy.yaml +++ b/templates/networkpolicy.yaml @@ -21,6 +21,7 @@ apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: {{ template "tika-helm.fullname" . }} + namespace: {{ include "tika-helm.namespace" . }} labels: {{- include "tika-helm.labels" . | nindent 4 }} spec: diff --git a/templates/service.yaml b/templates/service.yaml index cc3e253..73f4e1f 100644 --- a/templates/service.yaml +++ b/templates/service.yaml @@ -20,6 +20,7 @@ apiVersion: v1 kind: Service metadata: name: {{ include "tika-helm.fullname" . }} + namespace: {{ include "tika-helm.namespace" . }} labels: {{- include "tika-helm.labels" . | nindent 4 }} annotations: diff --git a/templates/serviceaccount.yaml b/templates/serviceaccount.yaml index 0f708f2..0f33db0 100644 --- a/templates/serviceaccount.yaml +++ b/templates/serviceaccount.yaml @@ -21,6 +21,7 @@ apiVersion: v1 kind: ServiceAccount metadata: name: {{ include "tika-helm.serviceAccountName" . }} + namespace: {{ include "tika-helm.namespace" . }} labels: {{- include "tika-helm.labels" . | nindent 4 }} {{- with .Values.serviceAccount.annotations }} diff --git a/values.yaml b/values.yaml index a8da1e0..5eb676d 100644 --- a/values.yaml +++ b/values.yaml @@ -28,6 +28,7 @@ image: imagePullSecrets: [] nameOverride: '' fullnameOverride: '' +namespaceOverride: '' serviceAccount: # Specifies whether a service account should be created From c269e82bb97873a1afa8b71fbd219a1c6c0e8b53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolo=CC=80=20Ciraci?= Date: Thu, 5 Dec 2024 15:27:24 +0100 Subject: [PATCH 2/4] fix(nwpolicy): fix incorrect indent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nicolò Ciraci --- templates/networkpolicy.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/networkpolicy.yaml b/templates/networkpolicy.yaml index 3ea4d58..6921751 100644 --- a/templates/networkpolicy.yaml +++ b/templates/networkpolicy.yaml @@ -36,7 +36,7 @@ spec: {{- if not .Values.networkPolicy.allowExternal }} from: - podSelector: - matchLabels: - {{ template "tika-helm.fullname" . }}-client: "true" + matchLabels: + {{ template "tika-helm.fullname" . }}-client: "true" {{- end }} {{- end }} From bc1deef7c81fd4199908bb33cc943c20a34eb998 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolo=CC=80=20Ciraci?= Date: Thu, 5 Dec 2024 15:36:08 +0100 Subject: [PATCH 3/4] chore: bump patch level MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nicolò Ciraci --- Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Chart.yaml b/Chart.yaml index 09ef35c..9761596 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -20,7 +20,7 @@ apiVersion: v2 name: tika appVersion: "3.0.0.0-full" -version: "3.0.0-full" +version: "3.0.1-full" description: The official Helm chart for Apache Tika type: application keywords: From f5a870ef5a707cb751c0936432ad592a7832b529 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolo=CC=80=20Ciraci?= Date: Thu, 5 Dec 2024 15:37:45 +0100 Subject: [PATCH 4/4] fix: missing a pod MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nicolò Ciraci --- templates/tests/test-connection.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/tests/test-connection.yaml b/templates/tests/test-connection.yaml index 5de0a4c..a2a8e9f 100644 --- a/templates/tests/test-connection.yaml +++ b/templates/tests/test-connection.yaml @@ -20,6 +20,7 @@ apiVersion: v1 kind: Pod metadata: name: "{{ include "tika-helm.fullname" . }}-test-connection" + namespace: {{ include "tika-helm.namespace" . }} labels: {{- include "tika-helm.labels" . | nindent 4 }} annotations: