diff options
author | HuabingZhao <zhao.huabing@zte.com.cn> | 2017-08-11 09:16:22 +0000 |
---|---|---|
committer | HuabingZhao <zhao.huabing@zte.com.cn> | 2017-08-11 09:19:23 +0000 |
commit | 3736aafdb168d76483a42acb552098244ceee034 (patch) | |
tree | ddd22127094ba06bd1dd74c6f3b23b437eae4066 /kube2consul/src/main/blueprint | |
parent | 012e88c913f39706fa6ae1b79c1fe0924ac1d2df (diff) |
Initial commit for registrator source codes
Change-Id: I0cdd285d6228f0a1b6a6b27787be09d2d7af3579
Issue-Id: OOM-61
Signed-off-by: HuabingZhao <zhao.huabing@zte.com.cn>
Diffstat (limited to 'kube2consul/src/main/blueprint')
-rw-r--r-- | kube2consul/src/main/blueprint/deploy.yml | 8 | ||||
-rw-r--r-- | kube2consul/src/main/blueprint/list_of_servicelet.list | 4 | ||||
-rw-r--r-- | kube2consul/src/main/blueprint/task.yml | 118 | ||||
-rw-r--r-- | kube2consul/src/main/blueprint/vars.yml | 14 |
4 files changed, 144 insertions, 0 deletions
diff --git a/kube2consul/src/main/blueprint/deploy.yml b/kube2consul/src/main/blueprint/deploy.yml new file mode 100644 index 0000000..cc61076 --- /dev/null +++ b/kube2consul/src/main/blueprint/deploy.yml @@ -0,0 +1,8 @@ +--- +- remote_user: ubuntu + become: yes + become_method: sudo + vars_files: + - vars.yml + tasks: + - include: task.yml diff --git a/kube2consul/src/main/blueprint/list_of_servicelet.list b/kube2consul/src/main/blueprint/list_of_servicelet.list new file mode 100644 index 0000000..77a1d4f --- /dev/null +++ b/kube2consul/src/main/blueprint/list_of_servicelet.list @@ -0,0 +1,4 @@ +{
+ "servicelet_module":[
+ ]
+}
\ No newline at end of file diff --git a/kube2consul/src/main/blueprint/task.yml b/kube2consul/src/main/blueprint/task.yml new file mode 100644 index 0000000..45cfcd9 --- /dev/null +++ b/kube2consul/src/main/blueprint/task.yml @@ -0,0 +1,118 @@ +--- +- name: remove kube2consul container + docker: + name: kube2consul + image: "{{kube2consul_image}}" + state: absent + +- name: run kube2consul container + docker: + name: kube2consul + image: "{{kube2consul_image}}" + log_driver: syslog + net: host + restart_policy: always + volumes: + - "{{ kube2consul_data_host }}:{{ kube2consul_data_container }}" + env: + KUBE_MASTER_IP: "{{kube_master_ip}}" + PDM_CONTROLLER_IP: "{{pdm_controller_ip}}" + JOIN_IP: "{{consul_join_ip}}" + when: + - all_in_one == 'no' + - master_in_controller == 'no' + - cluster_type == 'k8s' + +- name: run kube2consul container + docker: + name: kube2consul + image: "{{kube2consul_image}}" + net: host + restart_policy: always + privileged: true + volumes: + - "{{ kube2consul_data_host }}:{{ kube2consul_data_container }}" + - "/root/.kube/config:/root/.kube/config:ro" + env: + KUBE_MASTER_IP: "{{kube_master_ip}}" + PDM_CONTROLLER_IP: "{{pdm_controller_ip}}" + JOIN_IP: "{{consul_join_ip}}" + CLUSTER_TYPE: "openshift" + when: + - all_in_one == 'no' + - master_in_controller == 'no' + - cluster_type == 'openshift' + +- name: run kube2consul container + docker: + name: kube2consul + image: "{{kube2consul_image}}" + log_driver: syslog + restart_policy: always + volumes: + - "{{ kube2consul_data_host }}:{{ kube2consul_data_container }}" + env: + KUBE_MASTER_IP: "{{kube_master_ip}}" + PDM_CONTROLLER_IP: "{{pdm_controller_ip}}" + JOIN_IP: "{{consul_join_ip}}" + ALL_IN_ONE: "yes" + when: + - all_in_one == 'yes' + - cluster_type == 'k8s' + +- name: run kube2consul container + docker: + name: kube2consul + image: "{{kube2consul_image}}" + log_driver: syslog + restart_policy: always + privileged: true + volumes: + - "{{ kube2consul_data_host }}:{{ kube2consul_data_container }}" + - "/root/.kube/config:/root/.kube/config:ro" + env: + KUBE_MASTER_IP: "{{kube_master_ip}}" + PDM_CONTROLLER_IP: "{{pdm_controller_ip}}" + JOIN_IP: "{{consul_join_ip}}" + ALL_IN_ONE: "yes" + CLUSTER_TYPE: "openshift" + when: + - all_in_one == 'yes' + - cluster_type == 'openshift' + +- name: run kube2consul container + docker: + name: kube2consul + image: "{{kube2consul_image}}" + log_driver: syslog + restart_policy: always + volumes: + - "{{ kube2consul_data_host }}:{{ kube2consul_data_container }}" + env: + KUBE_MASTER_IP: "{{kube_master_ip}}" + PDM_CONTROLLER_IP: "{{pdm_controller_ip}}" + JOIN_IP: "{{consul_join_ip}}" + ALL_IN_ONE: "yes" + when: + - master_in_controller == 'yes' + - cluster_type == 'k8s' + +- name: run kube2consul container + docker: + name: kube2consul + image: "{{kube2consul_image}}" + log_driver: syslog + restart_policy: always + privileged: true + volumes: + - "{{ kube2consul_data_host }}:{{ kube2consul_data_container }}" + - "/root/.kube/config:/root/.kube/config:ro" + env: + KUBE_MASTER_IP: "{{kube_master_ip}}" + PDM_CONTROLLER_IP: "{{pdm_controller_ip}}" + JOIN_IP: "{{consul_join_ip}}" + ALL_IN_ONE: "yes" + CLUSTER_TYPE: "openshift" + when: + - master_in_controller == 'yes' + - cluster_type == 'openshift'
\ No newline at end of file diff --git a/kube2consul/src/main/blueprint/vars.yml b/kube2consul/src/main/blueprint/vars.yml new file mode 100644 index 0000000..971438d --- /dev/null +++ b/kube2consul/src/main/blueprint/vars.yml @@ -0,0 +1,14 @@ +--- +- api_network_ip: +- man_network_ip: +- registry_url: +- cp_vertype: +- cp_type: +- cp_name: +- cp_version: +- kube2consul_image: "{{registry_url}}/{{cp_type}}/{{cp_name}}:{{cp_version}}" +- kube_master_ip: "{{ hostvars[inventory_hostname]['api_network_ip'] }}" +- pdm_controller_ip: "{{vp_ip}}" +- consul_join_ip: "{{zenap_msb_consul_server_ip}}" +- kube2consul_data_host: "/home/zenap-msb/consul_data/kube2consul_{{kube_master_ip}}" +- kube2consul_data_container: "/consul-works/data-dir"
\ No newline at end of file |