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?
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
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.