Created
October 27, 2022 03:52
-
-
Save marcusschiesser/1002ae9c90be16afb1e216df593c8392 to your computer and use it in GitHub Desktop.
Splunk deployment to configure another splunk instance started by the Splunk operator (Example: add user)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: splunk-configurator | |
spec: | |
selector: | |
matchLabels: | |
app.kubernetes.io/name: splunk-configurator | |
replicas: 1 | |
template: | |
metadata: | |
labels: | |
app.kubernetes.io/name: splunk-configurator | |
spec: | |
containers: | |
- name: splunk-configurator | |
image: splunk/splunk:8.2.8 | |
command: ["sudo", "-E", "/bin/sh", "-c"] | |
env: | |
- name: URI | |
value: "https://splunk-my-server-standalone-service:8089" | |
args: | |
- SPLUNK_START_ARGS=--accept-license SPLUNK_PASSWORD=changeme /sbin/entrypoint.sh start-and-exit; | |
while true; | |
do CRED=admin:$(cat /mnt/splunk-secrets/password); | |
/opt/splunk/bin/splunk add user rest -password test -role rest -auth ${CRED} -uri ${URI}; | |
sleep 60; | |
done; | |
volumeMounts: | |
- mountPath: /mnt/splunk-secrets | |
name: mnt-splunk-secrets | |
volumes: | |
- name: mnt-splunk-secrets | |
secret: | |
secretName: splunk-default-secret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Now I understand. I will get in touch with you in case we need any professional help. Thank you, @marcusschiesser.