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

Provide a way to setup the limit NO files for rkt Pods #47700

Conversation

JulienBalestra
Copy link
Contributor

@JulienBalestra JulienBalestra commented Jun 17, 2017

What this PR does / why we need it:

This PR allows to customize the Systemd unit files for rkt pods.
We start with the systemd-unit-option.rkt.kubernetes.io/LimitNOFILE to allows to run workloads like etcd, ES in kubernetes with rkt.

Special notes for your reviewer:

Once again, I followed @yifan-gu guidelines.
I made a basic check over the values given inside the systemd-unit-option.rkt.kubernetes.io/LimitNOFILE (integer and > 0).
If this check fails: I simply ignore the field.
The other implementation would be to fail the whole SetUpPod.

We discussed using a key like rkt.kubernetes.io/systemd-unit-option/LimitNOFILE but the validation only allows a single / in this field:
The Deployment "tiller" is invalid: spec.template.annotations: Invalid value: "rkt.kubernetes.io/systemd-unit-option/LimitNOFILE": a qualified name must consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]') with an optional DNS subdomain prefix and '/' (e.g. 'example.com/MyName')

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 17, 2017
@k8s-ci-robot
Copy link
Contributor

Hi @JulienBalestra. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with @k8s-bot ok to test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

I understand the commands that are listed here.

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. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 17, 2017
@k8s-github-robot k8s-github-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. release-note-none Denotes a PR that doesn't merit a release note. labels Jun 17, 2017
@JulienBalestra JulienBalestra force-pushed the rkt-systemd-unit-limitnofile branch from f12abc6 to d802aa9 Compare June 17, 2017 15:17
@@ -1148,6 +1150,24 @@ func constructSyslogIdentifier(generateName string, podName string) string {
return podName
}

// Setup additional systemd field specified in the Pod Annotation
func setupSystemdCustomFields(annotations map[string]string, unitOptionArray *[]*unit.UnitOption) error {

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: why the empty line here?

@@ -2075,3 +2076,54 @@ func TestGetPodSystemdServiceFiles(t *testing.T) {
}
}
}

func TestSetupSystemdCustomFields(t *testing.T) {

Copy link
Contributor

Choose a reason for hiding this comment

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

ditto.

@@ -1148,6 +1150,24 @@ func constructSyslogIdentifier(generateName string, podName string) string {
return podName
}

// Setup additional systemd field specified in the Pod Annotation
func setupSystemdCustomFields(annotations map[string]string, unitOptionArray *[]*unit.UnitOption) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: maybe return ([]unit.UnitOption, error) rather than manipulating the pointers which is a less common style.

@JulienBalestra JulienBalestra force-pushed the rkt-systemd-unit-limitnofile branch from d802aa9 to 5c2773c Compare June 26, 2017 22:06
@yifan-gu
Copy link
Contributor

@k8s-bot ok to test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 26, 2017
@yifan-gu
Copy link
Contributor

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 26, 2017
@yifan-gu yifan-gu added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 26, 2017
@yifan-gu
Copy link
Contributor

Seemt we have some failures on the CI.

@JulienBalestra JulienBalestra force-pushed the rkt-systemd-unit-limitnofile branch from 5c2773c to 12f397e Compare June 27, 2017 07:19
@k8s-github-robot k8s-github-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 27, 2017
@JulienBalestra JulienBalestra force-pushed the rkt-systemd-unit-limitnofile branch from 12f397e to 661298b Compare June 27, 2017 08:41
@yifan-gu yifan-gu added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 27, 2017
@JulienBalestra
Copy link
Contributor Author

/test pull-kubernetes-verify

@JulienBalestra JulienBalestra force-pushed the rkt-systemd-unit-limitnofile branch from 661298b to 9f37efc Compare July 1, 2017 16:59
@k8s-github-robot k8s-github-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 1, 2017
@JulienBalestra
Copy link
Contributor Author

JulienBalestra commented Jul 3, 2017

@yifan-gu all tests are OK now

@yifan-gu
Copy link
Contributor

yifan-gu commented Jul 5, 2017

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 5, 2017
@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: JulienBalestra, yifan-gu

No associated issue. Update pull-request body to add a reference to an issue, or get approval with /approve no-issue

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

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Jul 5, 2017

@JulienBalestra: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-unit 9f37efc link /test pull-kubernetes-unit

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 47700, 48464, 48502)

@k8s-github-robot k8s-github-robot merged commit 154bf49 into kubernetes:master Jul 5, 2017
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-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants