|
| 1 | +--- |
| 2 | +title: Harbor deployment |
| 3 | +type: Decision Record |
| 4 | +status: Draft |
| 5 | +track: KaaS |
| 6 | +--- |
| 7 | + |
| 8 | +## Introduction |
| 9 | + |
| 10 | +Various container registry open-source solutions have been evaluated in the architectural |
| 11 | +decision record [Requirements for container registry](https://github.com/SovereignCloudStack/standards/blob/main/Standards/scs-0212-v1-requirements-for-container-registry.md). |
| 12 | +It specified requirements for the container registry implementation that need to be |
| 13 | +fulfilled in the context of SCS and also made an architectural decision on what |
| 14 | +implementation should be used by the SCS for e.g. reference installation. As a result, |
| 15 | +Harbor project has been selected as an appropriate container registry implementation for |
| 16 | +the SCS ecosystem. |
| 17 | + |
| 18 | +## Motivation |
| 19 | + |
| 20 | +This proposal is motivated by use cases in which cloud service providers (CSP) would |
| 21 | +like to offer private container registries to their customers. The specific use cases |
| 22 | +should be discussed (see [Open questions](#open-questions)), but our assumption is that |
| 23 | +there are use cases, where CSP offers a recipe (maintained by SCS) for customers to |
| 24 | +deploy the private registry themselves utilizing CSP infrastructure or CSP offers |
| 25 | +container registry as a service. In both cases, the target platform is the Kubernetes |
| 26 | +cluster that operates on top of CSP IaaS. |
| 27 | + |
| 28 | +The purpose of this document is to investigate Harbor deployment possibilities (for the |
| 29 | +Kubernetes cluster as a target platform), compare their supported features, and then |
| 30 | +make an architectural decision on what Harbor deployment strategy will be recommended by the SCS. |
| 31 | + |
| 32 | +## Design Considerations |
| 33 | + |
| 34 | +### Options considered |
| 35 | + |
| 36 | +#### Harbor Helm Chart |
| 37 | + |
| 38 | +[Harbor Helm][harbor-helm] project contains a helm chart for Harbor deployment to the |
| 39 | +target Kubernetes cluster. Harbor helm chart package contains collections of template |
| 40 | +files that describe the installation of Harbor fundamental services and related components |
| 41 | +(e.g. databases) (see [Architecture-Overview-of-Harbor](https://github.com/goharbor/harbor/wiki/Architecture-Overview-of-Harbor) for further details). |
| 42 | + |
| 43 | +The repository is located under the [goharbor](https://github.com/goharbor) GitHub |
| 44 | +organization and the official Harbor documentation mentions it as a way to deploy |
| 45 | +[Harbor on Kubernetes](https://goharbor.io/docs/edge/install-config/harbor-ha-helm/). |
| 46 | +The project is driven and maintained by the Harbor community, and it is |
| 47 | +up-to-date with the latest Harbor releases. Its ability to deploy and manage Harbor |
| 48 | +components are listed below: |
| 49 | + |
| 50 | +- Deploy Harbor fundamental services (e.g. portal, core, jobservice, etc.) |
| 51 | +- Deploy Harbor fundamental services in HA mode |
| 52 | +- Deploy Harbor data access layer (PostgreSQL, Redis). Object store |
| 53 | + deployment is not supported. |
| 54 | +- Deploy Harbor services exposed with a load balancer |
| 55 | +- Ability to upgrade the Harbor registry version |
| 56 | + |
| 57 | +#### Harbor Operator |
| 58 | + |
| 59 | +[Harbor Operator][harbor-operator] project provides a solution to deploy and manage a |
| 60 | +full Harbor service stack including both Harbor fundamental components and their |
| 61 | +relevant dependent services such as database, cache, and storage services to the target Kubernetes |
| 62 | +cluster. |
| 63 | + |
| 64 | +The repository is located under the [goharbor](https://github.com/goharbor) GitHub |
| 65 | +organization. The project is driven and maintained by the Harbor's community, and it is |
| 66 | +up-to-date with the latest Harbor releases. Its aim is to simplify the installation and |
| 67 | +mainly Day 2 operations of Harbor. Its ability to deploy and manage Harbor |
| 68 | +components are listed below: |
| 69 | + |
| 70 | +- Deploy Harbor fundamental services (e.g. portal, core, jobservice, etc.) |
| 71 | +- Deploy Harbor fundamental services in HA mode |
| 72 | +- Deploy Harbor data access layer (PostgreSQL, Redis, object store) |
| 73 | +- Deploy Harbor data access layer in HA mode |
| 74 | +- Ability to upgrade the Harbor registry version |
| 75 | +- [Day2 configurations](https://github.com/goharbor/harbor-operator/blob/master/docs/day2/day2-configurations.md), |
| 76 | + i.e. use custom resources (CR) to configure Harbor, e.g. auth mode, robot token duration, |
| 77 | + storage size per project, etc. |
| 78 | + |
| 79 | +The current list of Day2 configuration options does not contain managing (e.g. |
| 80 | +creation) of Harbor projects (tenants), but this feature and more are mentioned in the [roadmap](https://github.com/goharbor/harbor-operator/#future-features). |
| 81 | + |
| 82 | +## Open questions |
| 83 | + |
| 84 | +There are still some container registry related open questions that are currently under |
| 85 | +discussion and should be answered by the SCS community. These open questions are |
| 86 | +highly connected with this ADR. |
| 87 | + |
| 88 | +1. [Which container registry use cases are relevant for CSPs?](https://github.com/orgs/SovereignCloudStack/discussions/295) |
| 89 | + |
| 90 | + Note: The following use cases have been proposed, and it seems that all of them are |
| 91 | + relevant for CSPs: |
| 92 | + |
| 93 | +- As a CSP, I would like to offer a recipe (maintained by SCS) for my customers |
| 94 | + to deploy the private registry themselves utilizing the CSP infrastructure |
| 95 | +- As a CSP, I would like to offer the whole container registry instance as-a-service per |
| 96 | + tenant. An administrative user for the registry is then provided for the tenant so that |
| 97 | + the requester can use said user to gain admin access to the container registry instance |
| 98 | +- As a CSP, I would like to offer a dedicated container registry project |
| 99 | + as-a-service per user, i.e. a single multi-tenant capable container registry |
| 100 | + instance is shared across multiple tenants (users). The user is then |
| 101 | + an administrator of the container registry project |
| 102 | + |
| 103 | +1. [Is the shared-storage model in Harbor a limitation for CSPs?](https://github.com/orgs/SovereignCloudStack/discussions/294) |
| 104 | + |
| 105 | +## Decision |
| 106 | + |
| 107 | +As the comparison [Helm-vs-Operators](./Helm-vs-Operators.md) pointed out, |
| 108 | +the general advantage of the helm chart over the operator is that the helm chart only |
| 109 | +depends on the helm tool and does not run its own code (beyond the template files). This |
| 110 | +reduces the scope for bugs and the number of resources required to run them. |
| 111 | +The operator could be prioritized if we need to manage many instances of software or |
| 112 | +the operator allows managing operational tasks, i.e. Day2 tasks. |
| 113 | + |
| 114 | +Ergo, the final decision highly depends on use cases we want to support. |
| 115 | + |
| 116 | +In the case of use cases like: |
| 117 | + |
| 118 | +- As a CSP, I would like to offer a recipe (maintained by SCS) for my customers |
| 119 | + to deploy the private registry themselves utilizing the CSP infrastructure |
| 120 | +- As a CSP, I would like to offer a dedicated container registry project |
| 121 | + as-a-service per user, i.e. a single multi-tenant capable container registry |
| 122 | + instance is shared across multiple tenants (users). The user is then |
| 123 | + an administrator of the container registry project |
| 124 | + |
| 125 | +, the **Harbor helm chart** is a recommended option, as we can expect a few instances of |
| 126 | +Harbor. In addition, the operator does not currently support Harbor project (tenant) |
| 127 | +management via CR, and in general the helm chart is the preferable option. |
| 128 | + |
| 129 | +In the case of use cases like: |
| 130 | + |
| 131 | +- As a CSP, I would like to offer the whole container registry instance as-a-service per |
| 132 | + tenant. An administrative user for the registry is then provided for the tenant so that |
| 133 | + the requester can use said user to gain admin access to the container registry instance |
| 134 | + |
| 135 | +, the **Harbor operator** is a recommended option, as we can expect many instances of |
| 136 | +Harbor and supported Day2 operational tasks may be beneficial here. |
| 137 | + |
| 138 | +<!-- Frequently used references --> |
| 139 | + |
| 140 | +[harbor-helm]: https://github.com/goharbor/harbor-helm |
| 141 | +[harbor-operator]: https://github.com/goharbor/harbor-operator |
0 commit comments