How to import existing git project into Jenkins X that has multiple micro services?

9/26/2019

I have a github repository which has multiple microservices projects. Each of these projects are in separate folders along with corresponding Dockerfile and build configurations. Each of these projects are implemented using different languages and those include Java, Go, Javascript and C#. I have one kubernates manifest file which takes care of deploying these microservices on a kubernates cluster. I use skaffold to stitch image building and deployment.

When I import this repository using jx command, the configuration files generated (Dockerfile, Jenkinsfile and skaffold.yaml) by Jenkins X is not in order and build breaks.

When I separate each project into own repository it works fine.

skaffold.yaml

  • image: service1 context: src/service1 deploy: kubectl: manifests:
    • ./kub-manifests/**.yaml

./kub-manifests/service1.yaml

apiVersion: v1
kind: Deployment
metadata:
  name: service1
spec:
  template:
    metadata:
      labels:
        app: service1
    spec:
      terminationGracePeriodSeconds: 10
      containers:
      - name: server
        image: service1
        ports:
        - containerPort: 9000
        env:
        - name: PORT
          value: "9000"
        resources:
          requests:
            cpu: 150m
            memory: 150Mi
          limits:
            cpu: 300m
            memory: 300Mi

---
apiVersion: v1
kind: Service
metadata:
  name: service1
spec:
  type: ClusterIP
  selector:
    app: service1
  ports:
  - name: grpc
    port: 9000
    targetPort: 9000

How should I import such projects into Jenkins X such that's its able to build and deploy each projects to the same cluster?

-- prasanna h
jenkins--x
kubernetes

1 Answer

9/26/2019

see this FAQ entry

you'll need to create your own custom pipeline. It'd be easier to split things up so you have 1 microservice per repository then you don't have to create a custom pipeline

-- James Strachan
Source: StackOverflow