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

Allow custom network configuration in harbor.yml for docker compose deployments #21719

Open
yilas opened this issue Mar 11, 2025 · 0 comments
Open

Comments

@yilas
Copy link

yilas commented Mar 11, 2025

Is your feature request related to a problem? Please describe.
Currently, when deploying Harbor using Docker Compose, the default network created can potentially conflict with existing networks in some environments. For instance, in my case, my VM is located in a DMZ with an address in the 172.20.0.0/24 subnet, while the network automatically created by Docker Compose uses a range within 172.20.0.0/16, causing conflicts.

At present, the only way to work around this issue is to modify the Docker daemon settings, which is not always desirable or feasible, especially in restricted environments.

A related discussion took place in PR #20867, where I proposed a solution. However, the PR was not merged, and I would like to revisit this feature request to see if there’s a better approach that aligns with the project’s vision.

Describe the solution you'd like
I would like to have the ability to define a custom network configuration directly in the harbor.yml file (as described in a previous issue). This would allow users to specify the subnet, gateway, and other relevant network parameters, ensuring that Harbor’s Docker network does not conflict with pre-existing networks.

For example, a possible configuration in harbor.yml could be :

networks:
  harbor:
    subnet: 172.22.0.0/16
    gateway: 172.22.0.1

Which would translate into the following in the generated docker-compose.yml :

networks:
  harbor:
    external: false
    driver: bridge
    ipam:
      config:
        - subnet: 172.22.0.0/16
          gateway: 172.22.0.1

Describe the main design/architecture of your solution

  • Extend the harbor.yml configuration to allow defining network settings.
  • Modify the installation scripts to process this configuration and generate a corresponding docker-compose.yml.
  • Ensure backward compatibility : if no custom network settings are defined, the default behavior remains unchanged.

Describe the development plan you've considered
Review previous discussions PR #20867 to address concerns that led to its rejection.

Additional context
This feature would benefit users who deploy Harbor in complex network environments, reducing conflicts and avoiding the need to modify Docker daemon settings manually. It would also align Harbor’s deployment with best practices in container networking.
Would love to hear your thoughts on this proposal !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant