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 writable location for flexvolume plugins #315

Merged

Conversation

gnufied
Copy link
Member

@gnufied gnufied commented Jan 15, 2019

Fixes https://jira.coreos.com/browse/STOR-157

This parameter can not be configured via KubeletConfiguration because of kubernetes/kubernetes#72937

@openshift-ci-robot openshift-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jan 15, 2019
@gnufied
Copy link
Member Author

gnufied commented Jan 15, 2019

corresponding change will also be needed to controller-manager fwiw.

@ashcrow
Copy link
Member

ashcrow commented Jan 16, 2019

/retest

@cgwalters
Copy link
Member

Every config change needs to be (rather tediously) reflected in pkg/controller/template/test_data/ too. When I working on adding a new unit in #273
I ended up doing: for x in openstack none aws; do cp --reflink=auto pkg/controller/template/test_data/templates/{libvirt,$x}/master/units/rhcos-initial-pivot.service; done
although your case is a bit different.

It is tempting though to change the unit tests to only verify e.g. a few cases rather than duplicating all the data again 8 times.

@gnufied
Copy link
Member Author

gnufied commented Jan 16, 2019

@cgwalters yep. I am going to push that stuff. I had that updated yesterday night, I forgot to push.

@ashcrow
Copy link
Member

ashcrow commented Jan 16, 2019

Unit tests look like they need updating. The end results no longer look like what was expected.

@openshift-ci-robot openshift-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 Jan 17, 2019
Copy link
Contributor

@kikisdeliveryservice kikisdeliveryservice left a comment

Choose a reason for hiding this comment

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

Just a small typo fix. Thanks so much for adding this documentation!

pkg/controller/template/test_data/README.md Outdated Show resolved Hide resolved
pkg/controller/template/test_data/README.md Outdated Show resolved Hide resolved
@openshift-ci-robot openshift-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 18, 2019
@gnufied gnufied force-pushed the change-kubelet-config branch from ea00c90 to 635cb79 Compare January 18, 2019 01:00
@gnufied
Copy link
Member Author

gnufied commented Jan 18, 2019

/test e2e-aws

@gnufied
Copy link
Member Author

gnufied commented Jan 18, 2019

@cgwalters @ashcrow can you PTAL

pkg/daemon/daemon.go Outdated Show resolved Hide resolved
@@ -84,6 +84,11 @@ func (dn *Daemon) update(oldConfig, newConfig *mcfgv1.MachineConfig) error {
return fmt.Errorf("%s", msg)
}

// Create direcotry path for flexvolume plugin
if err = dn.fileSystemClient.MkdirAll(pathFlexVolumePlugin, DefaultDirectoryPermissions); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we want this as Go code; it should just be an Ignition config like any others. Specifically an entry in directories; see the Ignition spec.

IOW you'd want this to be a file in templates like how we have the kubelet.yaml there.

However - looking at render.go, we'd need to extend it with e.g. directories.

Copy link
Member Author

Choose a reason for hiding this comment

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

okay, do you want me do that as part of this PR? I am kinda new to this code base, I am still trying to grok how Ignition spec works.

Copy link
Member

Choose a reason for hiding this comment

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

No worries @gnufied!

If the Ignition config comes through the install process Ignition will do exactly what is needed (creating the directories, dropping the file, etc..).

If it comes down through MCD then MCD itself has a subset of Ignition implementation to create files/dirs/etc.. I think this would make more sense within this area and/or here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is the goal here to just create the dir (that is always the same dir location) and never do anything else with it in the MCD?

Copy link
Member

Choose a reason for hiding this comment

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

For clarity, templates is fine. If you need to do some kind of operations then the areas I pointed out would be where to add logic.

Copy link
Member Author

Choose a reason for hiding this comment

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

Goal is just to create the directory. We don't need to do anything else in MCD.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with @cgwalters that templates makes more sense.

Copy link
Member

Choose a reason for hiding this comment

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

Based on coreos/ignition#706 you could probably "cheat" and make a .dummy file there or so (assuming kubelet won't try to load a .dummy or whatever file as a plugin).

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I think that would work. Kubelet seems to skip loading files that begin with . as plugins.

Copy link
Member

Choose a reason for hiding this comment

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

Related: #125

@cgwalters
Copy link
Member

Before we proceed farther - does this change have a 4.0 freeze exception?

@ashcrow
Copy link
Member

ashcrow commented Jan 18, 2019

@cgwalters I did not see it upon quick scan of the list.

@gnufied can you confirm that this does or does not have the exception approval?

@ashcrow
Copy link
Member

ashcrow commented Jan 18, 2019

/hold

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 18, 2019
@gnufied
Copy link
Member Author

gnufied commented Jan 18, 2019

@ashcrow @cgwalters this is a bug fix, not a new feature. Does it require 4.0 freeze exception? Adding @childsb @knobunc @tsmetana

@childsb
Copy link

childsb commented Jan 18, 2019

@gnufied bugfixes shouldn't require an exception, but you should open a bugzilla to help support that its a bug.

@gnufied
Copy link
Member Author

gnufied commented Jan 18, 2019

There is already a JIRA issue linked with the PR. How many issues must a man open to fix a bug? :D

@ashcrow
Copy link
Member

ashcrow commented Jan 18, 2019

OK, if this is indeed a bugfix it doesn't need an exception.

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 18, 2019
pkg/daemon/daemon.go Outdated Show resolved Hide resolved
Copy link
Member

@ashcrow ashcrow left a comment

Choose a reason for hiding this comment

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

A couple of requests added in comments ... but I'm following the logic now 😄

Fix tests and add a note about how to update testdata
@gnufied gnufied force-pushed the change-kubelet-config branch from 635cb79 to c94174c Compare January 18, 2019 20:53
@ashcrow
Copy link
Member

ashcrow commented Jan 18, 2019

Terraform/AWS flake

/test e2e-aws-op

Copy link
Member

@ashcrow ashcrow left a comment

Choose a reason for hiding this comment

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

This is much clearer 👍

@cgwalters
Copy link
Member

/approve

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 18, 2019
@kikisdeliveryservice
Copy link
Contributor

I'm going to pull this to verify. :)

@cgwalters
Copy link
Member

/assign kikisdeliveryservice

Will let her do the final lgtm.

Copy link
Contributor

@kikisdeliveryservice kikisdeliveryservice left a comment

Choose a reason for hiding this comment

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

Testing results:
Applied updated MCC to cluster and saw new configs for both master and worker were generated and contained:

ExecStart=/usr/bin/hyperkube \
              kubelet \
             ...
                --volume-plugin-dir=/etc/kubernetes/kubelet-plugins/volume/exec \

Manually verify dir created by sshing into master and worker:

[core@... ~]$ cd /etc/kubernetes/kubelet-plugins/volume/exec
[core@... exec]$ ls
[core@... exec]$ 

Finally check for the hidden dummy file:

[core@... exec]$ ls -a
.  ..  .dummy

@kikisdeliveryservice
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 19, 2019
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cgwalters, gnufied, kikisdeliveryservice

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

@kikisdeliveryservice
Copy link
Contributor

/test e2e-aws

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. lgtm Indicates that a PR is ready to be merged. 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.

8 participants