etcd can run on a distinct cluster

This commit is contained in:
Smaine Kahlouch 2015-12-14 10:39:13 +01:00
parent 5efc09710b
commit 2fc8b46996
4 changed files with 16 additions and 5 deletions

View file

@ -32,6 +32,10 @@ Edit the inventory according to the number of servers
[kube-master] [kube-master]
10.115.99.31 10.115.99.31
[etcd]
10.115.99.31
10.115.99.32
[kube-node] [kube-node]
10.115.99.32 10.115.99.32
10.115.99.33 10.115.99.33
@ -76,6 +80,10 @@ In node-mesh mode the nodes peers with all the nodes in order to exchange routes
10.99.0.26 10.99.0.26
10.99.0.59 10.99.0.59
[etcd]
10.99.0.26
10.99.0.59
[kube-node] [kube-node]
10.99.0.59 10.99.0.59
10.99.0.4 10.99.0.4
@ -115,7 +123,7 @@ loadbalancer_address="10.99.0.44"
- { role: download, tags: download } - { role: download, tags: download }
# etcd must be running on master(s) before going on # etcd must be running on master(s) before going on
- hosts: kube-master - hosts: etcd
roles: roles:
- { role: etcd, tags: etcd } - { role: etcd, tags: etcd }

View file

@ -5,7 +5,7 @@
- { role: download, tags: download } - { role: download, tags: download }
# etcd must be running on master(s) before going on # etcd must be running on master(s) before going on
- hosts: kube-master - hosts: etcd
roles: roles:
- { role: etcd, tags: etcd } - { role: etcd, tags: etcd }

View file

@ -11,7 +11,8 @@ spec:
- /hyperkube - /hyperkube
- apiserver - apiserver
- --insecure-bind-address=0.0.0.0 - --insecure-bind-address=0.0.0.0
- --etcd-servers=http://{{ hostvars[inventory_hostname]['ip'] | default( ansible_default_ipv4.address) }}:2379 - --etcd-servers={% for srv in groups['etcd'] %}http://{{ srv }}:2379{% if not loop.last %},{% endif %}{% endfor %}
- --admission-control=NamespaceLifecycle,NamespaceExists,LimitRanger,SecurityContextDeny,ServiceAccount,ResourceQuota - --admission-control=NamespaceLifecycle,NamespaceExists,LimitRanger,SecurityContextDeny,ServiceAccount,ResourceQuota
- --service-cluster-ip-range={{ kube_service_addresses }} - --service-cluster-ip-range={{ kube_service_addresses }}
- --client-ca-file={{ kube_cert_dir }}/ca.pem - --client-ca-file={{ kube_cert_dir }}/ca.pem

View file

@ -10,7 +10,8 @@ spec:
image: gcr.io/google_containers/podmaster:1.1 image: gcr.io/google_containers/podmaster:1.1
command: command:
- /podmaster - /podmaster
- --etcd-servers=http://127.0.0.1:2379 - --etcd-servers={% for srv in groups['etcd'] %}http://{{ srv }}:2379{% if not loop.last %},{% endif %}{% endfor %}
- --key=scheduler - --key=scheduler
- --source-file={{ kube_config_dir}}/kube-scheduler.manifest - --source-file={{ kube_config_dir}}/kube-scheduler.manifest
- --dest-file={{ kube_manifest_dir }}/kube-scheduler.manifest - --dest-file={{ kube_manifest_dir }}/kube-scheduler.manifest
@ -24,7 +25,8 @@ spec:
image: gcr.io/google_containers/podmaster:1.1 image: gcr.io/google_containers/podmaster:1.1
command: command:
- /podmaster - /podmaster
- --etcd-servers=http://127.0.0.1:2379 - --etcd-servers={% for srv in groups['etcd'] %}http://{{ srv }}:2379{% if not loop.last %},{% endif %}{% endfor %}
- --key=controller - --key=controller
- --source-file={{ kube_config_dir }}/kube-controller-manager.manifest - --source-file={{ kube_config_dir }}/kube-controller-manager.manifest
- --dest-file={{ kube_manifest_dir }}/kube-controller-manager.manifest - --dest-file={{ kube_manifest_dir }}/kube-controller-manager.manifest