Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate(splunk): Migrate to new common #15093

Merged
merged 20 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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