From 7cbde01bcf32d2f9ec16aa76a55a9872522a12e1 Mon Sep 17 00:00:00 2001 From: Bartek Grzybowski Date: Fri, 8 Apr 2022 14:09:36 +0200 Subject: [ANSIBLE][BUILD] Provision strimzi-kafka-operator Jakarta requires Strimzi Kafka Operator to be installed in the k8s cluster Change-Id: Id648c7f1e060923df5a5761daf3f2d20f4a49e39 Issue-ID: OOM-2948 Signed-off-by: Bartek Grzybowski --- ansible/group_vars/infrastructure.yml | 1 + .../roles/strimzi-kafka-operator/defaults/main.yml | 8 ++++++++ .../roles/strimzi-kafka-operator/tasks/main.yml | 22 ++++++++++++++++++++++ ansible/site.yml | 1 + ansible/strimzi_kafka.yml | 5 +++++ 5 files changed, 37 insertions(+) create mode 100644 ansible/roles/strimzi-kafka-operator/defaults/main.yml create mode 100644 ansible/roles/strimzi-kafka-operator/tasks/main.yml create mode 100644 ansible/strimzi_kafka.yml (limited to 'ansible') diff --git a/ansible/group_vars/infrastructure.yml b/ansible/group_vars/infrastructure.yml index 0861be12..7fb8e186 100755 --- a/ansible/group_vars/infrastructure.yml +++ b/ansible/group_vars/infrastructure.yml @@ -30,3 +30,4 @@ chartmuseum_server_image: chartmuseum/chartmuseum kube_prometheus_stack_enabled: false kube_prometheus_stack_version: 32.2.1 cert_manager_version: 1.5.4 +strimzi_kafka_version: 0.28.0 diff --git a/ansible/roles/strimzi-kafka-operator/defaults/main.yml b/ansible/roles/strimzi-kafka-operator/defaults/main.yml new file mode 100644 index 00000000..e543a580 --- /dev/null +++ b/ansible/roles/strimzi-kafka-operator/defaults/main.yml @@ -0,0 +1,8 @@ +--- +strimzi_kafka: + k8s_namespace: strimzi-system + helm_release_name: strimzi-kafka-operator + helm_timeout: "240s" + helm_values_file: "{{ app_data_path }}/strimzi_kafka.yaml" + helm_values: + watchAnyNamespace: true diff --git a/ansible/roles/strimzi-kafka-operator/tasks/main.yml b/ansible/roles/strimzi-kafka-operator/tasks/main.yml new file mode 100644 index 00000000..d6325167 --- /dev/null +++ b/ansible/roles/strimzi-kafka-operator/tasks/main.yml @@ -0,0 +1,22 @@ +--- +- name: Check {{ strimzi_kafka.helm_release_name }} helm package exists + stat: + path: "{{ app_data_path }}/downloads/strimzi-kafka-operator-helm-3-chart-{{ strimzi_kafka_version }}.tgz" + register: strimzi_kafka_package_stat + failed_when: not strimzi_kafka_package_stat.stat.exists + +- name: Generate helm values file + copy: + dest: "{{ strimzi_kafka.helm_values_file }}" + content: "{{ strimzi_kafka.helm_values | to_nice_yaml }}" + +- name: "Install Helm release {{ strimzi_kafka.helm_release_name }}" + community.kubernetes.helm: + release_name: "{{ strimzi_kafka.helm_release_name }}" + release_namespace: "{{ strimzi_kafka.k8s_namespace }}" + create_namespace: True + chart_ref: "{{ app_data_path }}/downloads/strimzi-kafka-operator-helm-3-chart-{{ strimzi_kafka_version }}.tgz" + values_files: "{{ strimzi_kafka.helm_values_file }}" + wait: True + wait_timeout: "{{ strimzi_kafka.helm_timeout }}" + tags: molecule-notest diff --git a/ansible/site.yml b/ansible/site.yml index 5308abf1..44a3ce07 100644 --- a/ansible/site.yml +++ b/ansible/site.yml @@ -20,4 +20,5 @@ - import_playbook: kube_prometheus.yml when: kube_prometheus_stack_enabled - import_playbook: cert_manager.yml +- import_playbook: strimzi_kafka.yml - import_playbook: application.yml diff --git a/ansible/strimzi_kafka.yml b/ansible/strimzi_kafka.yml new file mode 100644 index 00000000..05eba18c --- /dev/null +++ b/ansible/strimzi_kafka.yml @@ -0,0 +1,5 @@ +--- +- name: Provision strimzi-kafka-operator into Kubernetes cluster + hosts: infrastructure + roles: + - strimzi-kafka-operator -- cgit 1.2.3-korg