diff options
author | hu xinhui <xinhui_hu@foxmail.com> | 2017-09-29 17:06:33 +0800 |
---|---|---|
committer | hu xinhui <xinhui_hu@foxmail.com> | 2017-09-30 15:54:28 +0800 |
commit | 179cd6db9f1bd9be1606187cf74e128bede7a8e6 (patch) | |
tree | 5b6f6b381e594b42cb9bf8ac3cf45009a566be1c /deploy/compass_conf | |
parent | f70d3aa8ffe7878e86b8f12c91c99018924a74b3 (diff) |
Modification for kargo to generate dynamic inventory
JIRA: -
There is some hardcode for kargo inventory.This patch is to generate dynamic inventory for kargo
Change-Id: If4a7c5f973e520e4ca24c3c9e0bfa97725a5a44c
Signed-off-by: hu xinhui <xinhui_hu@foxmail.com>
Diffstat (limited to 'deploy/compass_conf')
-rwxr-xr-x[-rw-r--r--] | deploy/compass_conf/flavor/kubernetes.conf | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | deploy/compass_conf/flavor_mapping/kubernetes.conf | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | deploy/compass_conf/flavor_metadata/ansible-kubernetes.conf | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | deploy/compass_conf/package_installer/ansible-kubernetes.conf | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | deploy/compass_conf/role/kubernetes_ansible.conf | 126 | ||||
-rw-r--r-- | deploy/compass_conf/templates/ansible_installer/kubernetes/hosts/ansible-kubernetes.tmpl | 20 | ||||
-rw-r--r-- | deploy/compass_conf/templates/ansible_installer/kubernetes/vars/ansible-kubernetes.tmpl | 6 |
7 files changed, 28 insertions, 128 deletions
diff --git a/deploy/compass_conf/flavor/kubernetes.conf b/deploy/compass_conf/flavor/kubernetes.conf index 96b5f95f..35c43155 100644..100755 --- a/deploy/compass_conf/flavor/kubernetes.conf +++ b/deploy/compass_conf/flavor/kubernetes.conf @@ -4,7 +4,7 @@ FLAVORS = [{ 'display_name': 'ansible-kubernetes', 'template': 'ansible-kubernetes.tmpl', 'roles': [ - 'controller', 'compute', 'ha', 'odl', 'onos', 'opencontrail', 'ceph', 'ceph-adm', 'ceph-mon', 'ceph-osd', 'sec-patch', 'ceph-osd-node' + 'kube_master', 'etcd', 'kube_node' ], }] diff --git a/deploy/compass_conf/flavor_mapping/kubernetes.conf b/deploy/compass_conf/flavor_mapping/kubernetes.conf index e569ea46..e569ea46 100644..100755 --- a/deploy/compass_conf/flavor_mapping/kubernetes.conf +++ b/deploy/compass_conf/flavor_mapping/kubernetes.conf diff --git a/deploy/compass_conf/flavor_metadata/ansible-kubernetes.conf b/deploy/compass_conf/flavor_metadata/ansible-kubernetes.conf index f878d58c..f878d58c 100644..100755 --- a/deploy/compass_conf/flavor_metadata/ansible-kubernetes.conf +++ b/deploy/compass_conf/flavor_metadata/ansible-kubernetes.conf diff --git a/deploy/compass_conf/package_installer/ansible-kubernetes.conf b/deploy/compass_conf/package_installer/ansible-kubernetes.conf index c706ccb2..32590c82 100644..100755 --- a/deploy/compass_conf/package_installer/ansible-kubernetes.conf +++ b/deploy/compass_conf/package_installer/ansible-kubernetes.conf @@ -7,7 +7,7 @@ SETTINGS = { 'playbook_file': 'site.yml', 'inventory_file': 'inventory.py', 'inventory_json_file': 'inventory.json', - 'inventory_group': ['controller', 'compute', 'ha', 'odl', 'onos', 'opencontrail', 'ceph_adm', 'ceph_mon', 'ceph_osd', 'moon'], + 'inventory_group': ['kube_master', 'etcd', 'kube_node'], 'group_variable': 'all', 'etc_hosts_path': 'roles/pre-k8s/templates/hosts', 'runner_dirs': ['roles','kubernetes/roles'] diff --git a/deploy/compass_conf/role/kubernetes_ansible.conf b/deploy/compass_conf/role/kubernetes_ansible.conf index 89c03d94..ae096f47 100644..100755 --- a/deploy/compass_conf/role/kubernetes_ansible.conf +++ b/deploy/compass_conf/role/kubernetes_ansible.conf @@ -1,115 +1,15 @@ ADAPTER_NAME = 'kubernetes' ROLES = [{ - 'role': 'allinone-compute', - 'display_name': 'all in one', - 'description': 'All in One' -}, { - 'role': 'controller', - 'display_name': 'controller node', - 'description': 'Controller Node' -}, { - 'role': 'compute', - 'display_name': 'compute node', - 'description': 'Compute Node' -}, { - 'role': 'storage', - 'display_name': 'storage node', - 'description': 'Storage Node' -}, { - 'role': 'network', - 'display_name': 'network node', - 'description': 'Network Node' -}, { - 'role': 'compute-worker', - 'display_name': 'Compute worker node', - 'description': 'Compute worker node' -}, { - 'role': 'compute-controller', - 'display_name': 'Compute controller node', - 'description': 'Compute controller node' -}, { - 'role': 'network-server', - 'display_name': 'Network server node', - 'description': 'Network server node' -}, { - 'role': 'database', - 'display_name': 'Database node', - 'description': 'Database node' -}, { - 'role': 'messaging', - 'display_name': 'Messaging queue node', - 'description': 'Messaging queue node' -}, { - 'role': 'image', - 'display': 'Image node', - 'description': 'Image node' -}, { - 'role': 'dashboard', - 'display': 'Dashboard node', - 'description': 'Dashboard node' -}, { - 'role': 'identity', - 'display': 'Identity node', - 'description': 'Identity node' -}, { - 'role': 'storage-controller', - 'display': 'Storage controller node', - 'description': 'Storage controller node' -}, { - 'role': 'storage-volume', - 'display': 'Storage volume node', - 'description': 'Storage volume node' -}, { - 'role': 'network-worker', - 'display': 'Network worker node', - 'description': 'Network worker node' -}, { - 'role': 'odl', - 'display': 'open day light', - 'description': 'odl node', - 'optional': True -}, { - 'role': 'onos', - 'display': 'open network operating system', - 'description': 'onos node', - 'optional': True -}, { - 'role': 'opencontrail', - 'display': 'open contrail', - 'description': 'opencontrail node', - 'optional': True -}, { - 'role': 'ha', - 'display': 'Cluster with HA', - 'description': 'Cluster with HA node' -}, { - 'role': 'ceph-adm', - 'display': 'Ceph Admin Node', - 'description': 'Ceph Admin Node', - 'optional': True -}, { - 'role': 'ceph-mon', - 'display': 'Ceph Monitor Node', - 'description': 'Ceph Monitor Node', - 'optional': True -}, { - 'role': 'ceph-osd', - 'display': 'Ceph Storage Node', - 'description': 'Ceph Storage Node', - 'optional': True -}, { - 'role': 'ceph-osd-node', - 'display': 'Ceph osd install from node', - 'description': '', - 'optional': True -}, { - 'role': 'ceph', - 'display': 'ceph node', - 'description': 'ceph node', - 'optional': True -}, { - 'role': 'sec-patch', - 'display': 'sec-patch node', - 'description': 'Security Patch Node', - 'optional': True -}] + 'role': 'kube_master', + 'display_name': 'kubnernets master node', + 'description': ' include kube-api,kube-scheduler' +}, { + 'role': 'etcd', + 'display_name': 'etcd node', + 'description': 'etcd Node' +}, { + 'role': 'kube_node', + 'display_name': 'kube node', + 'description': 'kube Node' +} +] diff --git a/deploy/compass_conf/templates/ansible_installer/kubernetes/hosts/ansible-kubernetes.tmpl b/deploy/compass_conf/templates/ansible_installer/kubernetes/hosts/ansible-kubernetes.tmpl index 9d628b5e..0a9e3025 100644 --- a/deploy/compass_conf/templates/ansible_installer/kubernetes/hosts/ansible-kubernetes.tmpl +++ b/deploy/compass_conf/templates/ansible_installer/kubernetes/hosts/ansible-kubernetes.tmpl @@ -9,22 +9,22 @@ # localhost 127.0.0.1 localhost -#set controllers = $getVar('controller', []) -#set computes = $getVar('compute', []) -#if not $isinstance($controllers, list) - #set controllers = [$controllers] +#set kube_masters = $getVar('kube_master', []) +#set kube_nodes = $getVar('kube_node', []) +#if not $isinstance($kube_masters, list) + #set kube_masters = [$kube_masters] #end if -#if not $isinstance($compute, list) - #set computes = [$computes] +#if not $isinstance($kube_nodes, list) + #set kube_nodes = [$kube_nodes] #end if -# controller -#for worker in $controllers +# kube_master +#for worker in $kube_masters #set worker_hostname = $worker.hostname #set worker_ip = $ip_settings[$worker_hostname].mgmt.ip $worker_ip $worker_hostname #end for -# compute -#for worker in $computes +# kube_node +#for worker in $kube_nodes #set worker_hostname = $worker.hostname #set worker_ip = $ip_settings[$worker_hostname].mgmt.ip $worker_ip $worker_hostname diff --git a/deploy/compass_conf/templates/ansible_installer/kubernetes/vars/ansible-kubernetes.tmpl b/deploy/compass_conf/templates/ansible_installer/kubernetes/vars/ansible-kubernetes.tmpl index 27211e06..440bf7d7 100644 --- a/deploy/compass_conf/templates/ansible_installer/kubernetes/vars/ansible-kubernetes.tmpl +++ b/deploy/compass_conf/templates/ansible_installer/kubernetes/vars/ansible-kubernetes.tmpl @@ -20,8 +20,8 @@ #set has = $getVar('ha', []) #set ha_vip = $getVar('ha_vip', []) -#set controllers = $getVar('controller', []) -#set computers = $getVar('compute', []) +#set kube_masters = $getVar('kube_master', []) +#set kube_nodes = $getVar('kube_node', []) enable_secgroup: $getVar('enable_secgroup', True) enable_fwaas: $getVar('enable_fwaas', True) @@ -35,7 +35,7 @@ network_cfg: $network_cfg sys_intf_mappings: $sys_intf_mappings deploy_type: $getVar('deploy_type', 'virtual') -public_cidr: $computers[0]['install']['subnet'] +public_cidr: $kube_nodes[0]['install']['subnet'] storage_cidr: "{{ ip_settings[inventory_hostname]['storage']['cidr'] }}" mgmt_cidr: "{{ ip_settings[inventory_hostname]['mgmt']['cidr'] }}" |