From 6578753dffe0f2c0828df345ec371945cdc03cb0 Mon Sep 17 00:00:00 2001 From: Bartek Grzybowski Date: Tue, 9 Feb 2021 12:59:23 +0100 Subject: Ensure k8s namespace for ONAP exists Helm v3 does not automatically create namespace when either of "install" or "upgrade" subcommand is called even with "--namespace" option. Change-Id: I8595d8d9cdcb904b6c032695bae4d945fd07176c Issue-ID: OOM-2665 Signed-off-by: Bartek Grzybowski --- ansible/roles/application/tasks/install.yml | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ansible/roles') diff --git a/ansible/roles/application/tasks/install.yml b/ansible/roles/application/tasks/install.yml index fdb74af6..883e2aa6 100644 --- a/ansible/roles/application/tasks/install.yml +++ b/ansible/roles/application/tasks/install.yml @@ -36,6 +36,12 @@ debug: var: helm_override_files +- name: "Ensure kubernetes namespace for {{ app_name }} exists" + command: kubectl create namespace {{ app_kubernetes_namespace }} + register: kubectl_out + changed_when: kubectl_out.rc == 0 + failed_when: kubectl_out.rc == 1 and "AlreadyExists" not in kubectl_out.stderr + - name: "Helm Install application {{ app_name }}" command: > {{ helm_bin_dir }}/helm -- cgit 1.2.3-korg