Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I restart only one service by using skaffold?

I use skaffold for k8s based microservices app. I enter skaffold dev and skaffold run to run and skaffold delete to restart all microservices.

If I need to restart only one service, what must I do?

like image 403
Yasin Okumuş Avatar asked Sep 19 '25 22:09

Yasin Okumuş


2 Answers

According to the docs:

  • Use skaffold dev to build and deploy your app every time your code changes,
  • Use skaffold run to build and deploy your app once, similar to a CI/CD pipeline

1. Deploy your services:

    skaffold run --filename=skaffold_test_1.yaml

(in addition you can have multiple workflow configurations).

2. Change your skaffold workflow configuration and run:

skaffold delete --filename=skaffold_test2.yaml

Using this approach your deployments will be not removed like in the skaffold dev command after stopping skaffold.

Basically managing the content of the skaffold workflow configuration (by adding or removing additional entries allows you to deploy or remove particular service).

apiVersion: skaffold/v1
kind: Config
.
.
.

deploy:
  kubectl:
    manifests:
    - k8s-service1.yaml
#   - k8s-service2.yaml    
like image 193
Mark Avatar answered Sep 22 '25 07:09

Mark


You can use skaffold dev's --watch-image flag to restrict the artifacts to monitor. This takes a comma-separated list of images, specified by the artifact.image.

like image 26
Brian de Alwis Avatar answered Sep 22 '25 09:09

Brian de Alwis