Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support of network configuration in docker_compose #20867

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
9 changes: 8 additions & 1 deletion make/harbor.yml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -206,7 +213,7 @@ _version: 2.12.0
# # host for redis+sentinel:
# # <host_sentinel1>:<port_sentinel1>,<host_sentinel2>:<port_sentinel2>,<host_sentinel3>:<port_sentinel3>
# host: redis:6379
# password:
# password:
# # Redis AUTH command was extended in Redis 6, it is possible to use it in the two-arguments AUTH <username> <password> 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
Expand Down
14 changes: 14 additions & 0 deletions make/photon/prepare/migrations/version_2_11_0/harbor.yml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}