From 3723597e9be962b47ac70e86f9b731a7f2bc91a3 Mon Sep 17 00:00:00 2001 From: Carlos Camacho Date: Fri, 14 Jul 2023 18:49:26 +0200 Subject: [PATCH] feat: include kustomize This commit adds kustomize by default in each distro. --- kubeinit/roles/kubeinit_cdk/tasks/main.yml | 11 +++++++++++ kubeinit/roles/kubeinit_eks/tasks/main.yml | 11 +++++++++++ kubeinit/roles/kubeinit_k8s/tasks/main.yml | 11 +++++++++++ kubeinit/roles/kubeinit_openshift/tasks/main.yml | 10 ++++++++++ kubeinit/roles/kubeinit_rke/tasks/main.yml | 11 +++++++++++ 5 files changed, 54 insertions(+) diff --git a/kubeinit/roles/kubeinit_cdk/tasks/main.yml b/kubeinit/roles/kubeinit_cdk/tasks/main.yml index 36ab7a62c..e8a22991d 100644 --- a/kubeinit/roles/kubeinit_cdk/tasks/main.yml +++ b/kubeinit/roles/kubeinit_cdk/tasks/main.yml @@ -199,6 +199,17 @@ changed_when: "_result.rc == 0" delegate_to: "{{ kubeinit_provision_service_node }}" +- name: Install kustomize + ansible.builtin.shell: | + curl -sL https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv5.1.0/kustomize_v5.1.0_linux_amd64.tar.gz > kustomize.tar.gz + tar xzf ./kustomize.tar.gz + mv ./kustomize /bin/ + args: + executable: /bin/bash + register: _result + changed_when: "_result.rc == 0" + delegate_to: "{{ kubeinit_provision_service_node }}" + - name: Autoload kubeconfig ansible.builtin.shell: | echo "export KUBECONFIG=~/.kube/config" >> ~/.bashrc diff --git a/kubeinit/roles/kubeinit_eks/tasks/main.yml b/kubeinit/roles/kubeinit_eks/tasks/main.yml index bd1436a16..2f37d61e0 100644 --- a/kubeinit/roles/kubeinit_eks/tasks/main.yml +++ b/kubeinit/roles/kubeinit_eks/tasks/main.yml @@ -299,6 +299,17 @@ kubeinit_deployment_node_name: "{{ kubeinit_provision_service_node }}" delegate_to: "{{ kubeinit_deployment_node_name }}" +- name: Install kustomize + ansible.builtin.shell: | + curl -sL https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv5.1.0/kustomize_v5.1.0_linux_amd64.tar.gz > kustomize.tar.gz + tar xzf ./kustomize.tar.gz + mv ./kustomize /bin/ + args: + executable: /bin/bash + register: _result + changed_when: "_result.rc == 0" + delegate_to: "{{ kubeinit_provision_service_node }}" + - name: Deploy EKS manifests ansible.builtin.shell: | kubectl apply -f https://distro.eks.amazonaws.com/crds/releases.distro.eks.amazonaws.com-v1alpha1.yaml diff --git a/kubeinit/roles/kubeinit_k8s/tasks/main.yml b/kubeinit/roles/kubeinit_k8s/tasks/main.yml index 859f5d58a..902cda793 100644 --- a/kubeinit/roles/kubeinit_k8s/tasks/main.yml +++ b/kubeinit/roles/kubeinit_k8s/tasks/main.yml @@ -224,6 +224,17 @@ mode: '0644' delegate_to: "{{ kubeinit_provision_service_node }}" +- name: Install kustomize + ansible.builtin.shell: | + curl -sL https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv5.1.0/kustomize_v5.1.0_linux_amd64.tar.gz > kustomize.tar.gz + tar xzf ./kustomize.tar.gz + mv ./kustomize /bin/ + args: + executable: /bin/bash + register: _result + changed_when: "_result.rc == 0" + delegate_to: "{{ kubeinit_provision_service_node }}" + # # Configure additional steps for including the Windows compute nodes # diff --git a/kubeinit/roles/kubeinit_openshift/tasks/main.yml b/kubeinit/roles/kubeinit_openshift/tasks/main.yml index 8ed2d2c7b..c1ed559b2 100644 --- a/kubeinit/roles/kubeinit_openshift/tasks/main.yml +++ b/kubeinit/roles/kubeinit_openshift/tasks/main.yml @@ -166,6 +166,16 @@ register: _result changed_when: "_result.rc == 0" + - name: Install kustomize + ansible.builtin.shell: | + curl -sL https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv5.1.0/kustomize_v5.1.0_linux_amd64.tar.gz > kustomize.tar.gz + tar xzf ./kustomize.tar.gz + mv ./kustomize /bin/ + args: + executable: /bin/bash + register: _result + changed_when: "_result.rc == 0" + - name: Get some final cluster information ansible.builtin.shell: | set -eo pipefail diff --git a/kubeinit/roles/kubeinit_rke/tasks/main.yml b/kubeinit/roles/kubeinit_rke/tasks/main.yml index bd119ea04..fb11b1e0c 100644 --- a/kubeinit/roles/kubeinit_rke/tasks/main.yml +++ b/kubeinit/roles/kubeinit_rke/tasks/main.yml @@ -87,6 +87,17 @@ changed_when: "_result.rc == 0" delegate_to: "{{ kubeinit_provision_service_node }}" +- name: Install kustomize + ansible.builtin.shell: | + curl -sL https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv5.1.0/kustomize_v5.1.0_linux_amd64.tar.gz > kustomize.tar.gz + tar xzf ./kustomize.tar.gz + mv ./kustomize /bin/ + args: + executable: /bin/bash + register: _result + changed_when: "_result.rc == 0" + delegate_to: "{{ kubeinit_provision_service_node }}" + - name: Allow schedule workloads in controller nodes if there are no compute nodes ansible.builtin.shell: | set -o pipefail