docker-gerrit icon indicating copy to clipboard operation
docker-gerrit copied to clipboard

Request: Kubernetes objects templates

Open novitoll opened this issue 7 years ago • 8 comments

Please add the basic YAML templates for Deployment, Service, Secrets, PersistentVolume objects in Kubernetes (>= 1.8.2) for Gerrit.

Also Gerrit + Jenkins + SonarQube integration in k8s will be brilliant. (Helm packaging is optional)

novitoll avatar Jan 11 '18 10:01 novitoll

I'm thinking of this idea, too. However, I've been struggling with the k8s environments for a while.

thinkernel avatar Jan 11 '18 10:01 thinkernel

OK, I can do it actually but later. The Deployment part might look like

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: gerrit
  labels:
    app: gerrit
spec:
  replicas: 1
  selector:
    matchLabels:
      app: gerrit
  template:
    metadata:
      labels:
        app: gerrit
    spec:
      containers:
      - name: gerrit
        image: openfrontier/gerrit:latest
        imagePullPolicy: Always
        envFrom:
          - configMapRef:
              name: env-config
          - secretRef:
              name: secrets
        ports:
        - name: gerrit-web
          containerPort:
            valueFrom:
              configMapKeyRef:
                name: value-config
                key: web_port
        - name: gerrit-ssh-agent
          containerPort:
            valueFrom:
              configMapKeyRef:
                name: value-config
                key: ssh_agent_port

novitoll avatar Jan 11 '18 11:01 novitoll

The basic deployment is just like what you wrote. Something need to be considered like the pvc, service, statefulset( or not). Also the way to map environment and secret as you wrote.

thinkernel avatar Jan 15 '18 05:01 thinkernel

@thinkernel FYI, I've managed to get Gerrit, Jenkins with DSL declarative pipelines, Sonar integrated and running as pods in Kubernetes cluster with PVCs etc, and the full CI-CD works. I will try to make this solution public as soon as I have time for it.

  • Gerrit, Sonar are using PostgreSQL pod to persist + mounted volumes are PVCs to some cloud providers, could be even hostPath if 1 node like minikube
  • Jenkins are fully automated with Groovies and gerrit-trigger as well available in DSL, pipelines

novitoll avatar Feb 15 '18 07:02 novitoll

@Novitoll I'm so glad to hear that. It'd be even better if you can share your works for others including me to reference.

thinkernel avatar Mar 07 '18 04:03 thinkernel

@Novitoll did you find time to share that ? I was about to do the same from scratch... I can contribute by adding Nexus3 for example ! Or at least rearrange raw scripts & commands.

NeVraX182 avatar Jul 26 '18 21:07 NeVraX182

Sorry, was busy with work and then vac :) I will probably commit Gerrit deployment to https://github.com/helm/charts/tree/master/stable as well

novitoll avatar Aug 03 '18 06:08 novitoll

@Novitoll any updates on this open request? Gerrit on k8s without helm

Sjnahak avatar Jun 07 '20 17:06 Sjnahak