GerritCodeReview / k8s-gerrit

Kubernetes support for Gerrit Code Review
Other
27 stars 23 forks source link

no GUI #2

Closed MrAmbiG closed 3 years ago

MrAmbiG commented 4 years ago
storageClasses:
  default:
    name: rook-cephfs
    create: false
    reclaimPolicy: Retain
  shared:
    name: rook-cephfs
    create: false
    reclaimPolicy: Retain

gitRepositoryStorage:
  size: 5Ti

gitGC:
  logging:
    persistence:
      enabled: false

gitBackend:
  ingress:
    enabled: true
    host: gerrit.example.com

The above is the values.yaml. I am trying to do a minimal gerrit replica deployment which will mirror the existing gerrit deployed on a physical machine.

NAME                                                       READY   STATUS      RESTARTS   AGE
gerritreplica-gerrit-replica-deployment-8444959f99-hjk6k   0/1     Running     4          8m42s
gerritreplica-git-backend-deployment-54f6c859bc-zsfng      1/1     Running     0          8m42s
gerritreplica-git-repositories-init-h2wkz                  0/1     Completed   0          8m42s

What am I missing? If i go to http://gerrit.example.com it just 'It Works'. The ip address of the loadbalancer is added in DNS. Also there should be a way to specify the loadbalancer IP in the values yaml file which is currently missing. Can someone share a working values.yaml for replica. I have a ceph filesystem default storageclass and working. logs of gerritreplica-gerrit-replica-deployment-8444959f99-hjk6k end saying

[2020-08-14 15:03:37,388] [main] INFO  com.google.gerrit.server.plugins.PluginLoader : Removing stale plugin file: plugin_singleusergroup_200814_1501_3153442315185764864.jar
[2020-08-14 15:03:37,388] [main] INFO  com.google.gerrit.server.plugins.PluginLoader : Removing stale plugin file: plugin_healthcheck_200814_1501_6649086084033408704.jar
[2020-08-14 15:03:37,389] [main] INFO  com.google.gerrit.server.plugins.PluginLoader : Loading plugins from /var/gerrit/plugins
[2020-08-14 15:03:37,790] [main] INFO  com.google.gerrit.server.plugins.PluginLoader : Loaded plugin healthcheck, version v3.0-18-g68477e36b7
[2020-08-14 15:03:37,964] [main] INFO  com.google.gerrit.server.plugins.PluginLoader : Loaded plugin singleusergroup, version v3.1.7
[2020-08-14 15:03:38,967] [main] INFO  com.google.gerrit.server.group.PeriodicGroupIndexer : Run group indexer, 2 groups reindexed
[2020-08-14 15:03:38,967] [main] INFO  com.google.gerrit.server.config.ScheduleConfig : No schedule configuration for "index.scheduledIndexer".
[2020-08-14 15:03:39,086] [main] INFO  com.google.gerrit.sshd.SshDaemon : Started Gerrit APACHE-SSHD-2.3.0 on *:29418
[2020-08-14 15:03:39,091] [main] INFO  org.eclipse.jetty.server.Server : jetty-9.4.27.v20200227; built: 2020-02-27T18:37:21.340Z; git: a304fd9f351f337e7c0e2a7c28878dd536149c6c; jvm 1.8.0_242-b08
[2020-08-14 15:03:39,196] [main] INFO  org.eclipse.jetty.server.session : DefaultSessionIdManager workerName=node0
[2020-08-14 15:03:39,196] [main] INFO  org.eclipse.jetty.server.session : No SessionScavenger set, using defaults
[2020-08-14 15:03:39,259] [main] INFO  org.eclipse.jetty.server.session : node0 Scavenging every 600000ms
[2020-08-14 15:03:39,383] [main] INFO  org.eclipse.jetty.server.handler.ContextHandler : Started o.e.j.s.ServletContextHandler@311a09b2{/,null,AVAILABLE}
[2020-08-14 15:03:39,460] [main] INFO  org.eclipse.jetty.server.AbstractConnector : Started ServerConnector@1805ec96{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
[2020-08-14 15:03:39,462] [main] INFO  org.eclipse.jetty.server.Server : Started @24442ms
[2020-08-14 15:03:39,463] [main] INFO  com.google.gerrit.pgm.Daemon : Gerrit Code Review [replica] 3.1.7 ready

My ingress.yaml file looks like this

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: nginx
  name: gerrit
  namespace: gerrit
spec:
  rules:
    - host: gerrit.example.com
      http:
        paths:
          - backend:
              serviceName: gerritreplica-git-backend-service
              # serviceName: gerritreplica-gerrit-replica-service
              servicePort: 80
            path: /

I tried pointing my nginx ingress to both the service (one at a time) but no go. I get 503 Service Temporarily Unavailable. in DNS gerrit.example.com is pointing to the ip of nginx ingress controller. An ingress pointing to either of the 2 gerrit services is not working. I even tried the built in nginx first and it only says 'It works' when I go to the loadbalancer ip of gerritreplica-git-backend-service.

thomasdraebing commented 4 years ago

The Gerrit replica does not expose a GUI or Rest API. Gerrit replicas are meant to only serve git fetches and clones, providing the same permissions as the primary Gerrit.

The webpage you opened also seems to be the endpoint of the apache-git-http-backend, which is the component that takes care of receiving the replication pushes from the primary Gerrit. It provides two routes /git, which should be the route for receiving the replication pushes, and /new to initially create the repositories.

Looking at your kubectl get pods output, I can see that the Gerrit replica pod itself seems not to start successfully (not ready and 4 restarts). Since the logs say, that Gerrit has started, this might be an issue with the readiness/liveness probes. Do you see a message stating so in the kubectl describe output of the pod?

Ceph should do fine as a filesystem. Since the pods started the containers, the volumes were bound correctly.

I agree that setting the IP in the values.yaml would be useful. Would you be open to implement the change and push it for review on Gerrit https://gerrit-review.googlesource.com/admin/repos/k8s-gerrit ? You contribution would be very welcome.

As a side note, this project is developed on Gerrit (https://gerrit-review.googlesource.com). This repository on GitHub is just a mirror. Also the Gerrit mailing list would be a better place to ask questions: https://groups.google.com/g/repo-discuss.