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

Do not use annotation for pod affinity #45318

Closed
gyliu513 opened this issue May 4, 2017 · 8 comments · Fixed by #45322
Closed

Do not use annotation for pod affinity #45318

gyliu513 opened this issue May 4, 2017 · 8 comments · Fixed by #45322
Assignees
Labels
sig/apps Categorizes an issue or PR as relevant to SIG Apps.

Comments

@gyliu513
Copy link
Contributor

gyliu513 commented May 4, 2017

Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see http://kubernetes.io/docs/troubleshooting/.):

What keywords did you search in Kubernetes issues before filing this one? (If you have found any duplicates, you should instead reply there.):


Is this a BUG REPORT or FEATURE REQUEST? (choose one):

Kubernetes version (use kubectl version):
master

Environment:

  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release):
  • Kernel (e.g. uname -a):
  • Install tools:
  • Others:

What happened:
Check https://github.com/kubernetes/kubernetes/blob/master/examples/cockroachdb/cockroachdb-statefulset.yaml#L80-L96 , it is still using scheduler.alpha.kubernetes.io/affinity, we should move it to PodSpec.

What you expected to happen:

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know:

@gyliu513
Copy link
Contributor Author

gyliu513 commented May 4, 2017

/assign

@gyliu513 gyliu513 changed the title Do not use annotation for node affinity Do not use annotation for pod affinity May 4, 2017
@grodrigues3 grodrigues3 added the sig/apps Categorizes an issue or PR as relevant to SIG Apps. label May 4, 2017
@ethernetdan
Copy link
Contributor

@gyliu513 probably will want to move the init container also to the PodSpec

@gyliu513
Copy link
Contributor Author

gyliu513 commented May 5, 2017

I think the init container still depend on annotations https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ , can I specify in PodSpec? If so, I want to file another issue to track it @ethernetdan

@xiangpengzhao
Copy link
Contributor

@gyliu513 FYI

CHANGELOG

Init containers have graduated to GA and now appear as a field. The beta annotation value will still be respected and overrides the field value. (#38382, @hodovska)

@xiangpengzhao
Copy link
Contributor

xiangpengzhao commented May 5, 2017

Seems like that the doc should be updated.
https://kubernetes.io/docs/concepts/workloads/pods/init-containers/

EDIT:

NOTE: This feature is beta in Kubernetes 1.5.
Once the feature exits beta, Init Containers will be specified in the PodSpec alongside the app containers array.

@hodovska @smarterclayton

@gyliu513
Copy link
Contributor Author

gyliu513 commented May 5, 2017

Thanks @xiaopengzhao I filed an issue here kubernetes/website#3649

@gyliu513
Copy link
Contributor Author

gyliu513 commented May 5, 2017

@ethernetdan @a-robinson What about merge this first and then handle init-container in a separate PR?

@a-robinson
Copy link
Contributor

Sounds good to me, thanks.

k8s-github-robot pushed a commit that referenced this issue May 5, 2017
Automatic merge from submit-queue (batch tested with PRs 45322, 44770, 45411)

Put podAntiAffinity in PodSpec.

**What this PR does / why we need it**:

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

In 1.6, we moved the `affinity` from `annotations` to `PodSpec`, but the `annotations` still works with `AffinityInAnnotations=true`. Please check https://docs.google.com/document/d/1YP3OJTKMpXkWAhipPjx9-bDMxJ87JZ6AcVak7c3SGos/edit for detail.

**Release note**:

```release-note
```

Fixed #45318
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/apps Categorizes an issue or PR as relevant to SIG Apps.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants