On 13 Feb 2023, at 14:30, 'Emil Dabrowski' via Repo and Gerrit Discussion <repo-d...@googlegroups.com> wrote:Sure thing, no problem with that. The container images are on Docker hub. Helm is just a templating engine that spits out Kubernetes manifests. You'll need a Statefulset, Service and Ingress - and optionally a PersistentVolumeClaim if you don't use volumeClaimTemplates in the Statefulset.
måndag 13 februari 2023 kl. 13:18:12 UTC+1 skrev Mk:Is it possible to install gerrit(3.7.0) in kubernetes cluster (bare metal based) with NFS(Persistent Volume) using manifest files instead of Helm chart?
--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/8e4778e4-91f0-45ec-bc48-bc9be51ff52fn%40googlegroups.com.
My gerrit deployment.yml as follows,
apiVersion: apps/v1
kind: Deployment
metadata:
name: gerrit
namespace: gerrit
spec:
replicas: 1
selector:
matchLabels:
app: gerrit
template:
metadata:
labels:
app: gerrit
spec:
containers:
- name: gerrit
image: gerritcodereview/gerrit:3.7.0
ports:
- containerPort: 8080
- containerPort: 29418
volumeMounts:
- name: gerrit-data
mountPath: /var/gerrit/review_site
volumes:
- name: gerrit-data
persistentVolumeClaim:
claimName: gerrit-pvc
My gerrit pod running fine could see below log information.
[2023-02-13T14:43:16.885+05:30] [main] INFO org.eclipse.jetty.server.Server : Started @6275ms
[2023-02-13T14:43:16.887+05:30] [main] INFO com.google.gerrit.pgm.Daemon : Gerrit Code Review 3.7.0 ready
[2023-02-13T14:43:16.915+05:30] [WorkQueue-2[java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@50d5931d[Not completed, task = java.util.concurrent.Executors$RunnableAdapter@5a2df86d[Wrapped task = com.google.gerrit.server.logging.LoggingContextAwareRunnable@54ea1d58]]]] INFO com.googlesource.gerrit.plugins.deleteproject.fs.RepositoryCleanupTask : Cleaning up expired git repositories...
[2023-02-13T14:43:16.920+05:30] [WorkQueue-2[java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@50d5931d[Not completed, task = java.util.concurrent.Executors$RunnableAdapter@5a2df86d[Wrapped task = com.google.gerrit.server.logging.LoggingContextAwareRunnable@54ea1d58]]]] INFO com.googlesource.gerrit.plugins.deleteproject.fs.RepositoryCleanupTask : Cleaning up expired git repositories... Done
[2023-02-13T14:44:11.089+05:30] [plugin-manager-preloader] INFO com.googlesource.gerrit.plugins.manager.OnStartStop : 70 plugins successfully pre-loaded
Nginx ingress resource running status as follows.
$ kubectl describe ingress gerrit-ingress -n gerrit
Name: gerrit-ingress
Labels: <none>
Namespace: gerrit
Address:
Default backend: default-http-backend:80 (<error: endpoints "default-http-backend" not found>)
Rules:
Host Path Backends
---- ---- --------
gerrit.example.com
/gerrit gerrit-service:80 (10.243.3.20:8080)
Annotations: <none>
Events: <none>
When i access the gerrit URl - http://gerrit.example.com/gerrit on browser it says " Not Found" message.
$ curl http://gerrit.example.com/gerrit -v
* Trying 10.11.152.61...
* TCP_NODELAY set
* Connected to gerrit.example.com (10.11.152.61) port 80 (#0)
> GET /gerrit HTTP/1.1
> Host: gerrit.example.com
> User-Agent: curl/7.58.0
> Accept: */*
>
< HTTP/1.1 404 Not Found
< server: nginx/1.23.3
< date: Tue, 14 Feb 2023 03:52:51 GMT
< content-type: text/plain;charset=iso-8859-1
< content-length: 9
< x-frame-options: DENY
< cache-control: no-cache, no-store, max-age=0, must-revalidate
< pragma: no-cache
< expires: Mon, 01 Jan 1990 00:00:00 GMT
<
* Connection #0 to host gerrit.example.com left intact
In the gerrit pod container i can see
$ kubectl exec -it gerrit-57776b8d8-xt548 -n gerrit -- ls -lsa /var/gerrit/
total 88
8 drwxr-xr-x 1 gerrit gerrit 4096 Feb 13 16:31 .
8 drwxr-xr-x 1 root root 4096 Nov 21 18:25 ..
4 -rw------- 1 gerrit gerrit 221 Feb 13 17:38 .bash_history
8 drwxr-xr-x 1 gerrit gerrit 4096 Nov 21 18:25 .config
0 -rw-r--r-- 1 gerrit gerrit 0 Feb 13 14:43 .firstTimeRedirect
8 drwxr-xr-x 1 gerrit gerrit 4096 Nov 21 18:25 .gerritcodereview
8 drwxr-xr-x 1 gerrit gerrit 4096 Nov 21 18:25 bin
4 drwxr-xr-x 2 gerrit gerrit 4096 Feb 13 14:43 cache
4 drwxr-xr-x 1 gerrit gerrit 4096 Feb 13 14:43 data
4 drwxr-xr-x 2 gerrit gerrit 4096 Feb 13 14:43 db
4 drwxr-xr-x 3 gerrit gerrit 4096 Feb 13 14:43 etc
4 drwxr-xr-x 4 gerrit gerrit 4096 Feb 13 14:43 git
4 drwxr-xr-x 6 gerrit gerrit 4096 Feb 13 14:43 index
4 drwxr-xr-x 2 gerrit gerrit 4096 Nov 21 18:25 lib
4 drwxr-xr-x 1 gerrit gerrit 4096 Feb 13 14:43 logs
4 drwxr-xr-x 1 gerrit gerrit 4096 Feb 13 14:43 plugins
0 drwxr-sr-x 7 root nobody 152 Feb 13 14:27 review_site
4 drwxr-xr-x 2 gerrit gerrit 4096 Nov 21 18:25 static
4 drwx------ 1 gerrit gerrit 4096 Feb 13 14:43 tmp
In deployment yml file if i change the "mountPath: /var/gerrit/review_site" to "mountPath: /var/gerrit" it fails with below errors.
Thanks Emil and Luca for the information. Basically I’m trying to deploy gerrit as pod inside my cluster using yaml files, further would like to access the cluster gerrit service outside like (Users --> HAproxy(Front End --> Back End) --> Kubernetes Cluster(Nginx Ingress --> Service --> Gerrit POD)My gerrit deployment.yml as follows,
apiVersion: apps/v1
kind: Deployment
please let me the method I'm trying will work or not? If work, do let me know what is wrong with my approach and configurations?On Monday, February 13, 2023 at 10:43:19 PM UTC+5:30 Luca Milanesio wrote:On 13 Feb 2023, at 14:30, 'Emil Dabrowski' via Repo and Gerrit Discussion <repo-d...@googlegroups.com> wrote:Sure thing, no problem with that. The container images are on Docker hub. Helm is just a templating engine that spits out Kubernetes manifests. You'll need a Statefulset, Service and Ingress - and optionally a PersistentVolumeClaim if you don't use volumeClaimTemplates in the Statefulset.I guess you’ll also need to use the high-availability plugin (see [1]).
--måndag 13 februari 2023 kl. 13:18:12 UTC+1 skrev Mk:Is it possible to install gerrit(3.7.0) in kubernetes cluster (bare metal based) with NFS(Persistent Volume) using manifest files instead of Helm chart?--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/8e4778e4-91f0-45ec-bc48-bc9be51ff52fn%40googlegroups.com.
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/f66b58c9-6402-452d-a396-b468fa1d7b69n%40googlegroups.com.
>I guess you’ll also need to use the high-availability plugin@Luca: Assuming that he wants to run more than 1 replica>Why do you not use the charts provided in the k8s-gerrit repository? If you have improvements, please feel free to push those!FYI; My team looked into the k8s-gerrit repo but we didn't like it. E.g. .metadata.labels are non-conventional (instead, check the generated templates of helm create foo).
Additionally the requirement for ReadWriteMany doesn't suit us.
We've created our own chart, and hope to build an HA where each replica in the Statefulset has its own PVC.
Speaking of pushing improvements... OSS contributions are very difficult for us, especially when it comes to Gerrit, since Google requires a signed agreement between Google and our company which becomes burdensome for our little team that just wants to build good infra :-)
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/7654228c-4972-42d0-adb7-18b2d44d0647n%40googlegroups.com.
Hi @Thomas Dräbing,
> We are currently working on an operator that will supersede the helm charts
is there any public information about the operator, ETA, documentation, and so on?
We are considering the migration to k8s, but the current implementation of the Helm chart is not flexible and brings multiple problems.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/d9237aa9-7c2c-4ead-bfd7-afe9b5936370n%40googlegroups.com.
Hi Thomas,
> Could you tell me what flexibility you would like to have and which problems you see? This would also help a lot in developing the operator.
I have tried to install Gerrit to my k8s playground on AWS (EKS) and make it HA. Here I faced multiple issues.
1. Expose endpoints. We must expose Gerrit web and SSH endpoints that listen to different ports and protocols but use the same domain. Ingress configuration is a bit tricky in this case, just a plain Service resource with annotations fits better, but the Helm chart does not expect any annotations: https://gerrit.googlesource.com/k8s-gerrit/+/refs/heads/master/helm-charts/gerrit/templates/gerrit.service.yaml. So I have to maintain the service outside of the Helm chart.
2. Storage. For HA I need some RWX storage, so in this case, AWS EFS is the only option. It supports dynamic provisioning (which is not something I really like) and static provisioning. Dynamic provisioned adds a root folder name === PVC name (/pvc-74a498d6-3929-47e8-8c02-078c1ece4d78) and it adds unnecessary complexity for the disaster recovery scenario where we need to patch storage configuration manually.With static provisioning, you can specify the file system ID and access point IDs for the PV, and mount exactly the same access point to all pods. But again, it's not supported by the Helm chart, I can specify only the name and the size, but not a custom config. https://gerrit.googlesource.com/k8s-gerrit/+/refs/heads/master/helm-charts/gerrit/templates/storage.pvc.yaml#11
3. Secret and values.yaml. I can't create an external secret and mount it to the pod(s). I have to put everything into values.yaml, which makes this data not really secret.
4. HA. To be fair, it's not really a Helm issue, but still. It's not supported by default. I can set `replicas: 2` but it will not help. We have to add some additional plugins instead of just some external endpoint of Redis or Memcached. Sharing some data between pods and in-memory databases does not sound robust to me. In our case, we use spot instances for k8s workloads, so there is a chance that all pods can die at the same time. I don't want to trust in-memory storage here. The configuration of the HA plugin does not look like something that can be used in a dynamic environment like Kubernetes, so I can't use HPA or something like this to scale pods horizontally.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/2cfdae90-7800-4965-adb8-611eabea2a97n%40googlegroups.com.
Hi Dmytro,thanks for the feedback. See my comments belowOn Tue, 11 Apr 2023 at 12:16, 'Dmytro Sydorov' via Repo and Gerrit Discussion <repo-d...@googlegroups.com> wrote:Hi Thomas,
> Could you tell me what flexibility you would like to have and which problems you see? This would also help a lot in developing the operator.
I have tried to install Gerrit to my k8s playground on AWS (EKS) and make it HA. Here I faced multiple issues.
1. Expose endpoints. We must expose Gerrit web and SSH endpoints that listen to different ports and protocols but use the same domain. Ingress configuration is a bit tricky in this case, just a plain Service resource with annotations fits better, but the Helm chart does not expect any annotations: https://gerrit.googlesource.com/k8s-gerrit/+/refs/heads/master/helm-charts/gerrit/templates/gerrit.service.yaml. So I have to maintain the service outside of the Helm chart.Using an ingress with SSH is indeed tricky. We decided to use istio for that and other reasons (only implemented for the gerrit-replica chart for now). If annotations in the service would already help you, this would only be a small addition to the helm chart. Let me add that for you.