-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 support for hostpath persistent volume definitions #6022
Conversation
Can one of the admins verify this patch?
|
This is working for us right now but I'm not sure if there are other places where we might check against supported volume types.. like for registry there is |
/ok-to-test |
@sdodson Is this a feature we wish to support? |
I'd be in favor of adding support for this, since with logging and metrics we recommend host mounted volumes over NFS for performance reasons. |
I'm realizing that this is a perhaps a bit more complicated after all, at least in the case of using for the registry. The things to consider as far as I can tell:
I'll do some testing and update the PR accordingly. |
yes, we definitely have use cases where hostmount is a good choice. I'd want to get some feedback from @openshift/storage on the best implementation. |
@dmsimard sorry, hostpath is what i should've said |
9225c4a
to
81292a9
Compare
Here's a new commit that includes the hostpath permissions part I mentioned in a previous comment. I'll test this one out and validate the necessary changes for the scc, I need to reinstall my test instance. |
# There must be as many matching pods with 'Ready' status True as there are expected replicas | ||
- "registry_pods.results.results[0]['items'] | oo_collect(attribute='status.conditions') | oo_collect(attribute='status', filters={'type': 'Ready'}) | map('bool') | select | list | count == openshift_hosted_registry_replicas | int" | ||
delay: 10 | ||
retries: "{{ (600 / 10) | int }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michaelgugino I'd agree with you here, I thought it was very odd too. Frankly, this was copy/pasted in large part from the gluster parts here
I left it as-is because I thought it was so weird there must've been a good reason to do it that way ? Happy to change it :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woops, my bad! That was supposed to be replaced by a timeout variable that defaults to 600. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
60 would be fine, I suppose. Let's just put 60 in there, having an equation with two hard coded values is super silly :)
|
||
- name: Determine registry fsGroup and runAsUser | ||
set_fact: | ||
openshift_hosted_registry_fsgroup: "{{ registry_pods.results.results[0]['items'][0].spec.securityContext.fsGroup }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're only consuming these variables here, no need to set fact, just use these in the file task.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
81292a9
to
82fcd63
Compare
@michaelgugino @abutcher rebased the pull request and addressed the comments. |
@dmsimard PR needs rebase |
maybe someone can also look at #6250 which allows to use PV/PVC for local storage ? (/me doing self-promotion since he doesn't know who to ping) |
@michaelgugino @abutcher Are you still interested in this ? We've been successfully using it for a long time but rebasing it all the time is tedious. I can rebase it once more if we can finally merge it. |
@dmsimard Let's rebase and get this in. The change is pretty self-contained, I don't see a reason to not merge it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/ok-to-test
/lgtm
82fcd63
to
e8ea5b4
Compare
a94c265
to
feb24fb
Compare
@sdodson @michaelgugino this has been rebased against master and should be good to land unless you notice any issues. |
@@ -90,6 +90,26 @@ def build_pv_glusterfs(self, varname=None): | |||
path=path, | |||
readOnly=read_only))) | |||
|
|||
def build_pv_hostpath(self, varname=None): | |||
"""Build pv dictionary for hostpath storage type""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
roles/lib_utils/action_plugins/generate_pv_pvcs_list.py:94: [W0311(bad-indentation), ] Bad indentation. Found 12 spaces, expected 8
hostpath volumes [1] mount a file or directory from the host node’s filesystem into a pod. This adds support for declaring a hostPath volume as a persistent volume and do a persistent volume claim for one for the hosted registry. [1]: https://kubernetes.io/docs/concepts/storage/volumes/
feb24fb
to
6937ac4
Compare
@vrutkovs oops, not sure how that happened. Fixed. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abutcher, dmsimard, michaelgugino 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 |
/retest |
/test install |
@dmsimard: The following test failed, say
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. |
gcp infra flake |
hostpath volumes 1 mount a file or directory from the host node’s
filesystem into a pod. This adds support for declaring a hostPath
volume as a persistent volume and do a persistent volume claim for
one for the hosted registry.