3

我将 skaffold 用于基于 k8s 的微服务应用程序。我进入skaffold devskaffold run运行并skaffold delete重新启动所有微服务。

如果我只需要重启一项服务,我该怎么办?

4

2 回答 2

1

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    
于 2020-08-18T16:23:31.800 回答
1

您可以使用skaffold dev'--watch-image标志来限制要监视的工件。这需要一个逗号分隔的图像列表,由artifact.image指定。

于 2020-08-18T16:57:13.683 回答