Skip to content

Commit b6ac66b

Browse files
ikheifets-splunkmstopa-splunk
authored andcommitted
fix: remove goss from healthcheck (#2600)
Signed-off-by: Ilya Kheifets <[email protected]>
1 parent 64b599c commit b6ac66b

18 files changed

+19
-78
lines changed

ansible/resources/podman_sc4s.service

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ ExecStart=/usr/bin/podman run \
3838
-v "$SC4S_ARCHIVE_MOUNT" \
3939
-v "$SC4S_TLS_MOUNT" \
4040
--env-file=/opt/sc4s/env_file \
41-
--health-cmd="/healthcheck.sh" \
42-
--health-interval=10s --health-retries=6 --health-timeout=6s \
41+
--health-cmd="/usr/sbin/syslog-ng-ctl healthcheck --timeout 5" \
42+
--health-interval=2m --health-retries=6 --health-timeout=5s \
4343
--network host \
4444
--name SC4S \
4545
--rm $SC4S_IMAGE

charts/splunk-connect-for-syslog/templates/statefulset.yaml

+4-9
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,6 @@ spec:
134134
- name: ietf-dflt-tls
135135
containerPort: 5425
136136
protocol: TCP
137-
- name: health
138-
containerPort: 8080
139-
protocol: TCP
140137
{{- if .Values.sc4s }}
141138
{{- if .Values.sc4s.vendor_product }}
142139
{{- range $vp := .Values.sc4s.vendor_product }}
@@ -216,16 +213,14 @@ spec:
216213
readOnly: true
217214
{{- end }}
218215
livenessProbe:
219-
httpGet:
220-
path: /healthz
221-
port: 8080
216+
exec:
217+
command: ["syslog-ng-ctl", "healthcheck", "--timeout", "5"]
222218
initialDelaySeconds: 10
223219
periodSeconds: 3
224220
timeoutSeconds: 5
225221
readinessProbe:
226-
httpGet:
227-
path: /healthz
228-
port: 8080
222+
exec:
223+
command: ["syslog-ng-ctl", "healthcheck", "--timeout", "5"]
229224
initialDelaySeconds: 10
230225
failureThreshold: 60
231226
periodSeconds: 10

docs/configuration.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,8 @@ ExecStart=/usr/bin/podman run \
334334
-v "$SC4S_TLS_MOUNT" \
335335
--privileged \
336336
--env-file=/opt/sc4s/env_file \
337-
--health-cmd="/healthcheck.sh" \
338-
--health-interval=10s --health-retries=6 --health-timeout=6s \
337+
--health-cmd="/usr/sbin/syslog-ng-ctl healthcheck --timeout 5" \
338+
--health-interval=2m --health-retries=6 --health-timeout=5s \
339339
--network host \
340340
--name SC4S \
341341
--rm $SC4S_IMAGE

docs/gettingstarted/ansible-docker-podman.md

-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ SC4S_ENV_CHECK_HEC: Splunk HEC connection test successful to index=main for sour
7979
SC4S_ENV_CHECK_HEC: Splunk HEC connection test successful to index=main for sourcetype=sc4s:events...
8080
syslog-ng checking config
8181
sc4s version=v1.36.0
82-
starting goss
8382
starting syslog-ng
8483
```
8584

docs/gettingstarted/ansible-docker-swarm.md

-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ SC4S_ENV_CHECK_HEC: Splunk HEC connection test successful to index=main for sour
103103
SC4S_ENV_CHECK_HEC: Splunk HEC connection test successful to index=main for sourcetype=sc4s:events...
104104
syslog-ng checking config
105105
sc4s version=v1.36.0
106-
starting goss
107106
starting syslog-ng
108107
```
109108

docs/gettingstarted/ansible-mk8s.md

-1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,5 @@ SC4S_ENV_CHECK_HEC: Splunk HEC connection test successful to index=main for sour
7575
SC4S_ENV_CHECK_HEC: Splunk HEC connection test successful to index=main for sourcetype=sc4s:events...
7676
syslog-ng checking config
7777
sc4s version=v1.36.0
78-
starting goss
7978
starting syslog-ng
8079
```

docs/gettingstarted/byoe-rhel8.md

+5-20
Original file line numberDiff line numberDiff line change
@@ -64,28 +64,13 @@ sudo wget -c https://github.com/splunk/splunk-connect-for-syslog/releases/downlo
6464
sudo pip3 install -r /etc/syslog-ng/requirements.txt
6565
```
6666

67-
6. Optionally, to use monitoring, install `goss` and confirm that the version is v0.3.16 or later. `goss` installs in
68-
`/usr/local/bin` by default, so do one of the following:
69-
70-
* Make sure that `entrypoint.sh` is modified to include `/usr/local/bin` in the full path.
71-
* Move the `goss` binary to `/bin` or `/usr/bin`.
72-
73-
```
74-
curl -L https://github.com/aelsabbahy/goss/releases/latest/download/goss-linux-amd64 -o /usr/local/bin/goss
75-
chmod +rx /usr/local/bin/goss
76-
curl -L https://github.com/aelsabbahy/goss/releases/latest/download/dgoss -o /usr/local/bin/dgoss
77-
# Alternatively, using the latest
78-
# curl -L https://raw.githubusercontent.com/aelsabbahy/goss/latest/extras/dgoss/dgoss -o /usr/local/bin/dgoss
79-
chmod +rx /usr/local/bin/dgoss
80-
```
81-
82-
7. You can run SC4S using systemd in one of two ways, depending on administrator preference and
67+
6. You can run SC4S using systemd in one of two ways, depending on administrator preference and
8368
orchestration methodology. These are not the only ways to run in a custom environment:
8469

8570
* Run the `entrypoint.sh` script (identical to that used in the container) directly using systemd.
8671
* Alter the script to preconfigure SC4S, after which only the syslog-ng are run using systemd.
8772

88-
8. To run the `entrypoint.sh` script directly in systemd, create the SC4S unit file ``/lib/systemd/system/sc4s.service`` and add the following:
73+
7. To run the `entrypoint.sh` script directly in systemd, create the SC4S unit file ``/lib/systemd/system/sc4s.service`` and add the following:
8974

9075
```ini
9176
[Unit]
@@ -107,7 +92,7 @@ Restart=on-abnormal
10792
WantedBy=multi-user.target
10893
```
10994

110-
9. To run `entrypoint.sh` as a preconfigured script, modify the script by commenting out or removing the stanzas following the
95+
8. To run `entrypoint.sh` as a preconfigured script, modify the script by commenting out or removing the stanzas following the
11196
`OPTIONAL for BYOE` comments in the script. This prevents syslog-ng from being launched by the script. Then create the SC4S unit file ``/lib/systemd/system/syslog-ng.service`` and add the following content:
11297

11398
```ini
@@ -130,7 +115,7 @@ Restart=on-failure
130115
WantedBy=multi-user.target
131116
```
132117

133-
10. Create the file ``/etc/syslog-ng/env_file`` and add the following environment variables. Adjust the URL/TOKEN as needed.
118+
9. Create the file ``/etc/syslog-ng/env_file`` and add the following environment variables. Adjust the URL/TOKEN as needed.
134119

135120
```dotenv
136121
# The following "path" variables can differ from the container defaults specified in the entrypoint.sh script.
@@ -150,7 +135,7 @@ SC4S_DEST_SPLUNK_HEC_DEFAULT_TOKEN=a778f63a-5dff-4e3c-a72c-a03183659e94
150135
# SC4S_DEST_SPLUNK_HEC_DEFAULT_TLS_VERIFY=no
151136
```
152137

153-
11. Reload systemctl and restart syslog-ng (example here is shown for systemd option (1) above)
138+
10. Reload systemctl and restart syslog-ng (example here is shown for systemd option (1) above)
154139

155140
```bash
156141
sudo systemctl daemon-reload

docs/gettingstarted/docker-compose-MacOS.md

-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ You should see events similar to those below in the output:
120120
```ini
121121
syslog-ng checking config
122122
sc4s version=v1.36.0
123-
starting goss
124123
starting syslog-ng
125124
```
126125

docs/gettingstarted/docker-compose.md

-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ You should see events similar to those below in the output:
112112
```ini
113113
syslog-ng checking config
114114
sc4s version=v1.36.0
115-
starting goss
116115
starting syslog-ng
117116
```
118117

docs/gettingstarted/docker-systemd-general.md

-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ You should see events similar to those below in the output:
116116
```ini
117117
syslog-ng checking config
118118
sc4s version=v1.36.0
119-
starting goss
120119
starting syslog-ng
121120
```
122121

docs/gettingstarted/podman-systemd-general.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ You should see events similar to those below in the output:
109109
```ini
110110
syslog-ng checking config
111111
sc4s version=v1.36.0
112-
starting goss
113112
starting syslog-ng
114113
```
115114

@@ -178,8 +177,8 @@ ExecStart=/usr/bin/podman run -p 2514:514 -p 2514:514/udp -p 6514:6514 \
178177
-v "$SC4S_ARCHIVE_MOUNT" \
179178
-v "$SC4S_TLS_MOUNT" \
180179
--env-file=/home/sc4s/env_file \
181-
--health-cmd="/healthcheck.sh" \
182-
--health-interval=10s --health-retries=6 --health-timeout=6s \
180+
--health-cmd="/usr/sbin/syslog-ng-ctl healthcheck --timeout 5" \
181+
--health-interval=2m --health-retries=6 --health-timeout=5s \
183182
--network host \
184183
--name SC4S \
185184
--rm $SC4S_IMAGE

docs/resources/podman/sc4s.service

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ ExecStart=/usr/bin/podman run \
3838
-v "$SC4S_ARCHIVE_MOUNT" \
3939
-v "$SC4S_TLS_MOUNT" \
4040
--env-file=/opt/sc4s/env_file \
41-
--health-cmd="/healthcheck.sh" \
42-
--health-interval=10s --health-retries=6 --health-timeout=6s \
41+
--health-cmd="/usr/sbin/syslog-ng-ctl healthcheck --timeout 5" \
42+
--health-interval=2m --health-retries=6 --health-timeout=5s \
4343
--network host \
4444
--name SC4S \
4545
--rm $SC4S_IMAGE

docs/v3_upgrade.md

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ SC4S_ENV_CHECK_HEC: Splunk HEC connection test successful to index=main for sour
2727
SC4S_ENV_CHECK_HEC: Splunk HEC connection test successful to index=main for sourcetype=sc4s:events...
2828
syslog-ng checking config
2929
sc4s version=3.0.0
30-
starting goss
3130
starting syslog-ng
3231
```
3332

package/Dockerfile

+1-5
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ RUN apk add -U --upgrade --no-cache \
4141
cargo \
4242
ca-certificates \
4343
poetry \
44-
&& curl -fsSL https://goss.rocks/install | GOSS_VER=v0.4.8 sh \
4544
&& groupadd --gid 1024 syslog \
4645
&& useradd -M -g 1024 -u 1024 syslog \
4746
&& usermod -L syslog \
@@ -56,9 +55,7 @@ EXPOSE 6514/tcp
5655
#/dev/log a low priv user cannot read this and the container will fail in SC4S
5756
#and other uses the low user may be selected
5857

59-
HEALTHCHECK --interval=10s --retries=6 --timeout=6s CMD /healthcheck.sh
60-
61-
COPY package/etc/goss.yaml /etc/syslog-ng/goss.yaml
58+
HEALTHCHECK --interval=2m --timeout=5s --start-period=30s CMD /usr/sbin/syslog-ng-ctl healthcheck --timeout 5
6259

6360
COPY pyproject.toml /
6461
COPY poetry.lock /
@@ -75,7 +72,6 @@ COPY package/etc/test_parsers /etc/syslog-ng/test_parsers
7572
COPY package/etc/local_config /etc/syslog-ng/local_config
7673
COPY package/etc/local_config /etc/syslog-ng/local_config
7774
COPY package/sbin/entrypoint.sh /
78-
COPY package/sbin/healthcheck.sh /
7975
COPY package/sbin/source_ports_validator.py /
8076

8177
ENV SC4S_CONTAINER_OPTS=--no-caps

package/Dockerfile.lite

+1-5
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ RUN apk add -U --upgrade --no-cache \
4141
cargo \
4242
ca-certificates \
4343
poetry \
44-
&& curl -fsSL https://goss.rocks/install | GOSS_VER=v0.4.8 sh \
4544
&& groupadd --gid 1024 syslog \
4645
&& useradd -M -g 1024 -u 1024 syslog \
4746
&& usermod -L syslog \
@@ -56,9 +55,7 @@ EXPOSE 6514/tcp
5655
#/dev/log a low priv user cannot read this and the container will fail in SC4S
5756
#and other uses the low user may be selected
5857

59-
HEALTHCHECK --interval=10s --retries=6 --timeout=6s CMD /healthcheck.sh
60-
61-
COPY package/etc/goss.yaml /etc/syslog-ng/goss.yaml
58+
HEALTHCHECK --interval=2m --timeout=5s --start-period=30s CMD /usr/sbin/syslog-ng-ctl healthcheck --timeout 5
6259

6360
COPY pyproject.toml /
6461
COPY poetry.lock /
@@ -97,7 +94,6 @@ COPY package/lite/etc/config.yaml /etc/syslog-ng/config.yaml
9794
COPY package/lite/etc/addons /etc/syslog-ng/addons
9895

9996
COPY package/sbin/entrypoint.sh /
100-
COPY package/sbin/healthcheck.sh /
10197
COPY package/sbin/source_ports_validator.py /
10298

10399

package/etc/goss.yaml

-12
This file was deleted.

package/sbin/entrypoint.sh

-7
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,6 @@ echo sc4s version=$(cat $SC4S_ETC/VERSION)
224224
echo sc4s version=$(cat $SC4S_ETC/VERSION) >>$SC4S_VAR/log/syslog-ng.out
225225
$SC4S_SBIN/syslog-ng --no-caps $SC4S_CONTAINER_OPTS -s >>$SC4S_VAR/log/syslog-ng.out 2>$SC4S_VAR/log/syslog-ng.err
226226

227-
# Use goss to pick up default listening ports for health check
228-
if command -v goss &> /dev/null
229-
then
230-
echo starting goss
231-
goss -g $SC4S_ETC/goss.yaml serve -l 0.0.0.0:$SC4S_LISTEN_STATUS_PORT --format json >/dev/null 2>/dev/null &
232-
fi
233-
234227
# OPTIONAL for BYOE: Comment out/remove all remaining lines and launch syslog-ng directly from systemd
235228
if [ "${SC4S_DEBUG_CONTAINER}" == "yes" ]
236229
then

package/sbin/healthcheck.sh

-4
This file was deleted.

0 commit comments

Comments
 (0)