| Giorgi Lekveishvili | 4ec4c02 | 2024-08-17 15:09:24 +0400 | [diff] [blame] | 1 | # Roadmap |
| 2 | |
| 3 | ## General |
| 4 | |
| 5 | ### Planned features |
| 6 | |
| 7 | - **Automated verification process**: Run tests automatically to verify changes. \ |
| 8 | \ |
| 9 | Most tests in the project require a Kubernetes cluster and some additional |
| 10 | prerequisites, e.g. istio. Currently, the Gerrit OpenSOurce community does not |
| 11 | have these resources. At SAP, we plan to run verification in our internal systems, |
| 12 | which won't be publicly viewable, but could already vote. Builds would only |
| 13 | be triggered, if a maintainer votes `+1` on the `Build-Approved`-label. \ |
| 14 | \ |
| 15 | Builds can be moved to a public CI at a later point in time. |
| 16 | |
| 17 | - **Automated publishing of container images**: Publishing container images will |
| 18 | happen automatically on ref-updated using a CI. |
| 19 | |
| 20 | - **Support for multiple Gerrit versions**: All currently supported Gerrit versions |
| 21 | will also be supported in k8s-gerrit. \ |
| 22 | \ |
| 23 | Currently, container images used by this project are only published for a single |
| 24 | Gerrit version, which is updated on an irregular schedule. Introducing stable |
| 25 | branches for each gerrit version will allow to maintain container images for |
| 26 | multiple Gerrit versions. Gerrit binaries will be updated with each official |
| 27 | release and more frequently on `master`. This will be (at least partially) |
| 28 | automated. |
| 29 | |
| 30 | - **Integration test suite**: A test suite that can be used to test a GerritCluster. \ |
| 31 | \ |
| 32 | A GerritCluster running in a Kubernetes cluster consists of multiple components. |
| 33 | Having a suite of automated tests would greatly help to verify deployments in |
| 34 | development landscapes before going productive. |
| 35 | |
| 36 | ## Gerrit Operator |
| 37 | |
| 38 | ### Version 1.0 |
| 39 | |
| 40 | #### Implemented features |
| 41 | |
| 42 | - **High-availability**: Primary Gerrit StatefulSets will have limited support for |
| 43 | horizontal scaling. \ |
| 44 | \ |
| 45 | Scaling has been enabled using the [high-availability plugin](https://gerrit.googlesource.com/plugins/high-availability/). |
| 46 | Primary Gerrits will run in Active/Active configuration. Currently, two primary |
| 47 | Gerrit instances, i.e. 2 pods in a StatefulSet, are supported |
| 48 | |
| 49 | - **Global RefDB support**: Global RefDB is required for Active/Active configurations |
| 50 | of multiple primary Gerrits. \ |
| 51 | \ |
| 52 | The [Global RefDB](https://gerrit.googlesource.com/modules/global-refdb) support |
| 53 | is required for high-availability as described in the previous point. The |
| 54 | Gerrit Operator automatically sets up Gerrit to use a Global RefDB |
| 55 | implementation. The following implementations are supported: |
| 56 | - [spanner-refdb](https://gerrit.googlesource.com/plugins/spanner-refdb) |
| 57 | - [zookeeper-refdb](https://gerrit.googlesource.com/plugins/zookeeper-refdb) |
| 58 | |
| 59 | \ |
| 60 | The Gerrit Operator does not set up the database used for the Global RefDB. It |
| 61 | does however manage plugin/module installation and configuration in Gerrit. |
| 62 | |
| 63 | - **Full support for Nginx**: The integration of Ingresses managed by the Nginx |
| 64 | ingress controller now supports automated routing. \ |
| 65 | \ |
| 66 | Instead of requiring users to use different subdomains for the different Gerrit |
| 67 | deployments in the GerritCluster, requests are now automatically routed to the |
| 68 | respective deployments. SSH has still to be set up manually, since this requires |
| 69 | setting up the routing in the Nginx ingress controller itself. |
| 70 | |
| 71 | #### Planned features |
| 72 | |
| 73 | - **Versioning of CRDs**: Provide migration paths between API changes in CRDs. \ |
| 74 | \ |
| 75 | At the moment updates to the CRD are done without providing a migration path. |
| 76 | This means a complete reinstallation of CRDS, Operator, CRs and dependent resources |
| 77 | is required. This is not acceptable in a productive environment. Thus, |
| 78 | the operator will always support the last two versions of each CRD, if applicable, |
| 79 | and provide a migration path between those versions. |
| 80 | |
| 81 | - **Log collection**: Support addition of sidecar running a log collection agent |
| 82 | to send logs of all components to some logging stack. \ |
| 83 | \ |
| 84 | Planned supported log collectors: |
| 85 | - [OpenTelemetry agent](https://opentelemetry.io/docs/collector/deployment/agent/) |
| 86 | - Option to add a custom sidecar |
| 87 | |
| 88 | - **Support for additional Ingress controllers**: Add support for setting up routing |
| 89 | configurations for additional Ingress controllers \ |
| 90 | \ |
| 91 | Additional ingress controllers might include: |
| 92 | - [Ambassador](https://www.getambassador.io/products/edge-stack/api-gateway) |
| 93 | |
| 94 | ### Version 1.x |
| 95 | |
| 96 | #### Potential features |
| 97 | |
| 98 | - **Support for additional log collection agents**: \ |
| 99 | \ |
| 100 | Additional log collection agents might include: |
| 101 | - fluentbit |
| 102 | - Option to add a custom sidecar |
| 103 | |
| 104 | - **Additional ValidationWebhooks**: Proactively avoid unsupported configurations. \ |
| 105 | \ |
| 106 | ValidationWebhooks are already used to avoid accepting unsupported configurations, |
| 107 | e.g. deploying more than one primary Gerrit CustomResource per GerritCluster. |
| 108 | So far not all such cases are covered. Thus, the set of validations will be |
| 109 | further expanded. |
| 110 | |
| 111 | - **Better test coverage**: More tests are required to find bugs earlier. |
| 112 | |
| 113 | - **Automated reload of plugins**: Reload plugins on configuration change. \ |
| 114 | \ |
| 115 | Configuration changes in plugins typically don't require a restart of Gerrit, |
| 116 | but just to reload the plugin. To avoid unnecessary downtime of pods, the |
| 117 | Gerrit Operator will only reload affected plugins and not restart all pods, if |
| 118 | only the plugin's configuration changed. |
| 119 | |
| 120 | - **Externalized (re-)indexing**: Alleviate load caused by online reindexing. \ |
| 121 | \ |
| 122 | On large Gerrit sites online reindexing due to schema migrations `a)` or initialization `b)` |
| 123 | of a new site might take up to weeks and use a lot of resources, which might |
| 124 | cause performance issues. This is not acceptable in production. The current |
| 125 | plan to solve this issue is to implement a separate Gerrit deployment (GerritIndexer) |
| 126 | that is not exposed to clients and that takes over the task of online reindexing. |
| 127 | The GerritIndexer will mount the same repositories and will share events via |
| 128 | the high-availability plugin. However, it will access repositories in read-only |
| 129 | mode. \ |
| 130 | This solves the above named scenarios as follows: \ |
| 131 | \ |
| 132 | a) **Schema migrations**: If a Gerrit update including a schema migration for |
| 133 | an index is applied, the Gerrit instances serving clients will be configured |
| 134 | to continue to use the old schema. Online reindexing will be disabled in |
| 135 | those instances. The GerritIndexer will have online reindexing enabled and |
| 136 | will start to build the new index version. As soon as it is finished, i.e. |
| 137 | it could start to use the new index version as read index, it will make a |
| 138 | copy of the new index and publish it, e.g. using a shared filesystem. A |
| 139 | restart of the Gerrit instances serving other clients will be triggered. |
| 140 | During this restart the new index will be copied into the site. Since there |
| 141 | may have been updated index entries since the new index version was published |
| 142 | indexing of entries updated in the meantime will be triggered. \ |
| 143 | \ |
| 144 | b) **Initialization of a new site**: If Gerrit is horizontally scaled, it will |
| 145 | be started with an empty index, i.e. it has to build the complete index. To |
| 146 | avoid this, the GerritIndexer deployment will continuously keep a copy of the |
| 147 | indexes up-to-date. It will regularly be stopped and a copy of the index will |
| 148 | be stored in a shared volume. This can be used as a base for new instances, which |
| 149 | then only have to update index entries that were changed in the meantime. |
| 150 | |
| 151 | - **Autoscaling**: Automatically scale Gerrit deployments based on usage. \ |
| 152 | \ |
| 153 | Metrics like available workers in the thread pools could be used to decide to |
| 154 | scale the Gerrit deployment horizontally. This would allow to dynamically adapt |
| 155 | to the current load. This helps to save costs and resources. |
| 156 | |
| 157 | ### Version 2.0 |
| 158 | |
| 159 | #### Potential features |
| 160 | |
| 161 | - **Multi region support**: Support setups that are distributed over multiple regions. \ |
| 162 | \ |
| 163 | Supporting Gerrit installations that are distributed over multiple regions would |
| 164 | allow to serve clients all over the world without large differences in latency |
| 165 | and would also improve availability and reduce the risks of data loss. \ |
| 166 | Such a setup could be achieved by using the [multi-site setup](https://gerrit.googlesource.com/plugins/multi-site/). |
| 167 | |
| 168 | - **Remove the dependency on shared storage**: Use completely independent sites |
| 169 | instead of sharing a filesystem for some site components. \ |
| 170 | \ |
| 171 | NFS and other shared filesystems potentially might cause performance issues on |
| 172 | larger Gerrit installations due to latencies. A potential solution might be |
| 173 | to use the [multi-site setup](https://gerrit.googlesource.com/plugins/multi-site/) |
| 174 | to separate the sites of all instances and to use events and replication to |
| 175 | share the state |
| 176 | |
| 177 | - **Shared index**: Using an external centralized index, e.g. OpenSearch instead |
| 178 | of x copies of a Lucene index. \ |
| 179 | \ |
| 180 | Maintaining x copies of an index, where x is the number of Gerrit instances in |
| 181 | a gerritCluster, is unnecessarily expensive, since the same write transactions |
| 182 | have to be potentially done x times. Using a single centralized index would |
| 183 | resolve this issue. |
| 184 | |
| 185 | - **Shared cache**: Using an external centralized cache for all Gerrit instances. \ |
| 186 | \ |
| 187 | Using a single cache for all Gerrit instances will reduce the number of |
| 188 | computations for each Gerrit instance, since not every instance will have to |
| 189 | keep its own copy up-to-date. |
| 190 | |
| 191 | - **Sharding**: Shard a site based on repositories. \ |
| 192 | \ |
| 193 | Repositories served by a single GerritCluster might be quite diverse, e.g. ranging |
| 194 | from a few kilobytes to several gigabytes or repositories seeing high traffic |
| 195 | and other barely being fetched. It is not trivial to configure Gerrit to work |
| 196 | optimally for all repositories. Being able to shard at least the Gerrit Replicas |
| 197 | would help to optimally serve all repositories. |
| 198 | |
| 199 | ## Helm charts |
| 200 | |
| 201 | Only limited support is planned for the `gerrit` and `gerrit-replica` helm-charts |
| 202 | as soon as the Gerrit Operator reaches version 1.0. The reason is that the double |
| 203 | maintenance of all features would not be feasible with the current number of |
| 204 | contributors. The Gerrit Operator will support all features that are provided by |
| 205 | the helm charts. If community members would like to adopt maintainership of the |
| 206 | helm-charts, this would be very much appreciated and the helm-charts could then |
| 207 | continued to be supported. |