2023-12-09 00:08:20 +00:00
|
|
|
FROM alpine:3.19
|
2023-07-03 19:47:20 +00:00
|
|
|
|
|
|
|
LABEL architecture="$TARGETPLATFORM" \
|
|
|
|
license="beerware" \
|
|
|
|
name="keepalived" \
|
|
|
|
summary="Alpine based keepalived container" \
|
|
|
|
mantainer="antoinroux@hotmail.fr"
|
2022-01-01 18:05:53 +00:00
|
|
|
|
|
|
|
RUN apk add --no-cache \
|
|
|
|
bash \
|
|
|
|
curl \
|
|
|
|
keepalived \
|
2023-07-03 19:47:20 +00:00
|
|
|
gettext \
|
2022-01-01 18:05:53 +00:00
|
|
|
&& addgroup -S keepalived_script \
|
|
|
|
&& adduser -S -s /sbin/nologin -G keepalived_script -H keepalived_script
|
|
|
|
|
2023-07-03 19:47:20 +00:00
|
|
|
ENV STATE BACKUP
|
|
|
|
ENV INTERFACE enp3s0
|
|
|
|
ENV PRIORITY 200
|
|
|
|
ENV PASSWORD ""
|
|
|
|
ENV SRC_IP ""
|
|
|
|
ENV PEER_IP_0 ""
|
|
|
|
ENV PEER_IP_1 ""
|
|
|
|
|
|
|
|
COPY --chmod=750 --chown=keepalived_script:keepalived_script check_apiserver.sh /usr/lib/keepalived/scripts/chk_kube_apiserver.sh
|
|
|
|
COPY keepalived.template.conf /etc/keepalived/keepalived.template.conf
|
|
|
|
|
|
|
|
COPY --chmod=750 init.sh /
|
|
|
|
|
|
|
|
ENTRYPOINT ["/init.sh"]
|
|
|
|
CMD ["/usr/sbin/keepalived", "--dont-fork", "--log-console"]
|
2022-01-02 11:52:37 +00:00
|
|
|
|
2023-07-03 19:47:20 +00:00
|
|
|
# Customise keepalived with:
|
|
|
|
# args: # override options in the Dockerfile
|
|
|
|
# - --vrrp
|
|
|
|
# - --log-detail
|
|
|
|
# - --dump-conf
|
|
|
|
# - --use-file=/etc/keepalived/keepalived.conf
|
|
|
|
# CMD ["--vrrp","--log-detail","--dump-conf"]
|