Skip to content

Instantly share code, notes, and snippets.

@ryanfaircloth
Last active March 4, 2021 20:37
Show Gist options
  • Save ryanfaircloth/ebfdf1d46cfbabe8515d3239a32a00b0 to your computer and use it in GitHub Desktop.
Save ryanfaircloth/ebfdf1d46cfbabe8515d3239a32a00b0 to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: ConfigMap
metadata:
name: uf-config
data:
deploymentclient.conf: |
[deployment-client]
clientName=foo
[target-broker:deploymentServer]
targetUri=deploymentserver.splunk.mycompany.com:8089
apiVersion: v1
kind: Pod
metadata:
name: sidecar-container-demo
spec:
containers:
- name: main-container
image: nginx
resources: {}
ports:
- containerPort: 80
volumeMounts:
- name: var-logs
mountPath: /var/log
#https://docs.splunk.com/Documentation/Forwarder/8.1.2/Forwarder/DeployandrunauniversalforwarderinsideaDockercontainer
- name: splunkUF-sidecar
image: splunk/universalforwarder:latest
env:
- name: SPLUNK_START_ARGS
value: '--accept-license'
- name: SPLUNK_PASSWORD
value: 'Chang3d!'
resources: {}
volumeMounts:
- name: var-logs
mountPath: /var/log
- name: uf-config
mountPath: /opt/splunkforwarder/etc/apps/_k8s/local
dnsPolicy: Default
volumes:
- name: var-logs
emptyDir: {}
- name: uf-config
configMap:
# Provide the name of the ConfigMap you want to mount.
name: uf-config
# An array of keys from the ConfigMap to create as files
items:
- key: "deploymentclient.conf"
path: "deploymentclient.conf"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment