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

clusterup add .skip_pv marker #16631

Merged

Conversation

mjudeikis
Copy link
Contributor

@mjudeikis mjudeikis commented Oct 1, 2017

Added .skip_pv marker for oc cluster up command.
When the marker is detected in the PV folder - no PV's will be created leaving this configuration for the user.

as per https://trello.com/c/HbpYqEkm/1250-1-cluster-up-option-to-set-number-of-pvs-to-create-clusterup added pv count.

@csrwng @jim-minter

@openshift-ci-robot openshift-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 1, 2017
@mjudeikis
Copy link
Contributor Author

/retest

@mjudeikis
Copy link
Contributor Author

@smarterclayton new flag to oc cluster up --pv-count specifying how many PV we need to create. Arou happy with flag as such?

Copy link
Contributor

@jim-minter jim-minter left a comment

Choose a reason for hiding this comment

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

LGTM - two minor nits

@@ -81,7 +80,8 @@ for i in $(seq -f "%%04g" 1 %[1]d); do
done
`

func (h *Helper) SetupPersistentStorage(authorizationClient authorizationtypedclient.ClusterRoleBindingsGetter, kclient kclientset.Interface, securityClient securityclient.Interface, dir string) error {
// SetupPersistentStorage setup persistent storage
Copy link
Contributor

Choose a reason for hiding this comment

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

sets up ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

SetsUpPersistenStorage?

Copy link
Contributor

Choose a reason for hiding this comment

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

no, the second word :)

@@ -269,6 +270,7 @@ func (config *CommonStartConfig) Bind(flags *pflag.FlagSet) {
flags.StringVar(&config.HTTPProxy, "http-proxy", "", "HTTP proxy to use for master and builds")
flags.StringVar(&config.HTTPSProxy, "https-proxy", "", "HTTPS proxy to use for master and builds")
flags.StringArrayVar(&config.NoProxy, "no-proxy", config.NoProxy, "List of hosts or subnets for which a proxy should not be used")
flags.IntVar(&config.PVCount, "pv-count", 100, "Number of PV to be created. Default 100.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest "Number of persistent volumes to be created"

@smarterclayton
Copy link
Contributor

Not really. Why aren't we creating enough PVs for this never to be a problem?

@csrwng
Copy link
Contributor

csrwng commented Oct 2, 2017

@smarterclayton the request came from the minishift team to have the option to set the count to 0 if desired.

@csrwng
Copy link
Contributor

csrwng commented Oct 2, 2017

@mangirdaz, I talked to @smarterclayton and came up with an alternative for adding a flag. Basically if there's directories inside the pv directory you specify, skip creating the pv's.

@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 Oct 3, 2017
@mjudeikis
Copy link
Contributor Author

@csrwng added 2 options:

  1. If the folder contains any folders new pvs will not be created. So each second run OR rerun on existing config will not recreate PV's
  2. If folder containers marker file PV creation will be skipped too. allows to setup behavior for 1 run too

@csrwng
Copy link
Contributor

csrwng commented Oct 3, 2017

@mangirdaz thinking about it some more, I think we should just go with option 2
The job to setup the persistent volumes is re-entrant and it's meant to continue if you shut down your cluster and start it again later. So we wouldn't be able to tell if the existing folders were created previously by the job and it just needs to continue or it shouldn't do anything.

@mjudeikis
Copy link
Contributor Author

/test extended_conformance_gce

@mjudeikis
Copy link
Contributor Author

@csrwng So these will hang on now until master branch will be unlocked?

@csrwng
Copy link
Contributor

csrwng commented Oct 10, 2017

@mjudeikis yes

@mjudeikis
Copy link
Contributor Author

@csrwng @jim-minter Can you please review the code when you have a spare minute? :)

@jorgemoralespou
Copy link

@csrwng is the option implemented in this PR, skipping the PV creation on marker file existence satisfactory to the use case that triggered this issue, from the minishift team? Haven't seen any conversation.

@csrwng
Copy link
Contributor

csrwng commented Oct 24, 2017

@jorgemoralespou sorry no, but I will have the conversation with the minishift team. It is imho the best we can do without adding new flags to cluster up. Because minishift passes the directory to use for pv's to cluster up, the contents of that directory are under their control.

@LalatenduMohanty
Copy link
Member

@csrwng I think it would solve the original issue of permissions for us. Now we can create the pv (dirs) ourself and then fix the permission if required. cc @hferentschik

@gbraad
Copy link
Contributor

gbraad commented Oct 25, 2017

@mjudeikis
Copy link
Contributor Author

@csrwng what about if we start doing something like hidden flags? the ones which do not appear in -h? not nice? we used to do something similar with few other RH products.

@hferentschik
Copy link
Contributor

Personally, I am more in favour of flags and have no issue with them being hidden. I think this keeps things together. A marker file is a bit of a backdoor hack imo. That said, it would work as well of course.

the code to be modified/related to this is: Ref: https://github.com/minishift/minishift/blob/40c37de0cc16651d821cccf826082fff97e6cf9e/pkg/minishift/clusterup/clusterup.go#L217

@LalatenduMohanty, not quite. If we are going down the marker file route, we need to do things before we call cluster up. The code you are pointing out is something we do after cluster up and in fact, the PV creation job has completed. I guess the code you point out might change in a way that we would create PVs at this point ourselves. So it's related ;-)

@gbraad
Copy link
Contributor

gbraad commented Oct 26, 2017

I agree, this is also in my opinion a workaround. it can work, but not very charming.

@hferentschik as mentioned, it is related, as some of the backstory was missing. it has been nearly 6 months since the request and the offered implementation. Yes, the implementation would happen before clusterup is handled, so right after startHost in start.go (similar to how the proxy is set).

pvSetupJobName = "persistent-volume-setup"
pvInstallerSA = "pvinstaller"
pvSetupNamespace = "default"
pvIgnoreMarkerFile = ".dont_create_pv"
Copy link
Contributor

Choose a reason for hiding this comment

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

s/.dont_create_pv/.skip_pv/
(just suggestion)
skip_pv seems more concise

@csrwng
Copy link
Contributor

csrwng commented Nov 14, 2017

@mjudeikis a minor suggestion and can you also update the title/description of the PR? Other than that, it should be ready to merge.

@openshift-ci-robot openshift-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 14, 2017
@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 Nov 14, 2017
@mjudeikis mjudeikis changed the title oc cluster up - add flag for pv count clusterup add .skip_pv flag Nov 14, 2017
@mjudeikis mjudeikis changed the title clusterup add .skip_pv flag clusterup add .skip_pv marker Nov 14, 2017
@mjudeikis
Copy link
Contributor Author

Adding this test to standard test was breaking other tests.
Added new test as persistentvolume with an idea that when we do "host provisioner" story to add it, it will go to same set of tests.

@csrwng
Copy link
Contributor

csrwng commented Nov 15, 2017

/retest

1 similar comment
@mjudeikis
Copy link
Contributor Author

/retest

@mjudeikis
Copy link
Contributor Author

@csrwng done

@csrwng
Copy link
Contributor

csrwng commented Nov 17, 2017

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 17, 2017
@csrwng
Copy link
Contributor

csrwng commented Nov 17, 2017

/assign @bparees

@bparees
Copy link
Contributor

bparees commented Nov 17, 2017

/approve

@openshift-merge-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bparees, csrwng, mjudeikis

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

@openshift-merge-robot openshift-merge-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 17, 2017
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@mjudeikis
Copy link
Contributor Author

/restest

@openshift-merge-robot
Copy link
Contributor

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

@openshift-merge-robot
Copy link
Contributor

Automatic merge from submit-queue (batch tested with PRs 17289, 16631).

@openshift-merge-robot openshift-merge-robot merged commit 294f07f into openshift:master Nov 18, 2017
@openshift-ci-robot
Copy link

@mjudeikis: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/openshift-jenkins/extended_conformance_install_update 7f448c0 link /test extended_conformance_install_update
ci/openshift-jenkins/extended_conformance_install 7f448c0 link /test extended_conformance_install
ci/openshift-jenkins/extended_conformance_gce 7f448c0 link /test extended_conformance_gce

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.

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.