Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
182 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM haproxy:1.8.9-alpine | ||
|
||
# Installs required packages | ||
# Change timezone to UTC | ||
RUN set -x \ | ||
&& apk add --update --no-cache ca-certificates su-exec runit socklog tzdata bash openrc lua5.3 lua-socket \ | ||
&& rm -rf /etc/sv /etc/service \ | ||
&& echo 'Etc/UTC' > /etc/timezone \ | ||
&& ln -sf /usr/share/lua/ /usr/local/share/ \ | ||
&& ln -sf /usr/lib/lua/ /usr/local/lib/ | ||
|
||
ENV TZ :/etc/localtime | ||
ENV LANG en_US.utf8 | ||
|
||
COPY voyager /usr/bin/voyager | ||
COPY auth-request.lua /etc/auth-request.lua | ||
|
||
# Setup runit scripts | ||
COPY sv /etc/sv/ | ||
RUN ln -s /etc/sv /etc/service | ||
|
||
COPY runit.sh /runit.sh | ||
ENTRYPOINT ["/runit.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
export HAPROXY_CONTROLLER_ARGS="$@" | ||
export > /etc/envvars | ||
|
||
[[ $DEBUG == true ]] && set -x | ||
|
||
# create haproxy.cfg dir | ||
mkdir /etc/haproxy | ||
touch /var/run/haproxy.pid | ||
mkdir -p /etc/ssl/private/haproxy | ||
|
||
echo "Starting runit..." | ||
exec /sbin/runsvdir -P /etc/service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
set -eou pipefail | ||
|
||
GOPATH=$(go env GOPATH) | ||
REPO_ROOT=$GOPATH/src/github.com/appscode/voyager | ||
|
||
source "$REPO_ROOT/hack/libbuild/common/public_image.sh" | ||
|
||
detect_tag $REPO_ROOT/dist/.tag | ||
|
||
IMG=haproxy | ||
TAG=1.8.9-$TAG-alpine | ||
DOCKER_REGISTRY=${DOCKER_REGISTRY:-appscode} | ||
|
||
build() { | ||
pushd $(dirname "${BASH_SOURCE}") | ||
cp $REPO_ROOT/dist/voyager/voyager-alpine-amd64 voyager | ||
chmod +x voyager | ||
|
||
# download auth-request.lua | ||
curl -fsSL -o auth-request.lua https://raw.githubusercontent.com/appscode/haproxy-auth-request/v1.8.9/auth-request.lua | ||
|
||
local cmd="docker build -t $DOCKER_REGISTRY/$IMG:$TAG ." | ||
echo $cmd; $cmd | ||
rm voyager auth-request.lua | ||
popd | ||
} | ||
|
||
binary_repo $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
source /etc/envvars | ||
|
||
echo "Starting HAProxy controller ..." | ||
cmd="exec voyager haproxy-controller $HAPROXY_CONTROLLER_ARGS" | ||
echo $cmd | ||
$cmd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
exec 2>&1 | ||
exec chpst -Unobody socklog unix /dev/log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
FROM haproxy:1.8.9 | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
ENV DEBCONF_NONINTERACTIVE_SEEN true | ||
|
||
# Installs required packages | ||
# Change timezone to UTC | ||
RUN set -x \ | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends ca-certificates runit lua5.3 lua-socket \ | ||
&& rm -rf /var/lib/apt/lists/* /usr/share/doc /usr/share/man /tmp/* /etc/sv /etc/service \ | ||
&& echo 'Etc/UTC' > /etc/timezone | ||
|
||
# Install socklog | ||
COPY socklog.deb . | ||
RUN set -x && apt install ./socklog.deb && rm socklog.deb | ||
|
||
ENV TZ :/etc/localtime | ||
ENV LANG en_US.utf8 | ||
|
||
COPY voyager /usr/bin/voyager | ||
COPY auth-request.lua /etc/auth-request.lua | ||
|
||
# Setup runit scripts | ||
COPY sv /etc/sv/ | ||
RUN ln -s /etc/sv /etc/service | ||
|
||
COPY runit.sh /runit.sh | ||
ENTRYPOINT ["/runit.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
export HAPROXY_CONTROLLER_ARGS="$@" | ||
export > /etc/envvars | ||
|
||
[[ $DEBUG == true ]] && set -x | ||
|
||
# create haproxy.cfg dir | ||
mkdir /etc/haproxy | ||
touch /var/run/haproxy.pid | ||
mkdir -p /etc/ssl/private/haproxy | ||
|
||
echo "Starting runit..." | ||
exec /usr/bin/runsvdir -P /etc/service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
set -eou pipefail | ||
|
||
GOPATH=$(go env GOPATH) | ||
REPO_ROOT=$GOPATH/src/github.com/appscode/voyager | ||
|
||
source "$REPO_ROOT/hack/libbuild/common/public_image.sh" | ||
|
||
detect_tag $REPO_ROOT/dist/.tag | ||
|
||
IMG=haproxy | ||
TAG=1.8.9-$TAG | ||
DOCKER_REGISTRY=${DOCKER_REGISTRY:-appscode} | ||
|
||
build() { | ||
pushd $(dirname "${BASH_SOURCE}") | ||
cp $REPO_ROOT/dist/voyager/voyager-linux-amd64 voyager | ||
chmod +x voyager | ||
|
||
# download socklog (`socklog` not available for `stretch`, use `jessie` deb instead) | ||
curl -L -o socklog.deb http://ftp.us.debian.org/debian/pool/main/s/socklog/socklog_2.1.0-8_amd64.deb | ||
# download auth-request.lua | ||
curl -fsSL -o auth-request.lua https://raw.githubusercontent.com/appscode/haproxy-auth-request/v1.8.9/auth-request.lua | ||
|
||
local cmd="docker build -t $DOCKER_REGISTRY/$IMG:$TAG ." | ||
echo $cmd; $cmd | ||
rm voyager socklog.deb auth-request.lua | ||
popd | ||
} | ||
|
||
binary_repo $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
source /etc/envvars | ||
|
||
echo "Starting HAProxy controller ..." | ||
cmd="exec voyager haproxy-controller $HAPROXY_CONTROLLER_ARGS" | ||
echo $cmd | ||
$cmd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
exec 2>&1 | ||
exec chpst -Unobody socklog unix /dev/log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters