No known key found for this signature in database
GPG Key ID: D1D6CE184437796D
17 changed files with 55 additions and 510 deletions
Split View
Diff Options
-
2contrib/network-storage/heketi/heketi.yml
-
1contrib/network-storage/heketi/roles/provision/defaults/main.yml
-
144contrib/network-storage/heketi/roles/provision/glusterfs-daemonset.json
-
133contrib/network-storage/heketi/roles/provision/heketi-bootstrap.json
-
159contrib/network-storage/heketi/roles/provision/heketi-deployment.json
-
7contrib/network-storage/heketi/roles/provision/heketi-service-account.json
-
9contrib/network-storage/heketi/roles/provision/tasks/kubernetes.yml
-
8contrib/network-storage/heketi/roles/provision/tasks/main.yml
-
18contrib/network-storage/heketi/roles/provision/tasks/setup.yml
-
9contrib/network-storage/heketi/roles/provision/tasks/setup/boot.yml
-
2contrib/network-storage/heketi/roles/provision/tasks/setup/heketi.yml
-
33contrib/network-storage/heketi/roles/provision/tasks/setup/rest.yml
-
2contrib/network-storage/heketi/roles/provision/tasks/setup/storage.yml
-
11contrib/network-storage/heketi/roles/provision/tasks/setup/topology.yml
-
20contrib/network-storage/heketi/roles/provision/tasks/setup/volumes.yml
-
5contrib/network-storage/heketi/roles/provision/tasks/storageclass.yml
-
2contrib/network-storage/heketi/roles/provision/templates/storageclass.yml.j2
@ -1,2 +1 @@ |
|||
--- |
|||
artifacts_dir: "{{ ansible_inventory_sources[0] | dirname }}/artifacts" |
@ -1,144 +0,0 @@ |
|||
{ |
|||
"kind": "DaemonSet", |
|||
"apiVersion": "extensions/v1beta1", |
|||
"metadata": { |
|||
"name": "glusterfs", |
|||
"labels": { |
|||
"glusterfs": "deployment" |
|||
}, |
|||
"annotations": { |
|||
"description": "GlusterFS Daemon Set", |
|||
"tags": "glusterfs" |
|||
} |
|||
}, |
|||
"spec": { |
|||
"template": { |
|||
"metadata": { |
|||
"name": "glusterfs", |
|||
"labels": { |
|||
"glusterfs-node": "daemonset" |
|||
} |
|||
}, |
|||
"spec": { |
|||
"nodeSelector": { |
|||
"storagenode" : "glusterfs" |
|||
}, |
|||
"hostNetwork": true, |
|||
"containers": [ |
|||
{ |
|||
"image": "gluster/gluster-centos:gluster4u0_centos7", |
|||
"imagePullPolicy": "Always", |
|||
"name": "glusterfs", |
|||
"volumeMounts": [ |
|||
{ |
|||
"name": "glusterfs-heketi", |
|||
"mountPath": "/var/lib/heketi" |
|||
}, |
|||
{ |
|||
"name": "glusterfs-run", |
|||
"mountPath": "/run" |
|||
}, |
|||
{ |
|||
"name": "glusterfs-lvm", |
|||
"mountPath": "/run/lvm" |
|||
}, |
|||
{ |
|||
"name": "glusterfs-etc", |
|||
"mountPath": "/etc/glusterfs" |
|||
}, |
|||
{ |
|||
"name": "glusterfs-logs", |
|||
"mountPath": "/var/log/glusterfs" |
|||
}, |
|||
{ |
|||
"name": "glusterfs-config", |
|||
"mountPath": "/var/lib/glusterd" |
|||
}, |
|||
{ |
|||
"name": "glusterfs-dev", |
|||
"mountPath": "/dev" |
|||
}, |
|||
{ |
|||
"name": "glusterfs-cgroup", |
|||
"mountPath": "/sys/fs/cgroup" |
|||
} |
|||
], |
|||
"securityContext": { |
|||
"capabilities": {}, |
|||
"privileged": true |
|||
}, |
|||
"readinessProbe": { |
|||
"timeoutSeconds": 3, |
|||
"initialDelaySeconds": 60, |
|||
"exec": { |
|||
"command": [ |
|||
"/bin/bash", |
|||
"-c", |
|||
"systemctl status glusterd.service" |
|||
] |
|||
} |
|||
}, |
|||
"livenessProbe": { |
|||
"timeoutSeconds": 3, |
|||
"initialDelaySeconds": 60, |
|||
"exec": { |
|||
"command": [ |
|||
"/bin/bash", |
|||
"-c", |
|||
"systemctl status glusterd.service" |
|||
] |
|||
} |
|||
} |
|||
} |
|||
], |
|||
"volumes": [ |
|||
{ |
|||
"name": "glusterfs-heketi", |
|||
"hostPath": { |
|||
"path": "/var/lib/heketi" |
|||
} |
|||
}, |
|||
{ |
|||
"name": "glusterfs-run" |
|||
}, |
|||
{ |
|||
"name": "glusterfs-lvm", |
|||
"hostPath": { |
|||
"path": "/run/lvm" |
|||
} |
|||
}, |
|||
{ |
|||
"name": "glusterfs-etc", |
|||
"hostPath": { |
|||
"path": "/etc/glusterfs" |
|||
} |
|||
}, |
|||
{ |
|||
"name": "glusterfs-logs", |
|||
"hostPath": { |
|||
"path": "/var/log/glusterfs" |
|||
} |
|||
}, |
|||
{ |
|||
"name": "glusterfs-config", |
|||
"hostPath": { |
|||
"path": "/var/lib/glusterd" |
|||
} |
|||
}, |
|||
{ |
|||
"name": "glusterfs-dev", |
|||
"hostPath": { |
|||
"path": "/dev" |
|||
} |
|||
}, |
|||
{ |
|||
"name": "glusterfs-cgroup", |
|||
"hostPath": { |
|||
"path": "/sys/fs/cgroup" |
|||
} |
|||
} |
|||
] |
|||
} |
|||
} |
|||
} |
|||
} |
@ -1,133 +0,0 @@ |
|||
{ |
|||
"kind": "List", |
|||
"apiVersion": "v1", |
|||
"items": [ |
|||
{ |
|||
"kind": "Service", |
|||
"apiVersion": "v1", |
|||
"metadata": { |
|||
"name": "deploy-heketi", |
|||
"labels": { |
|||
"glusterfs": "heketi-service", |
|||
"deploy-heketi": "support" |
|||
}, |
|||
"annotations": { |
|||
"description": "Exposes Heketi Service" |
|||
} |
|||
}, |
|||
"spec": { |
|||
"selector": { |
|||
"name": "deploy-heketi" |
|||
}, |
|||
"ports": [ |
|||
{ |
|||
"name": "deploy-heketi", |
|||
"port": 8080, |
|||
"targetPort": 8080 |
|||
} |
|||
] |
|||
} |
|||
}, |
|||
{ |
|||
"kind": "Deployment", |
|||
"apiVersion": "extensions/v1beta1", |
|||
"metadata": { |
|||
"name": "deploy-heketi", |
|||
"labels": { |
|||
"glusterfs": "heketi-deployment", |
|||
"deploy-heketi": "deployment" |
|||
}, |
|||
"annotations": { |
|||
"description": "Defines how to deploy Heketi" |
|||
} |
|||
}, |
|||
"spec": { |
|||
"replicas": 1, |
|||
"template": { |
|||
"metadata": { |
|||
"name": "deploy-heketi", |
|||
"labels": { |
|||
"name": "deploy-heketi", |
|||
"glusterfs": "heketi-pod", |
|||
"deploy-heketi": "pod" |
|||
} |
|||
}, |
|||
"spec": { |
|||
"serviceAccountName": "heketi-service-account", |
|||
"containers": [ |
|||
{ |
|||
"image": "heketi/heketi:7", |
|||
"imagePullPolicy": "Always", |
|||
"name": "deploy-heketi", |
|||
"env": [ |
|||
{ |
|||
"name": "HEKETI_EXECUTOR", |
|||
"value": "kubernetes" |
|||
}, |
|||
{ |
|||
"name": "HEKETI_DB_PATH", |
|||
"value": "/var/lib/heketi/heketi.db" |
|||
}, |
|||
{ |
|||
"name": "HEKETI_FSTAB", |
|||
"value": "/var/lib/heketi/fstab" |
|||
}, |
|||
{ |
|||
"name": "HEKETI_SNAPSHOT_LIMIT", |
|||
"value": "14" |
|||
}, |
|||
{ |
|||
"name": "HEKETI_KUBE_GLUSTER_DAEMONSET", |
|||
"value": "y" |
|||
} |
|||
], |
|||
"ports": [ |
|||
{ |
|||
"containerPort": 8080 |
|||
} |
|||
], |
|||
"volumeMounts": [ |
|||
{ |
|||
"name": "db", |
|||
"mountPath": "/var/lib/heketi" |
|||
}, |
|||
{ |
|||
"name": "config", |
|||
"mountPath": "/etc/heketi" |
|||
} |
|||
], |
|||
"readinessProbe": { |
|||
"timeoutSeconds": 3, |
|||
"initialDelaySeconds": 3, |
|||
"httpGet": { |
|||
"path": "/hello", |
|||
"port": 8080 |
|||
} |
|||
}, |
|||
"livenessProbe": { |
|||
"timeoutSeconds": 3, |
|||
"initialDelaySeconds": 30, |
|||
"httpGet": { |
|||
"path": "/hello", |
|||
"port": 8080 |
|||
} |
|||
} |
|||
} |
|||
], |
|||
"volumes": [ |
|||
{ |
|||
"name": "db" |
|||
}, |
|||
{ |
|||
"name": "config", |
|||
"secret": { |
|||
"secretName": "heketi-config-secret" |
|||
} |
|||
} |
|||
] |
|||
} |
|||
} |
|||
} |
|||
} |
|||
] |
|||
} |
@ -1,159 +0,0 @@ |
|||
{ |
|||
"kind": "List", |
|||
"apiVersion": "v1", |
|||
"items": [ |
|||
{ |
|||
"kind": "Secret", |
|||
"apiVersion": "v1", |
|||
"metadata": { |
|||
"name": "heketi-db-backup", |
|||
"labels": { |
|||
"glusterfs": "heketi-db", |
|||
"heketi": "db" |
|||
} |
|||
}, |
|||
"data": { |
|||
}, |
|||
"type": "Opaque" |
|||
}, |
|||
{ |
|||
"kind": "Service", |
|||
"apiVersion": "v1", |
|||
"metadata": { |
|||
"name": "heketi", |
|||
"labels": { |
|||
"glusterfs": "heketi-service", |
|||
"deploy-heketi": "support" |
|||
}, |
|||
"annotations": { |
|||
"description": "Exposes Heketi Service" |
|||
} |
|||
}, |
|||
"spec": { |
|||
"selector": { |
|||
"name": "heketi" |
|||
}, |
|||
"ports": [ |
|||
{ |
|||
"name": "heketi", |
|||
"port": 8080, |
|||
"targetPort": 8080 |
|||
} |
|||
] |
|||
} |
|||
}, |
|||
{ |
|||
"kind": "Deployment", |
|||
"apiVersion": "extensions/v1beta1", |
|||
"metadata": { |
|||
"name": "heketi", |
|||
"labels": { |
|||
"glusterfs": "heketi-deployment" |
|||
}, |
|||
"annotations": { |
|||
"description": "Defines how to deploy Heketi" |
|||
} |
|||
}, |
|||
"spec": { |
|||
"replicas": 1, |
|||
"template": { |
|||
"metadata": { |
|||
"name": "heketi", |
|||
"labels": { |
|||
"name": "heketi", |
|||
"glusterfs": "heketi-pod" |
|||
} |
|||
}, |
|||
"spec": { |
|||
"serviceAccountName": "heketi-service-account", |
|||
"containers": [ |
|||
{ |
|||
"image": "heketi/heketi:7", |
|||
"imagePullPolicy": "Always", |
|||
"name": "heketi", |
|||
"env": [ |
|||
{ |
|||
"name": "HEKETI_EXECUTOR", |
|||
"value": "kubernetes" |
|||
}, |
|||
{ |
|||
"name": "HEKETI_DB_PATH", |
|||
"value": "/var/lib/heketi/heketi.db" |
|||
}, |
|||
{ |
|||
"name": "HEKETI_FSTAB", |
|||
"value": "/var/lib/heketi/fstab" |
|||
}, |
|||
{ |
|||
"name": "HEKETI_SNAPSHOT_LIMIT", |
|||
"value": "14" |
|||
}, |
|||
{ |
|||
"name": "HEKETI_KUBE_GLUSTER_DAEMONSET", |
|||
"value": "y" |
|||
} |
|||
], |
|||
"ports": [ |
|||
{ |
|||
"containerPort": 8080 |
|||
} |
|||
], |
|||
"volumeMounts": [ |
|||
{ |
|||
"mountPath": "/backupdb", |
|||
"name": "heketi-db-secret" |
|||
}, |
|||
{ |
|||
"name": "db", |
|||
"mountPath": "/var/lib/heketi" |
|||
}, |
|||
{ |
|||
"name": "config", |
|||
"mountPath": "/etc/heketi" |
|||
} |
|||
], |
|||
"readinessProbe": { |
|||
"timeoutSeconds": 3, |
|||
"initialDelaySeconds": 3, |
|||
"httpGet": { |
|||
"path": "/hello", |
|||
"port": 8080 |
|||
} |
|||
}, |
|||
"livenessProbe": { |
|||
"timeoutSeconds": 3, |
|||
"initialDelaySeconds": 30, |
|||
"httpGet": { |
|||
"path": "/hello", |
|||
"port": 8080 |
|||
} |
|||
} |
|||
} |
|||
], |
|||
"volumes": [ |
|||
{ |
|||
"name": "db", |
|||
"glusterfs": { |
|||
"endpoints": "heketi-storage-endpoints", |
|||
"path": "heketidbstorage" |
|||
} |
|||
}, |
|||
{ |
|||
"name": "heketi-db-secret", |
|||
"secret": { |
|||
"secretName": "heketi-db-backup" |
|||
} |
|||
}, |
|||
{ |
|||
"name": "config", |
|||
"secret": { |
|||
"secretName": "heketi-config-secret" |
|||
} |
|||
} |
|||
] |
|||
} |
|||
} |
|||
} |
|||
} |
|||
] |
|||
} |
@ -1,7 +0,0 @@ |
|||
{ |
|||
"apiVersion": "v1", |
|||
"kind": "ServiceAccount", |
|||
"metadata": { |
|||
"name": "heketi-service-account" |
|||
} |
|||
} |
@ -1,33 +0,0 @@ |
|||
--- |
|||
# Enable local REST-Interface |
|||
- name: "Get heketi initial pod state." |
|||
register: "initial_heketi_pod" |
|||
command: "kubectl get pods --selector=deploy-heketi=pod,glusterfs=heketi-pod,name=deploy-heketi --output=json" |
|||
changed_when: false |
|||
- name: "Ensure heketi bootstrap pod is up." |
|||
assert: |
|||
that: "(initial_heketi_pod.stdout|from_json|json_query('items[*]'))|length == 1" |
|||
- name: "Temporarily enable local port forwarding to heketi REST interface" |
|||
vars: |
|||
initial_heketi_pod_name: "{{ initial_heketi_pod.stdout|from_json|json_query(\"items[*].metadata.name|[0]\") }}" |
|||
command: "kubectl port-forward {{ initial_heketi_pod_name }} 48080:8080" |
|||
async: 600 |
|||
poll: 0 |
|||
ignore_errors: "yes" |
|||
register: "heketi_port_forwarding" |
|||
changed_when: false |
|||
- name: "Ensure port forwarding is enabled." |
|||
retries: 10 |
|||
delay: 5 |
|||
assert: |
|||
that: |
|||
- "heketi_port_forwarding.finished == 0" |
|||
- "heketi_port_forwarding.started == 1" |
|||
- "heketi_port_forwarding.failed == false" |
|||
msg: "Port forwarding does not work." |
|||
- name: "Test REST endpoint." |
|||
uri: { url: "http://localhost:48080/hello", method: "GET", return_content: true } |
|||
register: "rest_hello_check" |
|||
until: "rest_hello_check.content == \"Hello from Heketi\"" |
|||
retries: 60 |
|||
delay: 5 |
@ -1,18 +1,21 @@ |
|||
--- |
|||
- name: "Get heketi topology." |
|||
register: "heketi_topology" |
|||
command: "heketi-cli -s http://localhost:48080 topology info --json" |
|||
command: "kubectl exec {{ initial_heketi_pod_name }} -- heketi-cli topology info --json" |
|||
- name: "Render heketi topology template." |
|||
become: true |
|||
vars: { nodes: "{{ groups['heketi-node'] }}" } |
|||
template: |
|||
src: "topology.json.j2" |
|||
dest: "{{ artifacts_dir }}/topology.json" |
|||
dest: "{{ kube_config_dir }}/topology.json" |
|||
- name: "Copy topology configuration into container." |
|||
command: "kubectl cp {{ kube_config_dir }}/topology.json {{ initial_heketi_pod_name }}:/tmp/topology.json" |
|||
- name: "Load heketi topology." |
|||
when: "heketi_topology.stdout|from_json|json_query(\"clusters[*].nodes[*]\")|flatten|length == 0" |
|||
command: "heketi-cli -s http://localhost:48080 topology load --json={{ artifacts_dir }}/topology.json" |
|||
command: "kubectl exec {{ initial_heketi_pod_name }} -- heketi-cli topology load --json=/tmp/topology.json" |
|||
- name: "Get heketi topology." |
|||
register: "heketi_topology" |
|||
command: "heketi-cli -s http://localhost:48080 topology info --json" |
|||
command: "kubectl exec {{ initial_heketi_pod_name }} -- heketi-cli topology info --json" |
|||
until: "heketi_topology.stdout|from_json|json_query(\"clusters[*].nodes[*].devices[?state=='online'].id\")|flatten|length == groups['heketi-node']|length" |
|||
retries: 60 |
|||
delay: 5 |
Write
Preview
Loading…
Cancel
Save