Adding remoteManifests to the skaffold.yaml should allow you to replace an already deployed k8s resource with the locally built version.
Skaffold doesn't use the remoteManifests section in the yaml and instead just looks for the manifests in the default k8s/*.yaml location.
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
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
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!
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 devthe 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.