Skip to content
This repository has been archived by the owner on Jul 30, 2021. It is now read-only.

checkpointer: ignore Affinity within podspec #1009

Merged

Conversation

rphillips
Copy link
Contributor

Kubernetes 1.12.x introduced new logic for Affinity [1]. In addition to
new logic, the Pod contains a default affinity. The new default affinity
gets serialized into the checkpoint file, and the 1.12.x kubelet does
not restore the pod due to the affinity.

This PR removes the affinity from the spec and documents that affinity's
are not supported.

"affinity": {
      "nodeAffinity": {
        "requiredDuringSchedulingIgnoredDuringExecution": {
          "nodeSelectorTerms": [
            {
              "matchExpressions": null
            }
          ]
        }
      }
    },

[1] kubernetes/kubernetes#68173
[2] https://github.com/kubernetes/kubernetes/blob/e39b510726113581c6f6a9c2db1753d794aa9cce/pkg/controller/daemon/util/daemonset_util.go#L183-L196

Kubernetes 1.12.x introduced new logic for Affinity [1]. In addition to
new logic, the Pod contains a default affinity. The new default affinity
gets serialized into the checkpoint file, and the 1.12.x kubelet does
not restore the pod due to the affinity.

This PR removes the affinity from the spec and documents that affinity's
are not supported.

```
"affinity": {
      "nodeAffinity": {
        "requiredDuringSchedulingIgnoredDuringExecution": {
          "nodeSelectorTerms": [
            {
              "matchExpressions": null
            }
          ]
        }
      }
    },

```

[1] kubernetes/kubernetes#68173
[2] https://github.com/kubernetes/kubernetes/blob/e39b510726113581c6f6a9c2db1753d794aa9cce/pkg/controller/daemon/util/daemonset_util.go#L183-L196
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Oct 12, 2018
@rphillips
Copy link
Contributor Author

@aaronlevy needs another lgtm

/cc @dghubble

@aaronlevy
Copy link
Contributor

coreosbot run e2e checkpointer

@aaronlevy
Copy link
Contributor

Because this is changing checkpointer code, the normal e2e tests are not explicitly testing the new functionality (the cluster is launched with existing checkpointer pod) https://github.com/kubernetes-incubator/bootkube/blob/master/pkg/asset/images.go#L12.

The checkpointer tests will build a new checkpointer image, then use that in the e2e tests.

@rphillips
Copy link
Contributor Author

coreosbot run e2e checkpointer

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Oct 15, 2018
@dghubble
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 15, 2018
@rphillips
Copy link
Contributor Author

coreosbot run e2e checkpointer

@k8s-ci-robot k8s-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Oct 16, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: dghubble

If they are not already assigned, you can assign the PR to them by writing /assign @dghubble in a comment when ready.

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

@rphillips rphillips force-pushed the ignore_affinity_in_checkpoint_4 branch 2 times, most recently from be13410 to a7768df Compare October 16, 2018 13:23
@rphillips
Copy link
Contributor Author

coreosbot run e2e checkpointer

* checkpointer test will have a modified asset file
@rphillips
Copy link
Contributor Author

coreosbot run e2e checkpointer

3 similar comments
@rphillips
Copy link
Contributor Author

coreosbot run e2e checkpointer

@rphillips
Copy link
Contributor Author

coreosbot run e2e checkpointer

@rphillips
Copy link
Contributor Author

coreosbot run e2e checkpointer

@rphillips
Copy link
Contributor Author

all tests are passing {bootkube-e2e-calico, bootkube-e2e-flannel, and e2e w/ checkpointer}

@rphillips
Copy link
Contributor Author

@dghubble mind lgtm again?

@dghubble
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 16, 2018
@rphillips rphillips merged commit 018007e into kubernetes-retired:master Oct 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants