kubectl apply doesn't update nodeSelector

Created on 11 Aug 2018  路  11Comments  路  Source: kubernetes/kubectl

BUG REPORT

Kubernetes version:
Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.2", GitCommit:"bb9ffb1654d4a729bb4cec18ff088eacc153c239", GitTreeState:"clean", BuildDate:"2018-08-07T23:17:28Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.1", GitCommit:"b1b29978270dc22fecc592ac55d903350454310a", GitTreeState:"clean", BuildDate:"2018-07-17T18:43:26Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}

Environment:

  • Hardware configuration: bare metal x86_64
  • OS: Ubuntu 16.04.5 LTS
  • Kernel: 4.4.0-131-generic
  • Install tools: Rancher 2.0

What happened:
When I apply a modified YAML file for an existing Deployment, all changes are received by the cluster except nodeSelector.

What you expected to happen:
nodeSelector should be updated.

How to reproduce it:

  1. Write a deployment file with some node selector in the pod spec template
  2. Apply the deployment: kubectl apply -f path/to/file.yaml (should create the deployment)
  3. Modify the nodeSelector (eg. add new entry) and another parameter (eg. Replicas)
  4. Again apply the deployment: kubectl apply -f path/to/file.yaml
  5. Observe that other changes are reflected, but nodeSelector stays unchanged
arekubectl kinbug prioritP2 sicli

Most helpful comment

Hey, we've been observing this on GKE, with 1.13.7-gke.8 for master/nodes and v1.13.7 kubectl. I added a nodeSelector, which got applied, but then removed it from the YAML later on and any future kubectl apply operations (that could successfully change other things) didn't touch nodeSelector.

All 11 comments

/kind bug
/sig cli
/area kubectl
/priority P2

I think it's fixed in 1.12 or it was just a glitch, as now I'm unable to reproduce it.

Current version:
Client Version: version.Info{Major:"1", Minor:"12+", GitVersion:"v1.12.0-rc.1", GitCommit:"3e4aee86dfaf933f03e052859c0a1f52704d4fef", GitTreeState:"clean", BuildDate:"2018-09-18T21:08:06Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.2", GitCommit:"bb9ffb1654d4a729bb4cec18ff088eacc153c239", GitTreeState:"clean", BuildDate:"2018-08-07T23:08:19Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

/remove-lifecycle rotten

If we're not able to reproduce this in current versions of kubectl, we'll close this.

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

/remove-lifecycle stale

@seans3
I think @adampl is correct in his earlier statement. I tested just now and could not reproduce.

Tried a few scenerios including:

  1. without and then with nodeSelector
  2. changing nodeSelector

I think we can close.

@pswica Thanks for the help--closing.

/close

@seans3: Closing this issue.

In response to this:

@pswica Thanks for the help--closing.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Hey, we've been observing this on GKE, with 1.13.7-gke.8 for master/nodes and v1.13.7 kubectl. I added a nodeSelector, which got applied, but then removed it from the YAML later on and any future kubectl apply operations (that could successfully change other things) didn't touch nodeSelector.

Was this page helpful?
0 / 5 - 0 ratings