use ansible-galaxy

This commit is contained in:
Smaine Kahlouch 2015-10-14 11:42:45 +02:00
parent 6183a4d3b1
commit fec609053c
7 changed files with 71 additions and 18 deletions

View file

@ -50,8 +50,8 @@ The main variables to change are located in the directory ```environments/[env_n
- hosts: kube-master - hosts: kube-master
roles: roles:
- { role: kubernetes/master, tags: master } - { role: kubernetes/master, tags: master }
- { role: apps/k8s-skydns, tags: skydns } - { role: apps/k8s-skydns, tags: ['skydns', 'apps'] }
- { role: apps/k8s-kube-ui, tags: kube-ui } - { role: apps/k8s-fabric8, tags: ['fabric8', 'apps'] }
- hosts: kube-node - hosts: kube-node
roles: roles:
@ -111,27 +111,30 @@ iptables -nLv -t nat
#### Available apps, installation procedure #### Available apps, installation procedure
Additionnal apps can be installed as git submodules. Additionnal apps can be installed with ```ansible-galaxy```.
These submodules install Ansible roles, one role per app. you'll need to edit the file '*requirements.yml*' in order to chose needed apps.
The list of available apps are available [there](https://github.com/ansibl8s)
You can list available submodules with the following command:
```
grep path .gitmodules | sed 's/.*= //'
```
For instance if you will probably want to install a [dns server](https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/dns) as it is **strongly recommanded**. For instance if you will probably want to install a [dns server](https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/dns) as it is **strongly recommanded**.
In order to use this role you'll need to follow these steps In order to use this role you'll need the following entries in the file '*requirements.yml*'
``` ```
git submodule init roles/apps/k8s-common roles/apps/k8s-skydns - src: https://github.com/ansibl8s/k8s-common.git
git submodule update path: roles/apps
# version: v1.0
- src: https://github.com/ansibl8s/k8s-skydns.git
path: roles/apps
# version: v1.0
``` ```
**Note**: the role common is required by all the apps and provides the tasks and libraries needed.
Then update your playbook with the chosen role Then update your playbook with the chosen role
``` ```
... ...
- hosts: kube-master - hosts: kube-master
roles: roles:
- { role: kubernetes/master, tags: master } - { role: kubernetes/master, tags: master }
- { role: apps/k8s-skydns, tags: skydns } - { role: apps/k8s-skydns, tags: ['skydns', 'apps'] }
... ...
``` ```
Please refer to the [k8s-skydns readme](https://github.com/ansibl8s/k8s-skydns) for additionnal info. Please refer to the [k8s-skydns readme](https://github.com/ansibl8s/k8s-skydns) for additionnal info.
@ -175,3 +178,22 @@ Until now i didn't managed to get the monitoring addon working.
Currently the api-server listens on both secure and insecure ports. Currently the api-server listens on both secure and insecure ports.
The insecure port is mainly used for calico. The insecure port is mainly used for calico.
Will be fixed soon. Will be fixed soon.
How to contribute
------------------
### Update available roles
Alternatively the roles can be installed as git submodules.
That way is easier if you want to do some changes and commit them.
You can list available submodules with the following command:
```
grep path .gitmodules | sed 's/.*= //'
```
For instance if you will probably want to install a [dns server](https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/dns) as it is **strongly recommanded**.
In order to use this role you'll need to follow these steps
```
git submodule init roles/apps/k8s-common roles/apps/k8s-skydns
git submodule update
```

36
requirements.yml Normal file
View file

@ -0,0 +1,36 @@
---
- src: https://github.com/ansibl8s/k8s-common.git
path: roles/apps
# version: v1.0
- src: https://github.com/ansibl8s/k8s-skydns.git
path: roles/apps
# version: v1.0
#- src: https://github.com/ansibl8s/k8s-kube-ui.git
# path: roles/apps
# # version: v1.0
#
#- src: https://github.com/ansibl8s/k8s-fabric8.git
# path: roles/apps
# # version: v1.0
#
#- src: https://github.com/ansibl8s/k8s-elasticsearch.git
# path: roles/apps
# # version: v1.0
#
#- src: https://github.com/ansibl8s/k8s-redis.git
# path: roles/apps
# # version: v1.0
#
#- src: https://github.com/ansibl8s/k8s-memcached.git
# path: roles/apps
# # version: v1.0
#
#- src: https://github.com/ansibl8s/k8s-haproxy.git
# path: roles/apps
# # version: v1.0
#
#- src: https://github.com/ansibl8s/k8s-postgres.git
# path: roles/apps
# # version: v1.0

@ -1 +0,0 @@
Subproject commit 8a1b65075407adcb1d2bcdfbdf5d7479bbf6ce71

@ -1 +0,0 @@
Subproject commit 354e2b33c83b8d02d01d0b842c321cb060e12d3d

@ -1 +0,0 @@
Subproject commit 766ceeab47bb9122a11d066b0e95960a2ddc6fc1

@ -1 +0,0 @@
Subproject commit 62efba7e423a6b5cbd365a4f55d96c392e776e02

@ -1 +0,0 @@
Subproject commit b00d0ce5c952a9c0364f48babf95ad6357e82ccd