diff --git a/install/roles/automation-hub/defaults/main.yml b/install/roles/automation-hub/defaults/main.yml index c469ecdc..eac24a20 100644 --- a/install/roles/automation-hub/defaults/main.yml +++ b/install/roles/automation-hub/defaults/main.yml @@ -2,6 +2,7 @@ # defaults file for tealc infra_monitoring_namespace: tealc-monitoring infra_ci_namespace: tealc-pipelines +infra_workflow_namespace: skodjob-ci infra_argo_namespace: tealc-gitops openshift_pipelines_namespace: openshift-pipelines diff --git a/install/roles/automation-hub/tasks/infra-setup/install/install_argo_workflow.yaml b/install/roles/automation-hub/tasks/infra-setup/install/install_argo_workflow.yaml new file mode 100644 index 00000000..113dde18 --- /dev/null +++ b/install/roles/automation-hub/tasks/infra-setup/install/install_argo_workflow.yaml @@ -0,0 +1,74 @@ +--- +- name: Create {{ infra_workflow_namespace }} namespace on Infra cluster + kubernetes.core.k8s: + kubeconfig: "{{ kubeconfig_path }}/{{ infra_context_name }}" + verify_ssl: no + state: present + definition: + apiVersion: v1 + kind: Namespace + metadata: + name: "{{ infra_workflow_namespace }}" + labels: + project: "skodjob" + secret: "cert-manager" + +- name: Clean helm releases for workflows + shell: "oc delete secret -l owner=helm -n {{ infra_workflow_namespace }} || true" + environment: + KUBECONFIG: "{{ kubeconfig_path }}/{{ infra_context_name }}" + +- name: Make default SA admin in {{ infra_workflow_namespace }} namespace + shell: "oc adm policy add-role-to-user admin system:serviceaccount:{{ infra_workflow_namespace }}:default -n {{ infra_workflow_namespace }}" + environment: + KUBECONFIG: "{{ kubeconfig_path }}/{{ infra_context_name }}" + +- name: Add Argo Helm Repo + kubernetes.core.helm_repository: + name: argo + url: https://argoproj.github.io/argo-helm + +- name: Install Argo Workflow + kubernetes.core.helm: + name: "{{ infra_workflow_namespace }}" + kubeconfig: "{{ kubeconfig_path }}/{{ infra_context_name }}" + chart_ref: argo/argo-workflows + release_namespace: "{{ infra_workflow_namespace }}" + create_namespace: True + purge: True + force: True + wait: True + replace: True + update_repo_cache: True + values: + commonLabels: + app: skodjob + project: skodjob + server: + replicas: 3 + authModes: + - client + - server + ingress: + enabled: true + hosts: + - "workflows.apps.{{ infra_root_domain }}" + tls: + - secretName: "{{ cm_certificate_secret }}" + hosts: + - "workflows.apps.{{ infra_root_domain }}" + +- name: Install Argo Events + kubernetes.core.helm: + name: "{{ infra_workflow_namespace }}-events" + kubeconfig: "{{ kubeconfig_path }}/{{ infra_context_name }}" + chart_ref: argo/argo-events + release_namespace: "{{ infra_workflow_namespace }}" + create_namespace: True + purge: True + force: True + wait: True + replace: True + update_repo_cache: True + values: + openshift: true diff --git a/install/roles/automation-hub/tasks/main.yml b/install/roles/automation-hub/tasks/main.yml index 1ad25839..924bc84c 100644 --- a/install/roles/automation-hub/tasks/main.yml +++ b/install/roles/automation-hub/tasks/main.yml @@ -94,6 +94,9 @@ - import_tasks: infra-setup/install/orchestrate_acs.yaml tags: [acs, infra, security, never] +- import_tasks: infra-setup/install/install_argo_workflow.yaml + tags: [infra, ci, workflow, never] + - import_tasks: infra-setup/install/install_links.yaml tags: [infra, console-link, links, never]