From 015ec33d4843769481fae59d06ddd7e047a2d70d Mon Sep 17 00:00:00 2001 From: Atanas Pamukchiev Date: Thu, 23 Nov 2023 22:31:43 +0100 Subject: [PATCH] migrate(splunk): Migrate to new common (#15093) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** ⚒️ Fixes #15091 **⚙️ Type of change** - [ ] ⚙️ Feature/App addition - [x] 🪛 Bugfix - [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] 🔃 Refactor of current code **🧪 How Has This Been Tested?** **📃 Notes:** **✔️ Checklist:** - [ ] ⚖️ My code follows the style guidelines of this project - [ ] 👀 I have performed a self-review of my own code - [ ] #️⃣ I have commented my code, particularly in hard-to-understand areas - [ ] 📄 I have made corresponding changes to the documentation - [ ] ⚠️ My changes generate no new warnings - [ ] 🧪 I have added tests to this description that prove my fix is effective or that my feature works - [x] ⬆️ I increased versions for any altered app according to semantic versioning **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🪞 I have opened a PR on [truecharts/containers](https://github.com/truecharts/containers) adding the container to TrueCharts mirror repo. - [ ] 🖼️ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._ --------- Signed-off-by: Atanas Pamukchiev Co-authored-by: Xstar97TheNoob <9399967+xstar97@users.noreply.github.com> Co-authored-by: StevenMcElligott <89483932+StevenMcElligott@users.noreply.github.com> --- charts/incubator/splunk/Chart.yaml | 6 +-- charts/incubator/splunk/questions.yaml | 53 +++++++++---------- charts/incubator/splunk/templates/NOTES.txt | 1 + charts/incubator/splunk/templates/_config.tpl | 12 ++--- charts/incubator/splunk/templates/common.yaml | 12 +++-- charts/incubator/splunk/values.yaml | 34 ++++++------ 6 files changed, 59 insertions(+), 59 deletions(-) create mode 100644 charts/incubator/splunk/templates/NOTES.txt diff --git a/charts/incubator/splunk/Chart.yaml b/charts/incubator/splunk/Chart.yaml index 1844e71ba1f..e359f2d5a27 100644 --- a/charts/incubator/splunk/Chart.yaml +++ b/charts/incubator/splunk/Chart.yaml @@ -2,11 +2,11 @@ annotations: truecharts.org/SCALE-support: "true" truecharts.org/category: Tools-Utilities apiVersion: v2 -appVersion: "9.0.4" +appVersion: "9.1.2" dependencies: - name: common repository: https://library-charts.truecharts.org - version: 11.1.2 + version: 15.2.0 deprecated: false description: "This is a Chartfile for Splunk designed for OpenShift and TrueNAS based on Alpine Linux - https://www.splunk.com" home: https://truecharts.org/charts/incubator/splunk @@ -25,4 +25,4 @@ sources: - https://github.com/truecharts/charts/tree/master/charts/incubator/splunk - https://splunk.github.io/docker-splunk type: application -version: 3.0.10 +version: 4.0.0 diff --git a/charts/incubator/splunk/questions.yaml b/charts/incubator/splunk/questions.yaml index 09c9184a2c7..13ca244affe 100644 --- a/charts/incubator/splunk/questions.yaml +++ b/charts/incubator/splunk/questions.yaml @@ -6,54 +6,50 @@ questions: # Include{global} # Include{workload} # Include{workloadDeployment} - # Include{replicas1} # Include{podSpec} # Include{containerMain} + + # Include{containerBasic} # Include{containerAdvanced} - variable: splunk group: App Configuration - label: Splunk Configuration + label: "Splunk Configuration" schema: additional_attrs: true type: dict attrs: - variable: acceptLicense - label: Accept License - description: Arguments to start Splunk with. + label: "Accept License" + description: "Arguments to start Splunk with." schema: type: boolean default: true - variable: password - label: Splunk Password - description: Splunk Web UI admin password. + label: "Splunk Password" + description: "Splunk Web UI admin password." schema: type: string private: true default: "" - variable: extraArgs - label: Extra Startup Arg + label: "Extra Startup Arguments" schema: type: list default: [] items: - variable: argEntry - label: Arg Entry + label: "Arg Entry" schema: type: string required: true default: "" # Include{containerConfig} +# Include{podOptions} # Include{serviceRoot} - - variable: main - label: Main Service - description: The Primary service on which the healthcheck runs, often the webUI - schema: - additional_attrs: true - type: dict - attrs: +# Include{serviceMain} # Include{serviceSelectorLoadBalancer} # Include{serviceSelectorExtras} - variable: main @@ -154,20 +150,19 @@ questions: # Include{ingressTraefik} # Include{ingressAdvanced} # Include{ingressList} - -# Include{podSecurityContextRoot} - - variable: runAsUser - label: runAsUser - description: The UserID of the user running the application - schema: - type: int - default: 0 - - variable: runAsGroup - label: runAsGroup - description: The groupID this App of the user running the application - schema: - type: int - default: 0 +# Include{securityContextRoot} + - variable: runAsUser + label: "runAsUser" + description: "The UserID of the user running the application" + schema: + type: int + default: 0 + - variable: runAsGroup + label: "runAsGroup" + description: "The groupID this App of the user running the application" + schema: + type: int + default: 0 # Include{securityContextContainer} # Include{securityContextAdvanced} # Include{securityContextPod} diff --git a/charts/incubator/splunk/templates/NOTES.txt b/charts/incubator/splunk/templates/NOTES.txt new file mode 100644 index 00000000000..efcb74cb772 --- /dev/null +++ b/charts/incubator/splunk/templates/NOTES.txt @@ -0,0 +1 @@ +{{- include "tc.v1.common.lib.chart.notes" $ -}} diff --git a/charts/incubator/splunk/templates/_config.tpl b/charts/incubator/splunk/templates/_config.tpl index a57dfef75ff..b8a09944786 100644 --- a/charts/incubator/splunk/templates/_config.tpl +++ b/charts/incubator/splunk/templates/_config.tpl @@ -1,7 +1,7 @@ {{/* Define the secret */}} {{- define "splunk.secret" -}} -{{- $splunkSecret := printf "%s-splunk-config" (include "tc.common.names.fullname" .) }} +{{- $splunkSecret := printf "%s-splunk-config" (include "tc.v1.common.lib.chart.names.fullname" .) }} {{- $argList := list -}} {{- if .Values.splunk.acceptLicense -}} @@ -14,14 +14,8 @@ {{- end -}} {{- end }} ---- -apiVersion: v1 -kind: Secret -metadata: - name: {{ $splunkSecret }} - labels: - {{- include "tc.common.labels" . | nindent 4 }} -stringData: +enabled: true +data: {{- with $argList }} SPLUNK_START_ARGS: {{ join " " . | quote }} {{- end }} diff --git a/charts/incubator/splunk/templates/common.yaml b/charts/incubator/splunk/templates/common.yaml index f8fb2812de8..de4c1a4a912 100644 --- a/charts/incubator/splunk/templates/common.yaml +++ b/charts/incubator/splunk/templates/common.yaml @@ -1,5 +1,11 @@ -{{ include "tc.common.loader.init" . }} +{{/* Make sure all variables are set properly */}} +{{- include "tc.v1.common.loader.init" . -}} -{{- include "splunk.secret" . }} +{{/* Render secrets for Splunk */}} +{{- $secrets := include "splunk.secret" . | fromYaml -}} +{{- if $secrets -}} + {{- $_ := set .Values.secret "secret" $secrets -}} +{{- end -}} -{{ include "tc.common.loader.apply" . }} +{{/* Render the templates */}} +{{- include "tc.v1.common.loader.apply" . -}} diff --git a/charts/incubator/splunk/values.yaml b/charts/incubator/splunk/values.yaml index 1c6770e0d78..b3b718e2a93 100644 --- a/charts/incubator/splunk/values.yaml +++ b/charts/incubator/splunk/values.yaml @@ -1,25 +1,20 @@ image: pullPolicy: IfNotPresent repository: splunk/splunk - tag: 9.0.4@sha256:864f89b8acee4d54c81f9431da78175ff70379d554ab3f3db3d2c92fb4641b8d - -podSecurityContext: - runAsGroup: 0 - runAsUser: 0 + tag: 9.1.2@sha256:2a94cd38514f6f3b6bee2cd1df36ded17d7b8148ccb35e3be2a91258f6e5c46b securityContext: - readOnlyRootFilesystem: false - runAsNonRoot: false + container: + runAsNonRoot: false + readOnlyRootFilesystem: false + runAsUser: 0 + runAsGroup: 0 splunk: acceptLicense: true password: changeme extraArgs: [] -envFrom: - - secretRef: - name: '{{ include "tc.common.names.fullname" . }}-splunk-config' - service: dataingest: enabled: true @@ -27,13 +22,13 @@ service: dataingest: enabled: true port: 9997 - protocol: HTTP + protocol: http targetPort: 9997 main: ports: main: port: 8000 - protocol: HTTP + protocol: http targetPort: 8000 management: enabled: true @@ -41,8 +36,16 @@ service: management: enabled: true port: 8089 - protocol: HTTP + protocol: http targetPort: 8089 +workload: + main: + podSpec: + containers: + main: + envFrom: + - secretRef: + name: "secret" persistence: appcreds: @@ -56,4 +59,5 @@ persistence: mountPath: /splunkdata portal: - enabled: true + open: + enabled: true