diff options
author | Bartek Grzybowski <b.grzybowski@partner.samsung.com> | 2022-04-08 14:09:36 +0200 |
---|---|---|
committer | Bartek Grzybowski <b.grzybowski@partner.samsung.com> | 2022-04-19 10:35:52 +0000 |
commit | 7cbde01bcf32d2f9ec16aa76a55a9872522a12e1 (patch) | |
tree | de8e0d48c1a6d28c98324580c19c1092fda9a4a0 /ansible | |
parent | 6e2bb4161a493afcbf575f745d91bfbf1f054551 (diff) |
[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 <b.grzybowski@partner.samsung.com>
Diffstat (limited to 'ansible')
-rwxr-xr-x | ansible/group_vars/infrastructure.yml | 1 | ||||
-rw-r--r-- | ansible/roles/strimzi-kafka-operator/defaults/main.yml | 8 | ||||
-rw-r--r-- | ansible/roles/strimzi-kafka-operator/tasks/main.yml | 22 | ||||
-rw-r--r-- | ansible/site.yml | 1 | ||||
-rw-r--r-- | ansible/strimzi_kafka.yml | 5 |
5 files changed, 37 insertions, 0 deletions
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 |