Skip to content

Commit

Permalink
Build with healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Faircloth committed Jun 28, 2019
1 parent 683bd9f commit 69e1b0d
Show file tree
Hide file tree
Showing 15 changed files with 197 additions and 63 deletions.
208 changes: 159 additions & 49 deletions .idea/workspace.xml

Large diffs are not rendered by default.

17 changes: 12 additions & 5 deletions package/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,18 @@ RUN cd /tmp ;\
rm epel-release-latest-7.noarch.rpm ;\
rpm --import https://packages.confluent.io/rpm/5.2/archive.key ;\
yum install gcc tzdata libdbi libsecret libxml2 sqlite tcp_wrappers librdkafka \
rh-python36 rh-python36-python-tools libcurl ivykis scl-utils tcp_wrappers-libs -y;\
rh-python36 rh-python36-python-tools libcurl ivykis scl-utils tcp_wrappers-libs curl -y;\
echo source scl_source enable rh-python36 >>/etc/profile.d/enablepython36.sh ;\
source scl_source enable rh-python36 ;\
pip install dumb-init


ENV DEBCONF_NONINTERACTIVE_SEEN=true
ENV SPLUNK_CONNECT_METHOD=hec

RUN source scl_source enable rh-python36 ; curl -fsSL https://goss.rocks/install | sh
COPY goss.yml /goss/goss.yml

COPY --from=0 /opt/syslog-ng /opt/syslog-ng
COPY scripts/splunkmetrics.sh /opt/syslog-ng/sbin/splunkmetrics.sh
COPY scripts/switch_transport.sh /opt/syslog-ng/sbin/switch_transport.sh
Expand All @@ -73,11 +79,12 @@ COPY sbin/entrypoint.sh /sbin/entrypoint.sh
RUN source scl_source enable rh-python36 ;/opt/syslog-ng/sbin/syslog-ng -V
RUN source scl_source enable rh-python36 ;/opt/syslog-ng/sbin/syslog-ng -t

ENV DEBCONF_NONINTERACTIVE_SEEN=true
ENV SPLUNK_CONNECT_METHOD=hec

EXPOSE 514
EXPOSE 601/tcp
EXPOSE 6514/tcp

#ENTRYPOINT ["/sbin/entrypoint.sh", "--"]
ENV SPLUNK_CONNECT_METHOD=UF

ENTRYPOINT ["/sbin/entrypoint.sh", "--"]

HEALTHCHECK --interval=1s --timeout=6s CMD source scl_source enable rh-python36 ;goss -g /goss/goss.yaml validate
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions package/etc/conf.d/splunk.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
# UF transport
# ===============================================================================================
@define splunk-log-root "/var/log/syslog-ng/data"
@define splunk-user "splunk" # owner of the local disk files
@define splunk-group "splunk" # group of the local disk files
@define splunk-user "root" # owner of the local disk files
@define splunk-group "root" # group of the local disk files

# ===============================================================================================
# Kafka transport
Expand Down Expand Up @@ -63,7 +63,7 @@
# Order is important; templates must be loaded first
# ===============================================================================================
@include "scl.conf"
@include "conf.d/t_*.conf"
@include "conf.d/s_*.conf"
@include "conf.d/b_*.conf"
@include "conf.d/f_*.conf"
@include "conf.d/templates/*.conf"
@include "conf.d/sources/*.conf"
@include "conf.d/blocks/*.conf"
@include "conf.d/filters/*.conf"
File renamed without changes.
1 change: 1 addition & 0 deletions package/etc/syslog-ng.conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ options {
chain_hostnames (off);
use_dns (no);
use_fqdn (no);
dns-cache (no);
create_dirs (no);
keep-hostname (yes);
};
Expand Down
16 changes: 16 additions & 0 deletions package/goss.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
process:
syslog-ng:
running: true
port:
tcp:514:
listening: true
ip:
- 0.0.0.0
udp:514:
listening: true
ip:
- 0.0.0.0
tcp:6514:
listening: true
ip:
- 0.0.0.0
6 changes: 3 additions & 3 deletions package/sbin/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/dumb-init /bin/sh
#!/opt/rh/rh-python36/root/usr/bin/dumb-init /bin/bash

#Run syslog
mkdir /opt/syslog-ng/var
rm /opt/syslog-ng/var/syslog-ng.ctl
/opt/syslog-ng/sbin/switch_transport.sh hec
rm /opt/syslog-ng/var/syslog-ng.ctl || true
/opt/syslog-ng/sbin/switch_transport.sh
/opt/syslog-ng/sbin/syslog-ng --process-mode=background
/opt/syslog-ng/sbin/splunkmetrics.sh

0 comments on commit 69e1b0d

Please sign in to comment.