-
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.
Merge pull request #3793 from jarrpa/glusterfs-registry
Merged by openshift-bot
- Loading branch information
Showing
28 changed files
with
1,144 additions
and
1 deletion.
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
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,21 @@ | ||
--- | ||
- name: Open firewall ports for GlusterFS | ||
hosts: oo_glusterfs_to_config | ||
vars: | ||
os_firewall_allow: | ||
- service: glusterfs_sshd | ||
port: "2222/tcp" | ||
- service: glusterfs_daemon | ||
port: "24007/tcp" | ||
- service: glusterfs_management | ||
port: "24008/tcp" | ||
- service: glusterfs_bricks | ||
port: "49152-49251/tcp" | ||
roles: | ||
- os_firewall | ||
|
||
- name: Configure GlusterFS | ||
hosts: oo_first_master | ||
roles: | ||
- role: openshift_storage_glusterfs | ||
when: groups.oo_glusterfs_to_config | default([]) | count > 0 |
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 @@ | ||
../../../filter_plugins |
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 @@ | ||
../../../lookup_plugins |
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 @@ | ||
../../../roles/ |
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
51 changes: 51 additions & 0 deletions
51
roles/openshift_hosted/tasks/registry/storage/glusterfs.yml
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,51 @@ | ||
--- | ||
- name: Wait for registry pods | ||
oc_obj: | ||
namespace: "{{ openshift_hosted_registry_namespace }}" | ||
state: list | ||
kind: pod | ||
selector: "{{ openshift_hosted_registry_name }}={{ openshift_hosted_registry_namespace }}" | ||
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'] | 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 }}" | ||
|
||
- name: Determine registry fsGroup | ||
set_fact: | ||
openshift_hosted_registry_fsgroup: "{{ registry_pods.results.results[0]['items'][0].spec.securityContext.fsGroup }}" | ||
|
||
- name: Create temp mount directory | ||
command: mktemp -d /tmp/openshift-glusterfs-registry-XXXXXX | ||
register: mktemp | ||
changed_when: False | ||
check_mode: no | ||
|
||
- name: Mount registry volume | ||
mount: | ||
state: mounted | ||
fstype: glusterfs | ||
src: "{{ groups.oo_glusterfs_to_config[0] }}:/{{ openshift.hosted.registry.storage.glusterfs.path }}" | ||
name: "{{ mktemp.stdout }}" | ||
|
||
- name: Set registry volume permissions | ||
file: | ||
dest: "{{ mktemp.stdout }}" | ||
state: directory | ||
group: "{{ openshift_hosted_registry_fsgroup }}" | ||
mode: "2775" | ||
recurse: True | ||
|
||
- name: Unmount registry volume | ||
mount: | ||
state: unmounted | ||
name: "{{ mktemp.stdout }}" | ||
|
||
- name: Delete temp mount directory | ||
file: | ||
dest: "{{ mktemp.stdout }}" | ||
state: absent | ||
changed_when: False | ||
check_mode: no |
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,60 @@ | ||
OpenShift GlusterFS Cluster | ||
=========================== | ||
|
||
OpenShift GlusterFS Cluster Installation | ||
|
||
Requirements | ||
------------ | ||
|
||
* Ansible 2.2 | ||
|
||
Role Variables | ||
-------------- | ||
|
||
From this role: | ||
|
||
| Name | Default value | | | ||
|--------------------------------------------------|-------------------------|-----------------------------------------| | ||
| openshift_storage_glusterfs_timeout | 300 | Seconds to wait for pods to become ready | ||
| openshift_storage_glusterfs_namespace | 'default' | Namespace in which to create GlusterFS resources | ||
| openshift_storage_glusterfs_is_native | True | GlusterFS should be containerized | ||
| openshift_storage_glusterfs_nodeselector | 'storagenode=glusterfs' | Selector to determine which nodes will host GlusterFS pods in native mode | ||
| openshift_storage_glusterfs_image | 'gluster/gluster-centos'| Container image to use for GlusterFS pods, enterprise default is 'rhgs3/rhgs-server-rhel7' | ||
| openshift_storage_glusterfs_version | 'latest' | Container image version to use for GlusterFS pods | ||
| openshift_storage_glusterfs_wipe | False | Destroy any existing GlusterFS resources and wipe storage devices. **WARNING: THIS WILL DESTROY ANY DATA ON THOSE DEVICES.** | ||
| openshift_storage_glusterfs_heketi_is_native | True | heketi should be containerized | ||
| openshift_storage_glusterfs_heketi_image | 'heketi/heketi' | Container image to use for heketi pods, enterprise default is 'rhgs3/rhgs-volmanager-rhel7' | ||
| openshift_storage_glusterfs_heketi_version | 'latest' | Container image version to use for heketi pods | ||
| openshift_storage_glusterfs_heketi_admin_key | '' | String to use as secret key for performing heketi commands as admin | ||
| openshift_storage_glusterfs_heketi_user_key | '' | String to use as secret key for performing heketi commands as user that can only view or modify volumes | ||
| openshift_storage_glusterfs_heketi_topology_load | True | Load the GlusterFS topology information into heketi | ||
| openshift_storage_glusterfs_heketi_url | Undefined | URL for the heketi REST API, dynamically determined in native mode | ||
| openshift_storage_glusterfs_heketi_wipe | False | Destroy any existing heketi resources, defaults to the value of `openshift_storage_glusterfs_wipe` | ||
|
||
Dependencies | ||
------------ | ||
|
||
* os_firewall | ||
* openshift_hosted_facts | ||
* openshift_repos | ||
* lib_openshift | ||
|
||
Example Playbook | ||
---------------- | ||
|
||
``` | ||
- name: Configure GlusterFS hosts | ||
hosts: oo_first_master | ||
roles: | ||
- role: openshift_storage_glusterfs | ||
``` | ||
|
||
License | ||
------- | ||
|
||
Apache License, Version 2.0 | ||
|
||
Author Information | ||
------------------ | ||
|
||
Jose A. Rivera ([email protected]) |
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,17 @@ | ||
--- | ||
openshift_storage_glusterfs_timeout: 300 | ||
openshift_storage_glusterfs_namespace: 'default' | ||
openshift_storage_glusterfs_is_native: True | ||
openshift_storage_glusterfs_nodeselector: "{{ openshift_storage_glusterfs_nodeselector_label | default('storagenode=glusterfs') | map_from_pairs }}" | ||
openshift_storage_glusterfs_image: "{{ 'rhgs3/rhgs-server-rhel7' | quote if deployment_type == 'openshift-enterprise' else 'gluster/gluster-centos' | quote }}" | ||
openshift_storage_glusterfs_version: 'latest' | ||
openshift_storage_glusterfs_wipe: False | ||
openshift_storage_glusterfs_heketi_is_native: True | ||
openshift_storage_glusterfs_heketi_is_missing: True | ||
openshift_storage_glusterfs_heketi_deploy_is_missing: True | ||
openshift_storage_glusterfs_heketi_image: "{{ 'rhgs3/rhgs-volmanager-rhel7' | quote if deployment_type == 'openshift-enterprise' else 'heketi/heketi' | quote }}" | ||
openshift_storage_glusterfs_heketi_version: 'latest' | ||
openshift_storage_glusterfs_heketi_admin_key: '' | ||
openshift_storage_glusterfs_heketi_user_key: '' | ||
openshift_storage_glusterfs_heketi_topology_load: True | ||
openshift_storage_glusterfs_heketi_wipe: "{{ openshift_storage_glusterfs_wipe }}" |
115 changes: 115 additions & 0 deletions
115
roles/openshift_storage_glusterfs/files/v1.6/deploy-heketi-template.yml
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,115 @@ | ||
--- | ||
kind: Template | ||
apiVersion: v1 | ||
metadata: | ||
name: deploy-heketi | ||
labels: | ||
glusterfs: heketi-template | ||
deploy-heketi: support | ||
annotations: | ||
description: Bootstrap Heketi installation | ||
tags: glusterfs,heketi,installation | ||
labels: | ||
template: deploy-heketi | ||
objects: | ||
- kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: deploy-heketi | ||
labels: | ||
glusterfs: deploy-heketi-service | ||
deploy-heketi: support | ||
annotations: | ||
description: Exposes Heketi service | ||
spec: | ||
ports: | ||
- name: deploy-heketi | ||
port: 8080 | ||
targetPort: 8080 | ||
selector: | ||
name: deploy-heketi | ||
- kind: Route | ||
apiVersion: v1 | ||
metadata: | ||
name: deploy-heketi | ||
labels: | ||
glusterfs: deploy-heketi-route | ||
deploy-heketi: support | ||
spec: | ||
to: | ||
kind: Service | ||
name: deploy-heketi | ||
- kind: DeploymentConfig | ||
apiVersion: v1 | ||
metadata: | ||
name: deploy-heketi | ||
labels: | ||
glusterfs: deploy-heketi-dc | ||
deploy-heketi: support | ||
annotations: | ||
description: Defines how to deploy Heketi | ||
spec: | ||
replicas: 1 | ||
selector: | ||
name: deploy-heketi | ||
triggers: | ||
- type: ConfigChange | ||
strategy: | ||
type: Recreate | ||
template: | ||
metadata: | ||
name: deploy-heketi | ||
labels: | ||
name: deploy-heketi | ||
glusterfs: deploy-heketi-pod | ||
deploy-heketi: support | ||
spec: | ||
serviceAccountName: heketi-service-account | ||
containers: | ||
- name: deploy-heketi | ||
image: ${IMAGE_NAME}:${IMAGE_VERSION} | ||
env: | ||
- name: HEKETI_USER_KEY | ||
value: ${HEKETI_USER_KEY} | ||
- name: HEKETI_ADMIN_KEY | ||
value: ${HEKETI_ADMIN_KEY} | ||
- name: HEKETI_EXECUTOR | ||
value: kubernetes | ||
- name: HEKETI_FSTAB | ||
value: /var/lib/heketi/fstab | ||
- name: HEKETI_SNAPSHOT_LIMIT | ||
value: '14' | ||
- name: HEKETI_KUBE_GLUSTER_DAEMONSET | ||
value: '1' | ||
ports: | ||
- containerPort: 8080 | ||
volumeMounts: | ||
- name: db | ||
mountPath: /var/lib/heketi | ||
readinessProbe: | ||
timeoutSeconds: 3 | ||
initialDelaySeconds: 3 | ||
httpGet: | ||
path: /hello | ||
port: 8080 | ||
livenessProbe: | ||
timeoutSeconds: 3 | ||
initialDelaySeconds: 30 | ||
httpGet: | ||
path: /hello | ||
port: 8080 | ||
volumes: | ||
- name: db | ||
parameters: | ||
- name: HEKETI_USER_KEY | ||
displayName: Heketi User Secret | ||
description: Set secret for those creating volumes as type _user_ | ||
- name: HEKETI_ADMIN_KEY | ||
displayName: Heketi Administrator Secret | ||
description: Set secret for administration of the Heketi service as user _admin_ | ||
- name: IMAGE_NAME | ||
displayName: GlusterFS container name | ||
required: True | ||
- name: IMAGE_VERSION | ||
displayName: GlusterFS container versiona | ||
required: True |
Oops, something went wrong.