Skaffold: Skaffold remoteManifests doesn't work as documented

Created on 21 May 2019  路  3Comments  路  Source: GoogleContainerTools/skaffold

Expected behavior

Adding remoteManifests to the skaffold.yaml should allow you to replace an already deployed k8s resource with the locally built version.

Actual behavior

Skaffold doesn't use the remoteManifests section in the yaml and instead just looks for the manifests in the default k8s/*.yaml location.

Information

This feature would be critical for us to start using skaffold. We currently keep all of our kubernetes manifests in a central repo with custom code to help deploy to our different environements. As such, for development, our developers already have the resources deployed in the cluster and we just want to update that.

On slack it was pointed out that this code was removed in this PR: https://github.com/GoogleContainerTools/skaffold/pull/1451

  • Skaffold version: v0.29.0
  • Operating system: MacOS
  • Contents of skaffold.yaml:
apiVersion: skaffold/v1beta11
kind: Config
build:
  artifacts:
  - image: docker.joltup.com/jolt/api
    docker:
      dockerfile: Dockerfile-local
    sync:
      manual:
        - src: 'src/**/*.js'
          dest: .
deploy:
  kubectl:
    remoteManifests:
    - default:deployment/api-server

Steps to reproduce the behavior

  1. Deploy your application to a Kubernetes cluster
  2. Use a skaffold yaml similar to above that uses remoteManifests instead of manifests
  3. Skaffold won't be able to use the pre-existing deployment
aredeploy deplokubectl help wanted kinbug prioritp1

Most helpful comment

We fixed this up and also updated the semantics of how the Delete function works on RemoteManifests to ensure it works correctly. Previously, after cancelling skaffold dev the image of the deployment would be left with the latest deployed tag, which then caused the next run of skaffold dev to no longer match that image, since the tags were off.

We made the initial run of KubeDeploy.Apply save the existing images with their tags, and then the Cleanup method references those images and reverts the deployments.

I'll clean up the code a bit and submit a PR.

All 3 comments

Hi, thank you for opening this, this does look like a bug.

We fixed this up and also updated the semantics of how the Delete function works on RemoteManifests to ensure it works correctly. Previously, after cancelling skaffold dev the image of the deployment would be left with the latest deployed tag, which then caused the next run of skaffold dev to no longer match that image, since the tags were off.

We made the initial run of KubeDeploy.Apply save the existing images with their tags, and then the Cleanup method references those images and reverts the deployments.

I'll clean up the code a bit and submit a PR.

I'm going to close this since I believe it was fixed through https://github.com/tanner-bruce/skaffold/commit/467c496855dcad06a3041846c78a2904b7285e9e. if anyone is still seeing this issue please feel free to reopen!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stanislav-zaprudskiy picture stanislav-zaprudskiy  路  4Comments

garvincasimir picture garvincasimir  路  4Comments

abatilo picture abatilo  路  4Comments

yurchenkosv picture yurchenkosv  路  3Comments

heroic picture heroic  路  4Comments