diff --git a/make/harbor.yml.tmpl b/make/harbor.yml.tmpl index e81abfc43e7f..cba1d840f9b7 100644 --- a/make/harbor.yml.tmpl +++ b/make/harbor.yml.tmpl @@ -29,6 +29,13 @@ https: # ipv4: # enabled: true +# # Network : This section defines a custom network configuration for a Docker service. +# # It specifies a network named "harbor" with the following parameters: subnet and gateway +# networks: +# harbor: +# subnet: 172.22.0.0/16 +# gateway: 172.22.0.1 + # # Uncomment following will enable tls communication between all harbor components # internal_tls: # # set enabled to true means internal tls is enabled @@ -206,7 +213,7 @@ _version: 2.11.0 # # host for redis+sentinel: # # :,:,: # host: redis:6379 -# password: +# password: # # Redis AUTH command was extended in Redis 6, it is possible to use it in the two-arguments AUTH form. # # there's a known issue when using external redis username ref:https://github.com/goharbor/harbor/issues/18892 # # if you care about the image pull/push performance, please refer to this https://github.com/goharbor/harbor/wiki/Harbor-FAQs#external-redis-username-password-usage diff --git a/make/photon/prepare/migrations/version_2_11_0/harbor.yml.jinja b/make/photon/prepare/migrations/version_2_11_0/harbor.yml.jinja index ef0be73dbf63..c606bba974f0 100644 --- a/make/photon/prepare/migrations/version_2_11_0/harbor.yml.jinja +++ b/make/photon/prepare/migrations/version_2_11_0/harbor.yml.jinja @@ -71,6 +71,20 @@ ip_family: # enabled: true {% endif %} + +# # Network : This section defines a custom network configuration for a Docker service. +# # It specifies a network named "harbor" with the following parameters: subnet and gateway +# networks: +# harbor: +# subnet: 172.22.0.0/16 +# gateway: 172.22.0.1 +{% if networks is defined %} +networks: + harbor: + subnet: {{ networks.harbor.subnet }} + gateway: {{ networks.harbor.gateway }} +{% endif %} + {% if internal_tls is defined %} # Uncomment following will enable tls communication between all harbor components internal_tls: diff --git a/make/photon/prepare/templates/docker_compose/docker-compose.yml.jinja b/make/photon/prepare/templates/docker_compose/docker-compose.yml.jinja index 0ccf1ace524f..18be68e8a5fe 100644 --- a/make/photon/prepare/templates/docker_compose/docker-compose.yml.jinja +++ b/make/photon/prepare/templates/docker_compose/docker-compose.yml.jinja @@ -399,4 +399,10 @@ services: networks: harbor: external: false - +{% if networks is defined %} + driver: bridge + ipam: + config: + - subnet: {{ networks.harbor.subnet }} + gateway: {{ networks.harbor.gateway }} +{% endif %}