Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skaffold deploy should not automatically re-create resources #1484

Closed
mxey opened this issue Jan 18, 2019 · 3 comments · Fixed by #1568
Closed

skaffold deploy should not automatically re-create resources #1484

mxey opened this issue Jan 18, 2019 · 3 comments · Fixed by #1568

Comments

@mxey
Copy link

mxey commented Jan 18, 2019

Expected behavior

skaffold deploy when encountering an immutable field should fail with an error.
(skaffold dev can continue to automatically re-create)

Actual behavior

skaffold deploy deletes and recreates the resource automatically, because it always uses kubectl apply --force. This leads to downtime of workloads.

Information

  • Skaffold version: v0.20.0
  • Operating system: macOS 10.14.2 (18C54)
  • Contents of skaffold.yaml:
apiVersion: skaffold/v1beta2
kind: Config
deploy:
  kubectl:
    manifests:
      - deployment.yaml
  • Contents of deployment.yaml:
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: nginx
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
        - name: nginx
          image: nginx:1.7.9
          ports:
            - containerPort: 80

Steps to reproduce the behavior

  1. skaffold deploy
  2. Change app: nginx in deployment.yaml to app: nginx2 (the selectors for Deployment are immutable)
  3. skaffold deploy
@dgageot dgageot added kind/bug Something isn't working area/deploy labels Jan 21, 2019
@corneliusweig
Copy link
Contributor

IMHO this should best be solved by a new flag to run/deploy, because some will want to force a successful deployment, even if it means to re-create some resources. For example, one could add a flag force-deployment with the following defaults for skaffold sub-commands:

command force-deployment default hidden
dev true true
run false false
deploy false false

@balopat balopat added kind/feature-request good first issue Good for newcomers and removed kind/bug Something isn't working labels Jan 29, 2019
@balopat
Copy link
Contributor

balopat commented Jan 29, 2019

Hi, thanks for opening this issue!
I'm okay with a new flag, say --force.
PR's are welcome ;)

@corneliusweig
Copy link
Contributor

I'll look into this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants