This commit is contained in:
root
2023-05-26 16:14:29 +09:00
parent 12c911a1c1
commit fdfe5b8e1c
18 changed files with 661 additions and 21 deletions

View File

@@ -2,17 +2,34 @@
command: "{{ role_path }}/files/postgres_check_data {{ cmoa_namespace }}"
register: pg_check_result
- name: 2. Insert Elasticsearch template
- name: 2.1. Change a Elasticsearch Service (NodePort=elasticsearch_nodePort)
kubernetes.core.k8s:
state: present
definition:
apiVersion: v1
kind: Service
metadata:
name: "{{ elasticsearch_service_name }}"
namespace: "{{ cmoa_namespace }}"
spec:
type: NodePort
ports:
- protocol: TCP
port: "{{ elasticsearch_service_port }}"
nodePort: "{{ elasticsearch_nodePort }}"
apply: yes
- name: 2.2. Insert Elasticsearch template
command: "sh {{ role_path }}/files/03-ddl-dml/elasticsearch/es-ddl-put.sh {{ cmoa_namespace }}"
- name: 2.1. Elasticsearch dependency deploy restart
- name: 2.3. Elasticsearch dependency deploy restart
command: "kubectl -n {{ cmoa_namespace }} rollout restart deploy alertmanager base-cortex-configs base-cortex-distributor base-cortex-ruler"
register: restart
- debug:
msg: "{{restart.stdout_lines}}"
- name: 2.2. Check Kubernetes Pods (Elasticsearch dependency)
- name: 2.4. Check Kubernetes Pods (Elasticsearch dependency)
command: "{{ role_path }}/files/k8s_status {{ cmoa_namespace }} alertmanage"
- name: 3. Get a list of all pods from the namespace
@@ -56,4 +73,4 @@
command: bash -c "PGPASSWORD='eorbahrhkswp' && /usr/bin/psql -h 'localhost' -U 'admin' -d 'postgresdb' -f /tmp/postgres_insert_dml.psql"
with_items: "{{ pod_list.stdout_lines }}"
when: item is match('postgres')
ignore_errors: true
ignore_errors: true

View File

@@ -15,20 +15,3 @@
- name: 4. Check Kubernetes Pods (base)
command: "{{ role_path }}/files/k8s_status {{ cmoa_namespace }}"
- name: 5. Change a Elasticsearch Service (NodePort=elasticsearch_nodePort)
kubernetes.core.k8s:
state: present
definition:
apiVersion: v1
kind: Service
metadata:
name: "{{ elasticsearch_service_name }}"
namespace: "{{ cmoa_namespace }}"
spec:
type: NodePort
ports:
- protocol: TCP
port: "{{ elasticsearch_service_port }}"
nodePort: "{{ elasticsearch_nodePort }}"
apply: yes