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

Add 'none' option to EnforceNodeAllocatable #59515

Merged
merged 1 commit into from Feb 8, 2018

Conversation

@mtaufen
Contributor

mtaufen commented Feb 7, 2018

This lets us use omitempty on EnforceNodeAllocatable. We shouldn't treat
nil as different from []T{}, because this can play havoc with
serializers (a-la #43203).

See: #53833 (comment)

'none' can now be specified in KubeletConfiguration.EnforceNodeAllocatable (--enforce-node-allocatable) to explicitly disable enforcement.
@@ -58,12 +58,13 @@ func (cm *containerManagerImpl) createNodeAllocatableCgroups() error {
// enforceNodeAllocatableCgroups enforce Node Allocatable Cgroup settings.
func (cm *containerManagerImpl) enforceNodeAllocatableCgroups() error {
nc := cm.NodeConfig.NodeAllocatableConfig
enforce := !nc.EnforceNodeAllocatable.Has(kubetypes.NodeAllocatableNoneKey)

This comment has been minimized.

@mtaufen

mtaufen Feb 7, 2018

Contributor

Not sure this is strictly necessary, because in theory validation should require:

  • only none
  • empty
  • subset of {pods, kube-reserved, system-reserved}

But this is more explicit.

This comment has been minimized.

@liggitt

liggitt Feb 8, 2018

Member

I wouldn't change this, trust the validation preventing none + node on the way in

This comment has been minimized.

@mtaufen

mtaufen Feb 8, 2018

Contributor

updated

@mtaufen mtaufen referenced this pull request Feb 7, 2018

Merged

Graduate kubeletconfig API group to beta #53833

33 of 33 tasks complete
@dashpole

This comment has been minimized.

Contributor

dashpole commented Feb 7, 2018

@k8s-ci-robot k8s-ci-robot added lgtm size/M and removed size/S labels Feb 7, 2018

@k8s-merge-robot k8s-merge-robot removed the lgtm label Feb 8, 2018

@mtaufen

This comment has been minimized.

Contributor

mtaufen commented Feb 8, 2018

updated to satisfy the linter

@mtaufen

This comment has been minimized.

Contributor

mtaufen commented Feb 8, 2018

/test pull-kubernetes-verify

@mtaufen

This comment has been minimized.

Contributor

mtaufen commented Feb 8, 2018

/assign @dchen1107

@mtaufen

This comment has been minimized.

Contributor

mtaufen commented Feb 8, 2018

re-adding label after linter fix

@mtaufen mtaufen added the lgtm label Feb 8, 2018

@dchen1107

This comment has been minimized.

Member

dchen1107 commented Feb 8, 2018

/lgtm

default:
allErrors = append(allErrors, fmt.Errorf("Invalid option %q specified for EnforceNodeAllocatable (--enforce-node-allocatable) setting. Valid options are %q, %q or %q",
allErrors = append(allErrors, fmt.Errorf("invalid configuration: option %q specified for EnforceNodeAllocatable (--enforce-node-allocatable). Valid options are %q, %q or %q",

This comment has been minimized.

@liggitt

liggitt Feb 8, 2018

Member

need to add none to list of valid options

This comment has been minimized.

@mtaufen

mtaufen Feb 8, 2018

Contributor

thanks, done

@k8s-merge-robot k8s-merge-robot removed the lgtm label Feb 8, 2018

@mtaufen mtaufen added the lgtm label Feb 8, 2018

@mtaufen

This comment has been minimized.

Contributor

mtaufen commented Feb 8, 2018

re-adding label after error text fixup

@mtaufen mtaufen removed the lgtm label Feb 8, 2018

Add 'none' option to EnforceNodeAllocatable
This lets us use omitempty on EnforceNodeAllocatable. We shouldn't treat
`nil` as different from `[]T{}`, because this can play havoc with
serializers (a-la #43203).

See: #53833 (comment)
@liggitt

This comment has been minimized.

Member

liggitt commented Feb 8, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm label Feb 8, 2018

@k8s-ci-robot

This comment has been minimized.

Contributor

k8s-ci-robot commented Feb 8, 2018

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dashpole, dchen1107, liggitt, mtaufen

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 OWNERS Files:

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

@k8s-merge-robot

This comment has been minimized.

Contributor

k8s-merge-robot commented Feb 8, 2018

/test all [submit-queue is verifying that this PR is safe to merge]

@k8s-merge-robot

This comment has been minimized.

Contributor

k8s-merge-robot commented Feb 8, 2018

Automatic merge from submit-queue (batch tested with PRs 59054, 59515, 59577). If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-merge-robot k8s-merge-robot merged commit 6cc3641 into kubernetes:master Feb 8, 2018

4 of 13 checks passed

Submit Queue Required Github CI test is not green: pull-kubernetes-bazel-test
Details
pull-kubernetes-bazel-test Job triggered.
Details
pull-kubernetes-e2e-gce Job triggered.
Details
pull-kubernetes-e2e-gce-device-plugin-gpu Job triggered.
Details
pull-kubernetes-e2e-kops-aws Job triggered.
Details
pull-kubernetes-kubemark-e2e-gce Job triggered.
Details
pull-kubernetes-node-e2e Job triggered.
Details
pull-kubernetes-unit Job triggered.
Details
pull-kubernetes-verify Job triggered.
Details
cla/linuxfoundation mtaufen authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-cross Skipped
pull-kubernetes-e2e-gke Skipped

mtaufen added a commit to mtaufen/kubernetes that referenced this pull request Feb 9, 2018

Allow 'none' signal in eviction thresholds
This lets us use omitempty on EvictionHard.
See: kubernetes#53833 (comment)

Also did EvictionSoft for consistent behavior.

Similar to: kubernetes#59515

mtaufen added a commit to mtaufen/kubernetes that referenced this pull request Feb 9, 2018

Allow 'none' signal in eviction thresholds
This lets us use omitempty on EvictionHard.
See: kubernetes#53833 (comment)

Also did EvictionSoft for consistent behavior.

Similar to: kubernetes#59515

mtaufen added a commit to mtaufen/kubernetes that referenced this pull request Feb 9, 2018

Allow 'none' signal in eviction thresholds
This lets us use omitempty on EvictionHard.
See: kubernetes#53833 (comment)

Also did EvictionSoft for consistent behavior.

Similar to: kubernetes#59515

mtaufen added a commit to mtaufen/kubernetes that referenced this pull request Feb 9, 2018

Allow 'none' signal in eviction thresholds
This lets us use omitempty on EvictionHard.
See: kubernetes#53833 (comment)

Also did EvictionSoft for consistent behavior.

Similar to: kubernetes#59515

mtaufen added a commit to mtaufen/kubernetes that referenced this pull request Feb 10, 2018

Allow 'none' signal in eviction thresholds
This lets us use omitempty on EvictionHard.
See: kubernetes#53833 (comment)

Also did EvictionSoft for consistent behavior.

Similar to: kubernetes#59515

mtaufen added a commit to mtaufen/kubernetes that referenced this pull request Feb 10, 2018

Allow 'none' signal in eviction thresholds
This lets us use omitempty on EvictionHard.
See: kubernetes#53833 (comment)

Also did EvictionSoft for consistent behavior.

Similar to: kubernetes#59515

mtaufen added a commit to mtaufen/kubernetes that referenced this pull request Feb 10, 2018

Allow 'none' signal in eviction thresholds
This lets us use omitempty on EvictionHard.
See: kubernetes#53833 (comment)

Also did EvictionSoft for consistent behavior.

Similar to: kubernetes#59515

k8s-merge-robot added a commit that referenced this pull request Feb 15, 2018

Merge pull request #53833 from mtaufen/kubeletconfig-to-beta
Automatic merge from submit-queue (batch tested with PRs 59353, 59905, 53833). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Graduate kubeletconfig API group to beta

Regarding kubernetes/enhancements#281, this PR moves the kubeletconfig API group to beta. 

After #53088, the KubeletConfiguration type should not contain any deprecated or experimental fields, and we should not have to remove any more fields from the type before graduating it to beta. 

We need the community to double check for two things, however:
1. Are there any fields currently in the KubeletConfiguration type that you were going to mark deprecated this quarter, but haven't yet?
2. Are there any fields currently in the KubeletConfiguration type that are experimental or alpha, but were not explicitly denoted as such?

Please comment on this PR if you can answer "yes" to either of those two questions. Please cc anyone with a stake in the kubeletconfig API, so we get as much coverage as possible.

/cc @thockin @dchen1107 @Random-Liu @yujuhong @dashpole @tallclair @vishh @abw @freehan @dnardo @bowei @MrHohn @luxas @liggitt @ncdc @derekwaynecarr @mikedanese 

@kubernetes/sig-network-pr-reviews, @kubernetes/sig-node-pr-reviews 

```release-note
action required: The `kubeletconfig` API group has graduated from alpha to beta, and the name has changed to `kubelet.config.k8s.io`. Please use `kubelet.config.k8s.io/v1beta1`, as `kubeletconfig/v1alpha1` is no longer available. 
```

**TODO:**
- [x] Move experimental/non-gated-alpha/soon-to-be-deprecated fields to `KubeletFlags`
  - [x] #53088
  - [x] #54154
  - [x] #54160
  - [x] #55562
  - [x] #55983
  - [x] #57851
- [x] Lift embedded structure out of strings
  - [x] #53025
  - [x] #54643
  - [x] #54823
  - [x] #55254
- [x] Resolve relative paths against the location config files are loaded from
  - [x] #55648 
- [x] Rename to `kubelet.config.k8s.io`
- [x] Comments
  - [x] Make sure existing comments at least read sensibly.
  - [x] Note default values in comments on the versioned struct.
  - [x] Remove any reference to default values in comments on the internal struct.
- [x] Most fields should be `+optional` and `omitempty`. Add where necessary. ~Where omitted, explicitly comment.~ Edit: We should not distinguish between nil and empty, see below items.
- [x] Ensure defaults are specified via `pkg/kubelet/apis/kubelet.config.k8s.io/v1beta1/defaults.go`, not `cmd/kubelet/app/options/options.go`.
  - [x] #57770
- [x] Ensure kubeadm does not persist v1alpha1 KubeletConfiguration objects (or feature-gates this functionality)
- [x] Don't make a distinction between empty and nil, because of #43203.
  - [x] #59515
  - [x] #59681
- [x] Take the opportunity to fix insecure Kubelet defaults @tallclair 
  - [x] #59666
- [x] Remove CAdvisorPort from KubeletConfiguration wrt #56523.
  - [x] #59580
- [x] Hide `ConfigTrialDuration` until we're more sure what to do with it.
   - [x] #59628
- [x] Fix `// default: x` comments after rebasing on recent changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment