diff options
-rwxr-xr-x | ansible/group_vars/infrastructure.yml | 3 | ||||
-rw-r--r-- | ansible/roles/dns/molecule/default/cleanup.yml | 6 | ||||
l--------- | ansible/roles/helm/molecule/default/group_vars/infrastructure.yml | 1 | ||||
-rw-r--r-- | ansible/roles/helm/molecule/default/prepare.yml | 5 | ||||
-rw-r--r-- | ansible/roles/helm/tasks/main.yml | 8 | ||||
-rw-r--r-- | ansible/roles/rke/defaults/main.yml | 2 | ||||
-rw-r--r-- | ansible/test/play-infrastructure/molecule/default/cleanup.yml | 1 | ||||
-rw-r--r-- | ansible/test/roles/cleanup-dns/tasks/main.yml | 6 | ||||
-rw-r--r-- | ansible/test/roles/prepare-helm/defaults/main.yml | 3 | ||||
-rw-r--r-- | ansible/test/roles/prepare-helm/tasks/main.yml | 14 | ||||
-rw-r--r-- | ansible/test/roles/prepare-rke/tasks/infra.yml | 2 | ||||
-rw-r--r-- | docs/BuildGuide.rst | 20 | ||||
-rw-r--r-- | docs/InstallGuide.rst | 95 |
13 files changed, 89 insertions, 77 deletions
diff --git a/ansible/group_vars/infrastructure.yml b/ansible/group_vars/infrastructure.yml index 08a25919..fc0699c5 100755 --- a/ansible/group_vars/infrastructure.yml +++ b/ansible/group_vars/infrastructure.yml @@ -25,9 +25,10 @@ simulated_hosts: - registry.hub.docker.com - registry.npmjs.org all_simulated_hosts: - "{{ simulated_hosts.git + simulated_hosts.http + simulated_hosts.nexus }}" + "{{ simulated_hosts.git + simulated_hosts.http + simulated_hosts.nexus }}" populate_nexus: false helm_bin_dir: /usr/local/bin +helm_version: v2.12.3 rancher_server_image: rancher/server:v1.6.22 vnc_server_image: consol/ubuntu-icewm-vnc:1.4.0 nexus3_image: sonatype/nexus3:3.15.2 diff --git a/ansible/roles/dns/molecule/default/cleanup.yml b/ansible/roles/dns/molecule/default/cleanup.yml new file mode 100644 index 00000000..60195bb3 --- /dev/null +++ b/ansible/roles/dns/molecule/default/cleanup.yml @@ -0,0 +1,6 @@ +--- +- name: Cleanup + hosts: all + ignore_unreachable: true + roles: + - cleanup-dns diff --git a/ansible/roles/helm/molecule/default/group_vars/infrastructure.yml b/ansible/roles/helm/molecule/default/group_vars/infrastructure.yml new file mode 120000 index 00000000..3e9c2f0c --- /dev/null +++ b/ansible/roles/helm/molecule/default/group_vars/infrastructure.yml @@ -0,0 +1 @@ +../../../../../group_vars/infrastructure.yml
\ No newline at end of file diff --git a/ansible/roles/helm/molecule/default/prepare.yml b/ansible/roles/helm/molecule/default/prepare.yml index 8a149b89..34c41e8e 100644 --- a/ansible/roles/helm/molecule/default/prepare.yml +++ b/ansible/roles/helm/molecule/default/prepare.yml @@ -1,5 +1,8 @@ --- - name: Prepare for helm tests - hosts: all + hosts: infrastructure + pre_tasks: + - name: Include infrastructure group variables + include_vars: ../../../../group_vars/infrastructure.yml roles: - prepare-helm diff --git a/ansible/roles/helm/tasks/main.yml b/ansible/roles/helm/tasks/main.yml index 2521ad28..c1b47103 100644 --- a/ansible/roles/helm/tasks/main.yml +++ b/ansible/roles/helm/tasks/main.yml @@ -1,7 +1,11 @@ --- - name: Install Helm - copy: - src: "{{ app_data_path }}/downloads/helm" + unarchive: + src: "{{ app_data_path }}/downloads/helm-{{ helm_version }}-linux-amd64.tar.gz" dest: "{{ helm_bin_dir }}" + extra_opts: + - --strip=1 + - --wildcards + - '*/helm' remote_src: true mode: 0755 diff --git a/ansible/roles/rke/defaults/main.yml b/ansible/roles/rke/defaults/main.yml index 88216857..2f160fc2 100644 --- a/ansible/roles/rke/defaults/main.yml +++ b/ansible/roles/rke/defaults/main.yml @@ -1,5 +1,5 @@ --- -rke_binary: rke +rke_binary: rke_linux-amd64 rke_username: rke rke_bin_dir: /usr/local/bin kube_config_dir: "{{ ansible_env.HOME }}/.kube" diff --git a/ansible/test/play-infrastructure/molecule/default/cleanup.yml b/ansible/test/play-infrastructure/molecule/default/cleanup.yml index 008543bd..74f38c51 100644 --- a/ansible/test/play-infrastructure/molecule/default/cleanup.yml +++ b/ansible/test/play-infrastructure/molecule/default/cleanup.yml @@ -7,4 +7,5 @@ roles: - cleanup-nginx - cleanup-nexus + - cleanup-dns - cleanup-vncserver diff --git a/ansible/test/roles/cleanup-dns/tasks/main.yml b/ansible/test/roles/cleanup-dns/tasks/main.yml new file mode 100644 index 00000000..738c3540 --- /dev/null +++ b/ansible/test/roles/cleanup-dns/tasks/main.yml @@ -0,0 +1,6 @@ +--- +- name: Remove saved dnsmasq image + delegate_to: localhost + file: + path: /tmp/dnsmasq.tar + state: absent diff --git a/ansible/test/roles/prepare-helm/defaults/main.yml b/ansible/test/roles/prepare-helm/defaults/main.yml deleted file mode 100644 index 8ab9ed3a..00000000 --- a/ansible/test/roles/prepare-helm/defaults/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -# Helm version to download. -helm_version: 2.12.3 diff --git a/ansible/test/roles/prepare-helm/tasks/main.yml b/ansible/test/roles/prepare-helm/tasks/main.yml index aa01e281..1f461258 100644 --- a/ansible/test/roles/prepare-helm/tasks/main.yml +++ b/ansible/test/roles/prepare-helm/tasks/main.yml @@ -5,14 +5,8 @@ recurse: true state: directory -- name: "Download and unarchive helm-{{ helm_version }}" - unarchive: - src: "https://get.helm.sh/helm-v{{ helm_version }}-linux-amd64.tar.gz" - dest: "/tmp" - remote_src: true - -- name: "Copy helm binary" - copy: - src: /tmp/linux-amd64/helm - dest: "{{ app_data_path }}/downloads/helm" +- name: "Download helm-{{ helm_version }}" + get_url: + url: "https://get.helm.sh/helm-{{ helm_version }}-linux-amd64.tar.gz" + dest: "{{ app_data_path }}/downloads" remote_src: true diff --git a/ansible/test/roles/prepare-rke/tasks/infra.yml b/ansible/test/roles/prepare-rke/tasks/infra.yml index 55ab7f16..e9971f77 100644 --- a/ansible/test/roles/prepare-rke/tasks/infra.yml +++ b/ansible/test/roles/prepare-rke/tasks/infra.yml @@ -7,7 +7,7 @@ - name: "Install rke-{{ rke_version }}" get_url: url: "https://github.com/rancher/rke/releases/download/v{{ rke_version }}/rke_linux-amd64" - dest: "{{ app_data_path }}/downloads/rke" + dest: "{{ app_data_path }}/downloads/rke_linux-amd64" - name: "Install kubectl-{{ kubectl_version }}" get_url: diff --git a/docs/BuildGuide.rst b/docs/BuildGuide.rst index cfddcc99..54878626 100644 --- a/docs/BuildGuide.rst +++ b/docs/BuildGuide.rst @@ -122,20 +122,7 @@ Following steps are still required and are not supported by current version of d ToDo: complete and verified list of http files will come just during/after vFWCL testcase - -**Step 4 - Binaries** - -:: - - # Binaries are downloaded in step one but some post processing is still needed. - # This will be improved in future in installer itself - - tar -xf ../resources/downloads/helm-v2.12.3-linux-amd64.tar.gz linux-amd64/helm -O > ../resources/downloads/helm - rm -f ../resources/downloads/helm-v2.12.3-linux-amd64.tar.gz - mv ../resources/downloads/rke_linux-amd64 rke - - -**Step 5 - Create repo** +**Step 4 - Create repo** :: @@ -304,11 +291,8 @@ ToDo: complete and verified list of http files will come just during/after vFWCL :: - # Following step will download and prepare rke, kubectl and helm binaries + # Following step will download rke, kubectl and helm binaries ./build/download/download.py --http ./build/data_lists/infra_bin_utils.sh ../resources/downloads - tar -xf ../resources/downloads/helm-v2.12.3-linux-amd64.tar.gz linux-amd64/helm -O > ../resources/downloads/helm - rm -f ../resources/downloads/helm-v2.12.3-linux-amd64.tar.gz - mv ../resources/downloads/rke_linux-amd64 rke **Step 7 - rpms** diff --git a/docs/InstallGuide.rst b/docs/InstallGuide.rst index 95b5749f..7e8ebf04 100644 --- a/docs/InstallGuide.rst +++ b/docs/InstallGuide.rst @@ -168,20 +168,29 @@ We need to setup the ``'hosts.yml'`` first, the template looks like this:: # This is group of hosts which are/will be part of Kubernetes cluster. kubernetes: - hosts: - kubernetes-node-1: - ansible_host: 10.8.8.19 - #ip of the node that it uses for communication with k8s cluster. - cluster_ip: 10.8.8.19 - - # This is a group of hosts that are to be used as kubernetes control plane nodes. - # This means they host kubernetes api server, controller manager and scheduler. - # This example uses infra for this purpose, however note that any - # other host could be used including kubernetes nodes. - # cluster_ip needs to be set for hosts used as control planes. - kubernetes-control-plane: - hosts: - infrastructure-server + children: + # This is a group of hosts containing kubernetes worker nodes. + kubernetes-node: + hosts: + kubernetes-node-1: + ansible_host: 10.8.8.19 + #ip of the node that it uses for communication with k8s cluster. + cluster_ip: 10.8.8.19 + + # Group of hosts containing etcd cluster nodes. + # Defaults to infra. + kubernetes-etcd: + hosts: + infrastructure-server + + # This is a group of hosts that are to be used as kubernetes control plane nodes. + # This means they host kubernetes api server, controller manager and scheduler. + # This example uses infra for this purpose, however note that any + # other host could be used including kubernetes nodes. + # cluster_ip needs to be set for hosts used as control planes. + kubernetes-control-plane: + hosts: + infrastructure-server nfs-server: hosts: @@ -222,37 +231,43 @@ After all the changes, the ``'hosts.yml'`` should look similar to this:: infrastructure: hosts: infrastructure-server: - ansible_host: 10.8.8.100 + ansible_host: 10.8.8.13 #IP used for communication between infra and kubernetes nodes, must be specified. cluster_ip: 10.8.8.100 # This is group of hosts which are/will be part of Kubernetes cluster. kubernetes: - hosts: - kubernetes-node-1: - ansible_host: 10.8.8.101 - #ip of the node that it uses for communication with k8s cluster. - cluster_ip: 10.8.8.101 - kubernetes-node-2: - ansible_host: 10.8.8.102 - #ip of the node that it uses for communication with k8s cluster. - cluster_ip: 10.8.8.102 - kubernetes-node-3: - ansible_host: 10.8.8.103 - #ip of the node that it uses for communication with k8s cluster. - cluster_ip: 10.8.8.103 - - # This is a group of hosts that are to be used as kubernetes control plane nodes. - # This means they host kubernetes api server, controller manager and scheduler. - # This example uses infra for this purpose, however note that any - # other host could be used including kubernetes nodes. - # cluster_ip needs to be set for hosts used as control planes. - kubernetes-control-plane: - hosts: - infrastructure-server - ansible_host: 10.8.8.100 - #IP used for communication between infra and kubernetes nodes, must be specified. - cluster_ip: 10.8.8.100 + children: + # This is a group of hosts containing kubernetes worker nodes. + kubernetes-node: + hosts: + kubernetes-node-1: + ansible_host: 10.8.8.101 + #ip of the node that it uses for communication with k8s cluster. + cluster_ip: 10.8.8.101 + kubernetes-node-2: + ansible_host: 10.8.8.102 + #ip of the node that it uses for communication with k8s cluster. + cluster_ip: 10.8.8.102 + kubernetes-node-3: + ansible_host: 10.8.8.103 + #ip of the node that it uses for communication with k8s cluster. + cluster_ip: 10.8.8.103 + + # Group of hosts containing etcd cluster nodes. + # Defaults to infra. + kubernetes-etcd: + hosts: + infrastructure-server + + # This is a group of hosts that are to be used as kubernetes control plane nodes. + # This means they host kubernetes api server, controller manager and scheduler. + # This example uses infra for this purpose, however note that any + # other host could be used including kubernetes nodes. + # cluster_ip needs to be set for hosts used as control planes. + kubernetes-control-plane: + hosts: + infrastructure-server nfs-server: hosts: |