diff options
Diffstat (limited to 'vagrant/playbooks')
-rw-r--r-- | vagrant/playbooks/configure-istio.yml | 7 | ||||
-rw-r--r-- | vagrant/playbooks/configure-krd.yml | 2 | ||||
-rw-r--r-- | vagrant/playbooks/configure-multus.yml | 11 | ||||
-rw-r--r-- | vagrant/playbooks/configure-nfd.yml | 8 | ||||
-rw-r--r-- | vagrant/playbooks/configure-ovn-kubernetes.yml | 5 | ||||
-rw-r--r-- | vagrant/playbooks/configure-ovn4nfv.yml | 98 | ||||
-rw-r--r-- | vagrant/playbooks/configure-virtlet.yml | 20 | ||||
-rw-r--r-- | vagrant/playbooks/krd-vars.yml | 26 |
8 files changed, 156 insertions, 21 deletions
diff --git a/vagrant/playbooks/configure-istio.yml b/vagrant/playbooks/configure-istio.yml index 25a343f0..2bd4e853 100644 --- a/vagrant/playbooks/configure-istio.yml +++ b/vagrant/playbooks/configure-istio.yml @@ -9,15 +9,15 @@ ############################################################################## - hosts: localhost - become: yes pre_tasks: - name: Load krd variables include_vars: file: krd-vars.yml roles: - - andrewrothstein.kubectl + - role: andrewrothstein.kubectl + kubectl_ver: "v{{ kubectl_version }}" - role: andrewrothstein.kubernetes-helm - kubernetes_helm_ver: v2.9.1 + kubernetes_helm_ver: "v{{ helm_client_version }}" tasks: - name: create istio folder file: @@ -35,6 +35,7 @@ dest: "{{ istio_dest }}" remote_src: yes - name: copy istioctl binary to usr/local/bin folder + become: yes command: "mv {{ istio_dest }}/istio-{{ istio_version }}/bin/istioctl /usr/local/bin/" when: istio_source_type == "tarball" - name: create network objects diff --git a/vagrant/playbooks/configure-krd.yml b/vagrant/playbooks/configure-krd.yml index c8146ed8..22e6419f 100644 --- a/vagrant/playbooks/configure-krd.yml +++ b/vagrant/playbooks/configure-krd.yml @@ -12,5 +12,5 @@ tasks: - name: copy admin.conf file to kube-nodes copy: - src: "{{ ansible_env.HOME}}/.kube/config" + src: "{{ lookup('env','krd_inventory_folder') }}/artifacts/admin.conf" dest: "/etc/kubernetes/admin.conf" diff --git a/vagrant/playbooks/configure-multus.yml b/vagrant/playbooks/configure-multus.yml index 33e72757..23fe546a 100644 --- a/vagrant/playbooks/configure-multus.yml +++ b/vagrant/playbooks/configure-multus.yml @@ -14,7 +14,9 @@ include_vars: file: krd-vars.yml roles: - - { role: andrewrothstein.go, when: multus_source_type == "source" } + - role: andrewrothstein.go + go_ver: "{{ go_version }}" + when: multus_source_type == "source" environment: PATH: "{{ ansible_env.PATH }}:/usr/local/go/bin/" tasks: @@ -78,8 +80,13 @@ } - hosts: localhost + pre_tasks: + - name: Load krd variables + include_vars: + file: krd-vars.yml roles: - - andrewrothstein.kubectl + - role: andrewrothstein.kubectl + kubectl_ver: "v{{ kubectl_version }}" tasks: - name: define a CRD network object specification blockinfile: diff --git a/vagrant/playbooks/configure-nfd.yml b/vagrant/playbooks/configure-nfd.yml index 90bad671..d47a7bcc 100644 --- a/vagrant/playbooks/configure-nfd.yml +++ b/vagrant/playbooks/configure-nfd.yml @@ -46,9 +46,13 @@ - node-feature-discovery-daemonset.json.template - hosts: localhost - become: yes + pre_tasks: + - name: Load krd variables + include_vars: + file: krd-vars.yml roles: - - andrewrothstein.kubectl + - role: andrewrothstein.kubectl + kubectl_ver: "v{{ kubectl_version }}" tasks: - name: create service accounts command: "/usr/local/bin/kubectl apply -f /tmp/{{ item }}" diff --git a/vagrant/playbooks/configure-ovn-kubernetes.yml b/vagrant/playbooks/configure-ovn-kubernetes.yml index cea102f2..e3042ff4 100644 --- a/vagrant/playbooks/configure-ovn-kubernetes.yml +++ b/vagrant/playbooks/configure-ovn-kubernetes.yml @@ -14,8 +14,13 @@ central_node_ip: "{{ hostvars[groups['ovn-central'][0]]['ansible_ssh_host'] }}" environment: PATH: "{{ ansible_env.PATH }}:/usr/local/go/bin/" + pre_tasks: + - name: Load krd variables + include_vars: + file: krd-vars.yml roles: - role: andrewrothstein.go + go_ver: "{{ go_version }}" tasks: - name: Load krd variables include_vars: diff --git a/vagrant/playbooks/configure-ovn4nfv.yml b/vagrant/playbooks/configure-ovn4nfv.yml new file mode 100644 index 00000000..c864b8c3 --- /dev/null +++ b/vagrant/playbooks/configure-ovn4nfv.yml @@ -0,0 +1,98 @@ +--- +# SPDX-license-identifier: Apache-2.0 +############################################################################## +# Copyright (c) 2018 +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +- import_playbook: configure-ovn.yml +- import_playbook: configure-multus.yml + +- hosts: kube-master:kube-node + environment: + PATH: "{{ ansible_env.PATH }}:/usr/local/go/bin/" + roles: + - role: andrewrothstein.go + tasks: + - name: Load krd variables + include_vars: + file: krd-vars.yml + - name: clone ovn4nfv-k8s-plugin repo + git: + repo: "{{ ovn4nfv_url }}" + dest: "{{ ovn4nfv_dest }}" + version: "{{ ovn4nfv_version }}" + force: yes + when: ovn4nfv_source_type == "source" + - name: clean ovn4nfvk8s left over files + make: + chdir: "{{ ovn4nfv_dest }}" + target: clean + - name: build ovn4nfvk8s-cni + make: + chdir: "{{ ovn4nfv_dest }}" + target: ovn4nfvk8s-cni + become: yes + environment: + GOPATH: "{{ go_path }}" + - name: copy ovn4nfvk8s-cni to cni folder + command: "mv {{ ovn4nfv_dest }}/ovn4nfvk8s-cni /opt/cni/bin/ovn4nfvk8s-cni" + become: yes + - name: create ovn4k8s config file + become: yes + blockinfile: + path: /etc/openvswitch/ovn4nfv_k8s.conf + create: yes + block: | + [logging] + loglevel=5 + logfile=/var/log/openvswitch/ovn4k8s.log + + [cni] + conf-dir=/etc/cni/net.d + plugin=ovn4nfvk8s-cni + + [kubernetes] + kubeconfig=/etc/kubernetes/admin.conf + - name: create ovnkube logging directory + file: + path: /var/log/openvswitch + state: directory + +- hosts: kube-master + environment: + PATH: "{{ ansible_env.PATH }}:/usr/local/go/bin/" + become: yes + tasks: + - name: Load krd variables + include_vars: + file: krd-vars.yml + - name: build ovn4nfvk8s + make: + chdir: "{{ ovn4nfv_dest }}" + target: ovn4nfvk8s + environment: + GOPATH: "{{ go_path }}" + - name: copy ovn4nfvk8s to /usr/bin folder + command: "mv {{ ovn4nfv_dest }}/ovn4nfvk8s /usr/bin/ovn4nfvk8s" + - name: create ovn4nfvk8s systemd service + blockinfile: + path: /etc/systemd/system/ovn4nfvk8s.service + create: yes + block: | + [Unit] + Description=OVN4NFV Kubernetes Daemon + + [Service] + ExecStart=/usr/bin/ovn4nfvk8s \ + -k8s-kubeconfig=/etc/kubernetes/admin.conf + + [Install] + WantedBy=multi-user.target + - name: start ovn4nfvk8s systemd service + service: + name: ovn4nfvk8s + state: started + enabled: yes diff --git a/vagrant/playbooks/configure-virtlet.yml b/vagrant/playbooks/configure-virtlet.yml index 98aa74cc..66deb5cb 100644 --- a/vagrant/playbooks/configure-virtlet.yml +++ b/vagrant/playbooks/configure-virtlet.yml @@ -8,7 +8,6 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## - hosts: localhost - become: yes vars: images_file: /tmp/images.yaml pre_tasks: @@ -16,8 +15,10 @@ include_vars: file: krd-vars.yml roles: - - andrewrothstein.kubectl - - { role: geerlingguy.docker, when: virtlet_source_type == "source" } + - role: andrewrothstein.kubectl + kubectl_ver: "v{{ kubectl_version }}" + - role: geerlingguy.docker + when: virtlet_source_type == "source" tasks: - name: create Virtlet binary folder file: @@ -65,10 +66,12 @@ - name: configure proxy values for docker service block: - name: create docker config folder + become: yes file: state: directory path: "/etc/systemd/system/docker.service.d" - name: Configure docker service to use http_proxy env value + become: yes blockinfile: dest: "/etc/systemd/system/docker.service.d/http-proxy.conf" create: yes @@ -78,6 +81,7 @@ when: - lookup('env','http_proxy') != "fooproxy" - name: Configure docker service to use https_proxy env value + become: yes blockinfile: dest: "/etc/systemd/system/docker.service.d/https-proxy.conf" create: yes @@ -87,6 +91,7 @@ when: - lookup('env','https_proxy') != "fooproxy" - name: Configure docker service to use no_proxy env value + become: yes blockinfile: dest: "/etc/systemd/system/docker.service.d/no-proxy.conf" create: yes @@ -96,8 +101,10 @@ when: - lookup('env','no_proxy') != "fooproxy" - name: reload systemd + become: yes command: systemctl daemon-reload - name: restart docker service + become: yes service: name: docker state: restarted @@ -134,7 +141,6 @@ delay: 10 - hosts: virtlet - become: yes tasks: - name: Load krd variables include_vars: @@ -144,18 +150,21 @@ state: directory path: "{{ criproxy_dest }}" - name: disable AppArmor in all nodes + become: yes service: name: apparmor state: stopped enabled: no when: ansible_os_family == "Debian" - name: modify args for kubelet service + become: yes lineinfile: dest: /etc/systemd/system/kubelet.service line: " --container-runtime=remote --container-runtime-endpoint=unix:///run/criproxy.sock --image-service-endpoint=unix:///run/criproxy.sock --enable-controller-attach-detach=false \\" insertafter: '^ExecStart=/usr/local/bin/kubelet *' state: present - name: create dockershim service + become: yes blockinfile: path: /etc/systemd/system/dockershim.service create: yes @@ -208,6 +217,7 @@ path: "{{ criproxy_dest }}/criproxy" mode: "+x" - name: create criproxy service + become: yes blockinfile: path: /etc/systemd/system/criproxy.service create: yes @@ -224,6 +234,7 @@ [Install] WantedBy=kubelet.service - name: start criproxy and dockershim services + become: yes service: name: "{{ item }}" state: started @@ -232,6 +243,7 @@ - dockershim - criproxy - name: restart kubelet services + become: yes service: name: kubelet state: restarted diff --git a/vagrant/playbooks/krd-vars.yml b/vagrant/playbooks/krd-vars.yml index 9c2de308..15b7a1a4 100644 --- a/vagrant/playbooks/krd-vars.yml +++ b/vagrant/playbooks/krd-vars.yml @@ -11,12 +11,12 @@ base_dest: /tmp multus_dest: "{{ base_dest }}/multus-cni" -multus_source_type: "tarball" -multus_version: 3.1 -multus_url: "https://github.com/intel/multus-cni/releases/download/v{{ multus_version }}/multus-cni_v{{ multus_version }}_linux_amd64.tar.gz" -#multus_source_type: "source" -#multus_version: def72938cd2fb272eb3a6f64a8162b1049404357 -#multus_url: "https://github.com/intel/multus-cni" +#multus_source_type: "tarball" +#multus_version: 3.1 +#multus_url: "https://github.com/intel/multus-cni/releases/download/v{{ multus_version }}/multus-cni_v{{ multus_version }}_linux_amd64.tar.gz" +multus_source_type: "source" +multus_version: 366f2120cb88c85deab6343b7062fd38fdb0ece9 +multus_url: "https://github.com/ritusood/multus-cni" ovn_kubernetes_dest: "{{ base_dest }}/ovn-kubernetes" ovn_kubernetes_source_type: "tarball" @@ -35,7 +35,7 @@ criproxy_url: "https://github.com/Mirantis/criproxy/releases/download/v{{ cripro #criproxy_url: "https://github.com/Mirantis/criproxy" virtlet_dest: "{{ base_dest }}/virtlet" virtlet_source_type: "binary" -virtlet_version: 1.4.1 +virtlet_version: 1.4.2 virtlet_url: "https://github.com/Mirantis/virtlet/releases/download/v{{ virtlet_version }}/virtletctl" #virtlet_source_type: "source" #virtlet_version: 68e11b8f1db2c78b063126899f0e60910700975d @@ -51,5 +51,13 @@ istio_source_type: "tarball" istio_version: 1.0.3 istio_url: "https://github.com/istio/istio/releases/download/{{ istio_version }}/istio-{{ istio_version }}-linux.tar.gz" -go_version: 1.11.1 -kubespray_version: 2.7.0 +go_path: "{{ base_dest }}/go" +ovn4nfv_dest: "{{ go_path }}/src/ovn4nfv-k8s-plugin" +ovn4nfv_source_type: "source" +ovn4nfv_version: 5026d1d89b05eac5e004279b742df6745a73d93a +ovn4nfv_url: "https://git.opnfv.org/ovn4nfv-k8s-plugin/" + +go_version: '1.11' +kubespray_version: 2.8.0 +kubectl_version: 1.11.2 +helm_client_version: 2.9.1 |