Skip to content

Commit

Permalink
Merge pull request #310 from kubenow/fix/gluster-taint-and-twonodes
Browse files Browse the repository at this point in the history
Fix tainting of glusternodes and variable problem in heketi-gluster playbook
  • Loading branch information
Marco Capuccini authored Dec 13, 2017
2 parents 077ea0b + 41312a1 commit 4ea71cf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions playbooks/roles/heketi-gluster/tasks/heketi-server.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
- name: taint gluster nodes
command: >
kubectl taint node -l storagenode=glusterfs dedicated=fileserver:NoSchedule
- name: create heketi yaml directory
file:
path: ~/.kubernetes-yaml/heketi/
Expand Down
5 changes: 3 additions & 2 deletions playbooks/roles/heketi-gluster/tasks/storage-creation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,12 @@
glusterpod_count: "{{ (enpoint_list | length) | int }}"

# volumtype (replication factor): <VolumeDurability>:number eg. none:1, replicate:2, replicate:3 , disperse:???
# in jinja2 - means remove any whitespace before this bracket
- name: set fact volumetype
set_fact:
volumetype: "{% if (glusterpod_count | int) == 1 %}none:1
{% elif (glusterpod_count | int) == 2 %}replicate:2
{% else %}replicate:3{% endif %}"
{%- elif (glusterpod_count | int) == 2 %}replicate:2
{%- else %}replicate:3{% endif %}"
when: volumetype is undefined

- name: render storage-class
Expand Down
2 changes: 1 addition & 1 deletion playbooks/roles/heketi-gluster/templates/storage-class.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ metadata:
provisioner: kubernetes.io/glusterfs
parameters:
resturl: "http://{{ heketi_endpoint }}"
volumetype: "{{ volumetype }}"
volumetype: {{volumetype}}

0 comments on commit 4ea71cf

Please sign in to comment.