Registry changes on mgmt.

This commit is contained in:
Derek Smith 2022-11-05 19:47:47 -04:00
parent ddad272b98
commit 148644110b
Signed by: farscapian
GPG Key ID: 8F1CD799CCA516CC
3 changed files with 32 additions and 33 deletions

View File

@ -35,9 +35,7 @@ if [ ! -f "$CLUSTER_DEFINITION" ]; then
export LXD_CLUSTER_PASSWORD="$(gpg --gen-random --armor 1 14)"
export SOVEREIGN_STACK_MAC_ADDRESS="CHANGE_ME_REQUIRED"
export PROJECT_NAME="public"
export REGISTRY_URL="http://$(hostname).$(resolvectl status | grep 'DNS Domain:' | awk '{ print $3 }'):5000"
export REGISTRY_USERNAME="CHANGE_ME"
export REGISTRY_PASSWORD="CHANGE_ME"
#export REGISTRY_URL="https://index.docker.io/v1/"
EOL

View File

@ -107,3 +107,4 @@ export REMOTE_CERT_BASE_DIR="$REMOTE_HOME/.certs"
# this space is for OS, docker images, etc. DOES NOT INCLUDE USER DATA.
export ROOT_DISK_SIZE_GB=20
export REGISTRY_URL="https://index.docker.io/v1/"

View File

@ -175,34 +175,34 @@ source "$CLUSTER_DEFINITION"
# if the registry URL isn't defined, then we just use the upstream dockerhub.
# recommended to run a registry cache on your management machine though.
if [ -n "$REGISTRY_URL" ]; then
# if [ -n "$REGISTRY_URL" ]; then
cat > "$CLUSTER_PATH/registry.yml" <<EOL
version: 0.1
http:
addr: 0.0.0.0:5000
host: ${REGISTRY_URL}
# cat > "$CLUSTER_PATH/registry.yml" <<EOL
# version: 0.1
# http:
# addr: 0.0.0.0:5000
# host: ${REGISTRY_URL}
proxy:
remoteurl: ${REGISTRY_URL}
username: ${REGISTRY_USERNAME}
password: ${REGISTRY_PASSWORD}
EOL
# proxy:
# remoteurl: ${REGISTRY_URL}
# username: ${REGISTRY_USERNAME}
# password: ${REGISTRY_PASSWORD}
# EOL
# enable docker swarm mode so we can support docker stacks.
if docker info | grep -q "Swarm: inactive"; then
docker swarm init
fi
# # enable docker swarm mode so we can support docker stacks.
# if docker info | grep -q "Swarm: inactive"; then
# docker swarm init
# fi
mkdir -p "${CACHES_DIR}/registry_images"
# mkdir -p "${CACHES_DIR}/registry_images"
# run a docker registry pull through cache on the management machine.
if [ "$DEPLOY_MGMT_REGISTRY" = true ]; then
if ! docker stack list | grep -q registry; then
docker stack deploy -c management/registry_mirror.yml registry
fi
fi
fi
# # run a docker registry pull through cache on the management machine.
# if [ "$DEPLOY_MGMT_REGISTRY" = true ]; then
# if ! docker stack list | grep -q registry; then
# docker stack deploy -c management/registry_mirror.yml registry
# fi
# fi
# fi
# this is our password generation mechanism. Relying on GPG for secure password generation
@ -492,7 +492,7 @@ export PRIMARY_WWW_FQDN="$WWW_HOSTNAME.$DOMAIN_NAME"
stub_site_definition
# bring the vms up under the primary domain name.
# bring the VMs up under the primary domain name.
instantiate_vms
# let's stub out the rest of our site definitions, if any.