diff --git a/services/registry/Makefile b/services/registry/Makefile index ecf10fcc..5228a038 100644 --- a/services/registry/Makefile +++ b/services/registry/Makefile @@ -1,7 +1,5 @@ .DEFAULT_GOAL := help - - # Internal VARIABLES ------------------------------------------------ # STACK_NAME defaults to name of the current directory. Should not to be changed if you follow GitOps operating procedures. STACK_NAME = $(notdir $(shell pwd)) @@ -22,24 +20,24 @@ define create-s3-bucket endef .PHONY: up-local -up-local: .init .env ${TEMP_COMPOSE}-local ## Deploys registry stack +up-local: .init ${TEMP_COMPOSE}-local prune-docker-stack-configs ## Deploys registry stack @$(create-s3-bucket) docker stack deploy --with-registry-auth --prune --compose-file ${TEMP_COMPOSE}-local ${STACK_NAME} -.PHONY: up-letsencrypt-http ## Deploys registry stack using let's encrypt http challenge -up-letsencrypt-http: .init .env ${TEMP_COMPOSE}-letsencrypt-http +.PHONY: up-letsencrypt-http +up-letsencrypt-http: .init ${TEMP_COMPOSE}-letsencrypt-http prune-docker-stack-configs ## Deploys registry stack using let's encrypt http challenge docker stack deploy --with-registry-auth --prune --compose-file ${TEMP_COMPOSE}-letsencrypt-http ${STACK_NAME} -.PHONY: up-letsencrypt-dns ## Deploys registry stack using let's encrypt dns challenge -up-letsencrypt-dns: .init .env ${TEMP_COMPOSE}-letsencrypt-dns +.PHONY: up-letsencrypt-dns +up-letsencrypt-dns: .init ${TEMP_COMPOSE}-letsencrypt-dns prune-docker-stack-configs ## Deploys registry stack using let's encrypt dns challenge docker stack deploy --with-registry-auth --prune --compose-file ${TEMP_COMPOSE}-letsencrypt-dns ${STACK_NAME} -.PHONY: up-dalco ## Deploys registry stack for Dalco Cluster -up-dalco: .init .env ${TEMP_COMPOSE} +.PHONY: up-dalco +up-dalco: .init ${TEMP_COMPOSE} prune-docker-stack-configs ## Deploys registry stack for Dalco Cluster docker stack deploy --with-registry-auth --prune --compose-file ${TEMP_COMPOSE} ${STACK_NAME} .PHONY: up-aws -up-aws: .init .env ${TEMP_COMPOSE}-aws ## Deploys registry on AWS +up-aws: .init ${TEMP_COMPOSE}-aws prune-docker-stack-configs ## Deploys registry on AWS @docker stack deploy --with-registry-auth --prune --compose-file ${TEMP_COMPOSE}-aws ${STACK_NAME} .PHONY: up-master ## Deploys registry on master cluster diff --git a/services/registry/docker-compose.yml.j2 b/services/registry/docker-compose.yml.j2 index 8bcd4c8e..11d1117e 100644 --- a/services/registry/docker-compose.yml.j2 +++ b/services/registry/docker-compose.yml.j2 @@ -36,6 +36,11 @@ services: - monitored deploy: replicas: ${OPS_REGISTRY_REPLICAS} + update_config: + order: start-first + delay: 10s + failure_action: rollback + parallelism: 1 placement: constraints: - node.labels.ops==true @@ -103,6 +108,11 @@ services: - monitored deploy: mode: global + update_config: + order: start-first + delay: 10s + failure_action: rollback + parallelism: 1 placement: constraints: - node.labels.ops==true @@ -128,8 +138,11 @@ networks: configs: registry_config.yml: + name: ${STACK_NAME}_registry_config_{{ "./config.yml" | sha256file | substring(0,10) }} file: ./config.yml nsswitch_conf: + name: ${STACK_NAME}_nsswitch_conf_{{ "./nsswitch.conf" | sha256file | substring(0,10) }} file: ./nsswitch.conf registry_init: + name: ${STACK_NAME}_registry_init_{{ "./init" | sha256file | substring(0,10) }} file: ./init diff --git a/services/registry/template.env b/services/registry/template.env index 95c9421c..664b5b65 100644 --- a/services/registry/template.env +++ b/services/registry/template.env @@ -1,3 +1,5 @@ +STACK_NAME=${STACK_NAME} + OPS_REGISTRY_REPLICAS=${OPS_REGISTRY_REPLICAS} REGISTRY_DOMAIN=${REGISTRY_DOMAIN}