Skip to content

Commit

Permalink
migrate(splunk): Migrate to new common (truecharts#15093)
Browse files Browse the repository at this point in the history
**Description**
<!--
Please include a summary of the change and which issue is fixed. Please
also include relevant motivation and context. List any dependencies that
are required for this change.
-->
⚒️ Fixes  truecharts#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?**
<!--
Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration
-->

**📃 Notes:**
<!-- Please enter any other relevant information here -->

**✔️ 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 <atanaspam@users.noreply.github.com>
Co-authored-by: Xstar97TheNoob <9399967+xstar97@users.noreply.github.com>
Co-authored-by: StevenMcElligott <89483932+StevenMcElligott@users.noreply.github.com>
  • Loading branch information
3 people authored Nov 23, 2023
1 parent 4f16610 commit 015ec33
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 59 deletions.
6 changes: 3 additions & 3 deletions charts/incubator/splunk/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
53 changes: 24 additions & 29 deletions charts/incubator/splunk/questions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down
1 change: 1 addition & 0 deletions charts/incubator/splunk/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{- include "tc.v1.common.lib.chart.notes" $ -}}
12 changes: 3 additions & 9 deletions charts/incubator/splunk/templates/_config.tpl
Original file line number Diff line number Diff line change
@@ -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 -}}
Expand All @@ -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 }}
Expand Down
12 changes: 9 additions & 3 deletions charts/incubator/splunk/templates/common.yaml
Original file line number Diff line number Diff line change
@@ -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" . -}}
34 changes: 19 additions & 15 deletions charts/incubator/splunk/values.yaml
Original file line number Diff line number Diff line change
@@ -1,48 +1,51 @@
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
ports:
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
ports:
management:
enabled: true
port: 8089
protocol: HTTP
protocol: http
targetPort: 8089
workload:
main:
podSpec:
containers:
main:
envFrom:
- secretRef:
name: "secret"

persistence:
appcreds:
Expand All @@ -56,4 +59,5 @@ persistence:
mountPath: /splunkdata

portal:
enabled: true
open:
enabled: true

0 comments on commit 015ec33

Please sign in to comment.