mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-03-10 04:08:02 +03:00
Migrate Kubernetes v1.9.1 cluster/addons/registry to Kubespray
This commit is contained in:
23
roles/kubernetes-apps/registry/files/images/rootfs/bin/boot
Executable file
23
roles/kubernetes-apps/registry/files/images/rootfs/bin/boot
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# fail if no hostname is provided
|
||||
REGISTRY_HOST=${REGISTRY_HOST:?no host}
|
||||
REGISTRY_PORT=${REGISTRY_PORT:-5000}
|
||||
|
||||
# we are always listening on port 80
|
||||
# https://github.com/nginxinc/docker-nginx/blob/43c112100750cbd1e9f2160324c64988e7920ac9/stable/jessie/Dockerfile#L25
|
||||
PORT=80
|
||||
|
||||
sed -e "s/%HOST%/$REGISTRY_HOST/g" \
|
||||
-e "s/%PORT%/$REGISTRY_PORT/g" \
|
||||
-e "s/%BIND_PORT%/$PORT/g" \
|
||||
</etc/nginx/conf.d/default.conf.in >/etc/nginx/conf.d/default.conf
|
||||
|
||||
# wait for registry to come online
|
||||
while ! curl -sS "$REGISTRY_HOST:$REGISTRY_PORT" &>/dev/null; do
|
||||
printf "waiting for the registry (%s:%s) to come online...\n" "$REGISTRY_HOST" "$REGISTRY_PORT"
|
||||
sleep 1
|
||||
done
|
||||
|
||||
printf "starting proxy...\n"
|
||||
exec nginx -g "daemon off;" "$@"
|
||||
Reference in New Issue
Block a user