Skip to content

Commit 3453a37

Browse files
authored
Merge branch 'develop' into support-dfs-configuration
2 parents 9789375 + 251f9c5 commit 3453a37

File tree

3 files changed

+47
-4
lines changed

3 files changed

+47
-4
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ SPLUNK_ANSIBLE_BRANCH ?= develop
77
SPLUNK_COMPOSE ?= cluster_absolute_unit.yaml
88
# Set Splunk version/build parameters here to define downstream URLs and file names
99
SPLUNK_PRODUCT := splunk
10-
SPLUNK_VERSION := 7.2.6
11-
SPLUNK_BUILD := c0bf0f679ce9
10+
SPLUNK_VERSION := 7.3.0
11+
SPLUNK_BUILD := 657388c7a488
1212
ifeq ($(shell arch), s390x)
1313
SPLUNK_ARCH = s390x
1414
else

docs/EXAMPLES.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Note that for more complex scenarios, we will opt to use a [Docker compose file]
2020
* [Create search head cluster](#create-search-head-cluster)
2121
* [Create indexer cluster and search head cluster](#create-indexer-cluster-and-search-head-cluster)
2222
* [Enable root endpoint on SplunkWeb](#enable-root-endpoint-on-splunkweb)
23+
* [Create sidecar forwarder](#create-sidecar-forwarder)
2324
* [More](#more)
2425

2526
## Create standalone from CLI
@@ -808,5 +809,47 @@ $ SPLUNK_PASSWORD=<password> docker-compose up -d
808809

809810
Then, visit SplunkWeb on your browser with the root endpoint in the URL, such as `http://localhost:8000/splunkweb`.
810811

812+
## Create sidecar forwarder
813+
<details><summary>k8s-sidecar.yml</summary><p>
814+
815+
```
816+
apiVersion: v1
817+
kind: Pod
818+
metadata:
819+
name: example
820+
spec:
821+
containers:
822+
- name: splunk-uf
823+
image: splunk/universalforwarder:latest
824+
env:
825+
- name: SPLUNK_START_ARGS
826+
value: --accept-license
827+
- name: SPLUNK_PASSWORD
828+
value: helloworld
829+
- name: SPLUNK_CMD
830+
value: add monitor /var/log/
831+
- name: SPLUNK_STANDALONE_URL
832+
value: splunk.company.internal
833+
volumeMounts:
834+
- name: shared-data
835+
mountPath: /var/log
836+
- name: my-app
837+
image: my-app
838+
volumeMounts:
839+
- name: shared-data
840+
mountPath: /app/logs/
841+
volumes:
842+
- name: shared-data
843+
emptyDir: {}
844+
```
845+
</p></details>
846+
847+
Execute the following to bring up your deployment:
848+
```
849+
$ kubectl apply -f k8s-sidecar.yml
850+
```
851+
852+
After your pod is ready, the universal forwarder will be reading the logs generated by your app via the shared volume mount. In the ideal case, your app is generating the logs while the forwarder is reading them and streaming the output to a separate Splunk instance located at splunk.company.internal.
853+
811854
## More
812855
There are a variety of Docker compose scenarios in the `docker-splunk` repo [here](https://github.com/splunk/docker-splunk/tree/develop/test_scenarios). Please feel free to use any of those for reference in terms of different topologies!

splunk/common-files/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ COPY [ "splunk/common-files/updateetc.sh", "/sbin/" ]
5555

5656
# Setup users and groups
5757
RUN groupadd -r -g ${GID} ${SPLUNK_GROUP} \
58-
&& useradd -r -m -u ${UID} -g ${GID} -s /sbin/nologin -d ${SPLUNK_HOME} ${SPLUNK_USER} \
59-
&& chown -R splunk.splunk ${SPLUNK_HOME} \
58+
&& useradd -r -m -u ${UID} -g ${GID} ${SPLUNK_USER} \
6059
&& chmod 755 /sbin/updateetc.sh
6160

6261
COPY --from=package --chown=splunk:splunk /minimal /opt
@@ -106,6 +105,7 @@ RUN sed -i -e 's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL/g' /
106105
&& mkdir ${CONTAINER_ARTIFACT_DIR} \
107106
&& chown -R ${ANSIBLE_USER}:${ANSIBLE_GROUP} $CONTAINER_ARTIFACT_DIR \
108107
&& chmod -R 555 ${SPLUNK_ANSIBLE_HOME} \
108+
&& chmod -R 777 ${CONTAINER_ARTIFACT_DIR} \
109109
&& chmod 755 /sbin/entrypoint.sh /sbin/createdefaults.py /sbin/checkstate.sh
110110

111111
USER ${ANSIBLE_USER}

0 commit comments

Comments
 (0)