Skaffold: How deploy with multi repositories of the microservices

Created on 11 Jul 2019  ยท  10Comments  ยท  Source: GoogleContainerTools/skaffold

I have 20 repositories of the one business product.
Each microservice is in a separate repository.
What is the right approach to deploying in such an infrastructure using scaffold?

aredeploy aremodules kinfeature-request prioritp1

Most helpful comment

@LeoDupont unfortunately yes, and I agree that this approach is less than satisfactory.

just wanted to give an update from the team here: we're actively working on a design to support grouping artifacts into "modules", and allowing parent skaffold.yaml configuration to make references to these modules. there are several use cases we're trying to support, and multiple microservices in separate repositories is one of them. we'll be sure and share our design when it's ready to get feedback from you all.

All 10 comments

one way you could do this is by cloning the repositories locally under a single parent directory, and then placing your skaffold.yaml in the top level of the parent directory. your skaffold.yaml can have an artifact per microservice, and the artifact workspace can point to the subdirectory containing the cloned repository corresponding to that microservice.

the directory structure can look something like

โ”œโ”€โ”€ skaffold.yaml
โ”œโ”€โ”€ repo_1
|   โ”œโ”€โ”€ service_1.go
โ”‚ย ย  โ””โ”€โ”€ k8s-service1.yaml
โ”œโ”€โ”€ repo_2
|   โ”œโ”€โ”€ service_2.go
โ”‚ย ย  โ””โ”€โ”€ k8s-service2.yaml
โ”œโ”€โ”€ repo_3
|   โ”œโ”€โ”€ service_3.go
โ”‚ย ย  โ””โ”€โ”€ k8s-service3.yaml

and your skaffold.yaml:

apiVersion: skaffold/v1beta12
kind: Config
build:
  artifacts:
    - image: gcr.io/project/service-1
      context: ./repo_1/
    - image: quay.io/service-2
      context: ./repo_2/
    - image: localhost:12345/service-3
      context: ./repo_3/
deploy:
  kubectl:
    manifests:
      - ./repo_1/k8s-*
      - ./repo_2/k8s-*
      - ./repo_3/k8s-*

then just run skaffold dev from the top level. hope this helps!

Hi @sergeytkachenko - I wonder if @nkubala's answer worked for you or not?

@balopat @nkubala
Thank you for answer.

@nkubala But this means we have to clone the repo which contains the skaffold.yaml file elsewhere and then copy and paste it in this handmade directory structure?

@balopat - this question seems answered. Is there something else to do?

@LeoDupont unfortunately yes, and I agree that this approach is less than satisfactory.

just wanted to give an update from the team here: we're actively working on a design to support grouping artifacts into "modules", and allowing parent skaffold.yaml configuration to make references to these modules. there are several use cases we're trying to support, and multiple microservices in separate repositories is one of them. we'll be sure and share our design when it's ready to get feedback from you all.

@nkubala That sounds great, anywhere I can find a spec draft? ๐Ÿš€

We're still iterating over the draft, and hope to have something soon.

@HofmannZ here's the design doc: http://tinyurl.com/skaffold-modules, all comments are welcome!

Interested on this topic

Was this page helpful?
0 / 5 - 0 ratings

Related issues

heroic picture heroic  ยท  4Comments

kdevu picture kdevu  ยท  3Comments

gbird3 picture gbird3  ยท  3Comments

nathkn picture nathkn  ยท  3Comments

woodcockjosh picture woodcockjosh  ยท  4Comments