3

I have a use case where I build the image once using Github Actions to Github container repository. I would then like to use Skaffold to deploy that image already built to multiple Kubernetes clusters. The build and deploy need to be separate so we don't use Skaffold to build but to only to deploy.


apiVersion: skaffold/v2beta4
kind: Config
metadata:
  name: svc-one
build:
  local:
    push: true
    useDockerCLI: true
  artifacts:
    - image: registry.digitalocean.com/xyz/svc-one
      docker:
        dockerfile: Dockerfile <-- instead of this use existing built image from github

deploy:
  kubectl:
    manifests:
      - k8s/deployment.yaml
Saul Frank
  • 395
  • 5
  • 15

2 Answers2

0

You don't need a build section in your skaffold.yaml if you don't want to build. Just update the image in that manifest.

user140547
  • 7,750
  • 3
  • 28
  • 80
0

Since I can't comment and just to clarify what user140547 is saying. In your skaffold.yaml file it now looks like this

apiVersion: skaffold/v2beta4
kind: Config
metadata:
  name: svc-one

deploy:
  kubectl:
    manifests:
      - k8s/deployment.yaml

Then in your deployment.yaml file you just have to include the image name

spec:
    spec:
      containers:
        - image: (yourImageNamefromGitHubOrWherever)
Stephen
  • 51
  • 6