From 0408e12d0892a634cf63fcf384974797291d9fa2 Mon Sep 17 00:00:00 2001 From: Yibo Cai Date: Thu, 7 Dec 2017 17:15:07 +0800 Subject: deploy/k8s: support k8s deployment on aarch64 Kubespray default variables are for x86_64. To support deploying AArch64 node, many variables must be redefined. This patch adds a file to override default kubespray variables, so we can track all changes in compass4nfv code. Change-Id: Ic6180ea9c50302d1a6cef1e0e7a3abea6699ef55 Signed-off-by: Yibo Cai --- .../roles/kargo/files/extra-vars-aarch64.yml | 33 ++++++++++++++++++++++ .../kubernetes/roles/kargo/files/extra-vars.yml | 7 +++++ .../ansible/kubernetes/roles/kargo/tasks/main.yml | 11 +++++++- 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 deploy/adapters/ansible/kubernetes/roles/kargo/files/extra-vars-aarch64.yml create mode 100644 deploy/adapters/ansible/kubernetes/roles/kargo/files/extra-vars.yml (limited to 'deploy/adapters/ansible') diff --git a/deploy/adapters/ansible/kubernetes/roles/kargo/files/extra-vars-aarch64.yml b/deploy/adapters/ansible/kubernetes/roles/kargo/files/extra-vars-aarch64.yml new file mode 100644 index 00000000..26e3fa75 --- /dev/null +++ b/deploy/adapters/ansible/kubernetes/roles/kargo/files/extra-vars-aarch64.yml @@ -0,0 +1,33 @@ +--- +# Override default kubespray variables + +# roles/download/defaults/main.yml +etcd_version: v3.2.4-arm64 +flannel_version: "v0.8.0-arm64" +flannel_cni_image_repo: "linaro/flannel-cni-arm64" +hyperkube_image_repo: "gcr.io/google-containers/hyperkube-arm64" +hyperkube_image_tag: "{{ kube_version }}" +pod_infra_image_repo: "gcr.io/google_containers/pause-arm64" +nginx_image_tag: 1.13 +kubedns_image_repo: "gcr.io/google_containers/k8s-dns-kube-dns-arm64" +dnsmasq_nanny_image_repo: "gcr.io/google_containers/k8s-dns-dnsmasq-nanny-arm64" +dnsmasq_sidecar_image_repo: "gcr.io/google_containers/k8s-dns-sidecar-arm64" +kubednsautoscaler_image_repo: "gcr.io/google_containers/\ +cluster-proportional-autoscaler-arm64" + +# inventory/group_vars/k8s-cluster.yml +kube_network_plugin: flannel +helm_enabled: false +docker_options: "--insecure-registry={{ kube_service_addresses }} \ +--graph={{ docker_daemon_graph }} {{ docker_log_opts }} \ +--add-runtime docker-runc=/usr/libexec/docker/docker-runc-current \ +--default-runtime=docker-runc \ +--exec-opt native.cgroupdriver=systemd \ +--userland-proxy-path=/usr/libexec/docker/docker-proxy-current \ +--signature-verification=false" + +# roles/docker/vars/redhat.yml +docker_package_info: + pkg_mgr: yum + pkgs: + - name: docker diff --git a/deploy/adapters/ansible/kubernetes/roles/kargo/files/extra-vars.yml b/deploy/adapters/ansible/kubernetes/roles/kargo/files/extra-vars.yml new file mode 100644 index 00000000..e13e33ca --- /dev/null +++ b/deploy/adapters/ansible/kubernetes/roles/kargo/files/extra-vars.yml @@ -0,0 +1,7 @@ +--- +# Override default kubespray variables + +# Just a placeholder to satisfy ansible +dummy_var: 0 + +# helm_enabled: true diff --git a/deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml b/deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml index 4df8dffa..2763e53e 100644 --- a/deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml +++ b/deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml @@ -96,9 +96,18 @@ regexp: '^helm_enabled:' line: 'helm_enabled: {{ helm_flag }}' +- name: copy overrided variables + copy: + src: "{{ item }}" + dest: /opt/kargo_k8s/extra-vars.yml + with_first_found: + - extra-vars-{{ ansible_architecture }}.yml + - extra-vars.yml + - name: run kargo playbook shell: | cd /opt/kargo_k8s - ansible-playbook -i inventory/inventory.cfg cluster.yml -b -v 2>&1 | tee kargo.log + ansible-playbook -i inventory/inventory.cfg cluster.yml \ + -e "@extra-vars.yml" -b -v 2>&1 | tee kargo.log tags: - ansible -- cgit 1.2.3-korg