-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for hostpath persistent volume definitions
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/
- Loading branch information
David Moreau Simard
committed
Jun 13, 2018
1 parent
a1634c3
commit a94c265
Showing
5 changed files
with
72 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
- name: Get registry DeploymentConfig | ||
oc_obj: | ||
namespace: "{{ openshift_hosted_registry_namespace }}" | ||
state: list | ||
kind: dc | ||
name: "{{ openshift_hosted_registry_name }}" | ||
register: registry_dc | ||
|
||
- name: Wait for registry pods | ||
oc_obj: | ||
namespace: "{{ openshift_hosted_registry_namespace }}" | ||
state: list | ||
kind: pod | ||
selector: "{% for label, value in registry_dc.results.results[0].spec.selector.items() %}{{ label }}={{ value }}{% if not loop.last %},{% endif %}{% endfor %}" | ||
register: registry_pods | ||
until: | ||
- "registry_pods.results.results[0]['items'] | count > 0" | ||
# There must be as many matching pods with 'Ready' status True as there are expected replicas | ||
- "registry_pods.results.results[0]['items'] | lib_utils_oo_collect(attribute='status.conditions') | lib_utils_oo_collect(attribute='status', filters={'type': 'Ready'}) | map('bool') | select | list | count == openshift_hosted_registry_replicas | int" | ||
delay: 10 | ||
retries: 60 | ||
|
||
# https://docs.openshift.com/container-platform/3.9/install_config/registry/deploy_registry_existing_clusters.html#registry-non-production-use | ||
- name: Ensure permissions on the hostpath match the pod configuration | ||
file: | ||
path: "{{ openshift_hosted_registry_storage_hostpath_path }}" | ||
state: directory | ||
owner: "{{ registry_pods.results.results[0]['items'][0].spec.containers[0].securityContext.runAsUser }}" | ||
group: "{{ registry_pods.results.results[0]['items'][0].spec.securityContext.fsGroup }}" | ||
mode: "2750" |