Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions data/data/bootstrap/baremetal/files/usr/local/bin/coredns.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,18 @@ if ! podman inspect "$COREDNS_IMAGE" &>/dev/null; then
podman pull "$COREDNS_IMAGE"
fi
MATCHES="$(sudo podman ps -a --format "{{.Names}}" | awk '/coredns$/ {print $0}')"
if [[ -z "$MATCHES" ]]; then
/usr/bin/podman create \
--name coredns \
--volume /etc/coredns:/etc/coredns:z \
--network host \
--env CLUSTER_DOMAIN="$CLUSTER_DOMAIN" \
--env CLUSTER_NAME="$CLUSTER_NAME" \
--env NUM_DNS_MEMBERS="$NUM_DNS_MEMBERS" \
--env API_VIP="$API_VIP" \
"${COREDNS_IMAGE}" \
--conf /etc/coredns/Corefile
if [[ ! -z "$MATCHES" ]]; then
# Remove old pod, or you can get storage for container removed
# errors on restart if the container exits unexpectedly
podman rm -f coredns
fi
/usr/bin/podman create --rm \
--name coredns \
--volume /etc/coredns:/etc/coredns:z \
--network host \
--env CLUSTER_DOMAIN="$CLUSTER_DOMAIN" \
--env CLUSTER_NAME="$CLUSTER_NAME" \
--env NUM_DNS_MEMBERS="$NUM_DNS_MEMBERS" \
--env API_VIP="$API_VIP" \
"${COREDNS_IMAGE}" \
--conf /etc/coredns/Corefile
27 changes: 15 additions & 12 deletions data/data/bootstrap/baremetal/files/usr/local/bin/keepalived.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,19 @@ export DNS_VRID
export NET_MASK
envsubst < /etc/keepalived/keepalived.conf.tmpl | sudo tee /etc/keepalived/keepalived.conf

MATCHES="$(sudo podman ps -a --format "{{.Names}}" | awk '/keepalived$/ {print $0}')"
if [[ -z "$MATCHES" ]]; then
# TODO(bnemec): Figure out how to run with less perms
podman create \
--name keepalived \
--volume /etc/keepalived:/etc/keepalived:z \
--network=host \
--privileged \
--cap-add=ALL \
"${KEEPALIVED_IMAGE}" \
/usr/sbin/keepalived -f /etc/keepalived/keepalived.conf \
--dont-fork -D -l -P
MATCHES="$(podman ps -a --format "{{.Names}}" | awk '/keepalived$/ {print $0}')"
if [[ ! -z "$MATCHES" ]]; then
# Remove old pod, or you can get storage for container removed
# errors on restart if the container exits unexpectedly
podman rm -f keepalived
fi
# TODO(bnemec): Figure out how to run with less perms
podman create --rm \
--name keepalived \
--volume /etc/keepalived:/etc/keepalived:z \
--network=host \
--privileged \
--cap-add=ALL \
"${KEEPALIVED_IMAGE}" \
/usr/sbin/keepalived -f /etc/keepalived/keepalived.conf \
--dont-fork -D -l -P