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

Deployment to stop adding pod-template-hash labels/selector on adoption #61615

Merged
merged 4 commits into from
Mar 28, 2018

Conversation

janetkuo
Copy link
Member

@janetkuo janetkuo commented Mar 23, 2018

What this PR does / why we need it: This is a blocker for #55714, because ReplicaSet selector becomes immutable in apps/v1. With controller ref, Deployment's ReplicaSets and Pods can avoid fighting with each others without unique label/selector (pod-template-hash), so it's safe to stop adding hash label/selector on adoption.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #61433

Special notes for your reviewer: This is a behavioral change to Deployment controller that will affect all versions of Deployment APIs (apps/v1, extensions/v1beta1, apps/v1beta1, apps/v1beta2).

Release note:

Deployment will stop adding pod-template-hash labels/selector to ReplicaSets and Pods it adopts. Resources created by Deployments are not affected (will still have pod-template-hash labels/selector). 

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Mar 23, 2018
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 23, 2018
@0xmichalis
Copy link
Contributor

/lgtm
/hold

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Mar 23, 2018
@0xmichalis
Copy link
Contributor

You may have to fix e2e tests

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Mar 26, 2018
@0xmichalis
Copy link
Contributor

/lgtm
/hold cancel

Are you planning on making Deployment selectors immutable in a future release?

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Mar 26, 2018
@janetkuo
Copy link
Member Author

Are you planning on making Deployment selectors immutable in a future release?

apps/v1 Deployment selectors are immutable (ref).

@0xmichalis
Copy link
Contributor

Awesome, thanks!

cc @tnozicka @mfojtik

@k8s-ci-robot k8s-ci-robot removed lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Mar 26, 2018
@janetkuo
Copy link
Member Author

Found some functions not referenced by anyone after removing addHashKeyToRSAndPods. Removing them in the last commit.

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 27, 2018
@janetkuo
Copy link
Member Author

janetkuo commented Mar 27, 2018

It seems that pkg/util/labels is ready-only:

Found pkg/util/labels/.readonly, but files changed compared to "master" branch.

So I'll leave func AddLabels there even though it's not referenced in the repo.

@janetkuo
Copy link
Member Author

Integration test failure is observed in other PRs too. Should be a flake unrelated to this PR. Filed #61748.

@janetkuo
Copy link
Member Author

/test pull-kubernetes-integration

@janetkuo
Copy link
Member Author

All green. @Kargakis PTAL

@0xmichalis
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 28, 2018
Copy link
Contributor

@tnozicka tnozicka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

we might want to have a issue tracking deprecation and removal for RSs created directly by the deployment

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: janetkuo, kargakis, tnozicka

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 61790, 61808, 60339, 61615, 61757). If you want to cherry-pick this change to another branch, please follow the instructions here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deployment is incompatible with apps/v1 ReplicaSet
6 participants