Adds glusterfs tasks for kubernetes app role

This commit is contained in:
Pablo Moreno 2016-11-13 03:28:29 +00:00 committed by ant31
parent d40cfaa956
commit ff460d88bd
3 changed files with 44 additions and 0 deletions

View file

@ -7,6 +7,14 @@
register: manifests
when: inventory_hostname == groups['kube-master'][0]
- name: Kubernetes Apps | Lay Down k8s GlusterFS Endpoint and PV
template: src={{item.file}} dest=/etc/kubernetes/{{item.dest}}
with_items:
- {file: glusterfs-kubernetes-endpoint.json.j2, type: ep, dest: glusterfs-kubernetes-endpoint.json}
- {file: glusterfs-kubernetes-pv.yml, type: pv, dest: glusterfs-kubernetes-pv.yml}
register: manifests
when: inventory_hostname == groups['kube-master'][0] and groups[gfs-cluster] is defined
- name: Kubernetes Apps | Start Resources
kube:
name: kubedns

View file

@ -0,0 +1,24 @@
{
"kind": "Endpoints",
"apiVersion": "v1",
"metadata": {
"name": "glusterfs-cluster"
},
"subsets": [
{
"addresses": [
{
{% for host in groups['gfs-cluster'] %}
"ip": "{{hostvars[host]['ansible_eth0']['ipv4']['address']}}"{%- if not loop.last %}, {% endif -%}
{% endfor %}
}
],
"ports": [
{
"port": 1
}
]
}
]
}

View file

@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: gluster-default-volume
spec:
accessModes:
- ReadWriteMany
glusterfs:
endpoints: glusterfs-cluster
path: gluster
readOnly: false
persistentVolumeReclaimPolicy: Retain