remove elasticsearch remnants in antelope cycle

Change-Id: I115b491eca413437926f5bcaf53336151f9a7c0b
This commit is contained in:
Bartosz Bezak 2023-01-27 15:11:34 +01:00
parent 38ccebb8cb
commit ee658f4549
8 changed files with 0 additions and 283 deletions

View File

@ -230,10 +230,6 @@ common
[opensearch:children]
control
# TODO: This is used for cleanup and can be removed in the Antelope cycle.
[elasticsearch-curator:children]
opensearch
# Opensearch dashboards
[opensearch-dashboards:children]
opensearch

View File

@ -248,10 +248,6 @@ common
[opensearch:children]
control
# TODO: This is used for cleanup and can be removed in the Antelope cycle.
[elasticsearch-curator:children]
opensearch
# Opensearch dashboards
[opensearch-dashboards:children]
opensearch

View File

@ -11,7 +11,6 @@
container_engine: "{{ kolla_container_engine }}"
name:
- opensearch
- elasticsearch
check_mode: false
register: container_facts
@ -23,6 +22,5 @@
timeout: 1
state: stopped
when:
- container_facts['elasticsearch'] is not defined
- container_facts['opensearch'] is not defined
- inventory_hostname in groups['opensearch']

View File

@ -1,8 +1,4 @@
---
# NOTE: The following tasks assume that the same hosts are used for
# OpenSearch as were for ElasticSearch / Kibana, and that the
# OpenSearch endpoint remains the same as ElasticSearch.
- name: Disable shard allocation
become: true
vars:
@ -38,55 +34,6 @@
register: result
until: ('status' in result) and result.status == 200
- name: Stop and remove ElasticSearch
become: true
kolla_docker:
action: "stop_and_remove_container"
name: "elasticsearch"
when:
- inventory_hostname in groups['opensearch']
- name: Stop and remove ElasticSearch Curator
become: true
kolla_docker:
action: "stop_and_remove_container"
name: "elasticsearch_curator"
when:
- inventory_hostname in groups['elasticsearch-curator']
- name: Stop and remove Kibana
become: true
kolla_docker:
action: "stop_and_remove_container"
name: "kibana"
when:
- inventory_hostname in groups['opensearch-dashboards']
- name: Delete ElasticSearch load-balancer config
file:
path: "{{ node_config_directory }}/haproxy/services.d/elasticsearch.cfg"
state: "absent"
become: true
when:
- inventory_hostname in groups['loadbalancer']
- name: Delete Kibana load-balancer config
file:
path: "{{ node_config_directory }}/haproxy/services.d/kibana.cfg"
state: "absent"
become: true
when:
- inventory_hostname in groups['loadbalancer']
# TODO: Use the volume name from defaults.yml
- name: Create OpenSearch Docker volume
become: true
command: "docker volume create opensearch"
- name: Migrate ElasticSearch data to OpenSearch
become: true
command: "mv /var/lib/docker/volumes/elasticsearch/_data/nodes /var/lib/docker/volumes/opensearch/_data/"
- import_tasks: config-host.yml
- import_tasks: config.yml

View File

@ -509,17 +509,6 @@
environment:
KOLLA_ANSIBLE_VENV_PATH: "{{ kolla_ansible_venv_path }}"
- name: Run test-prometheus-efk.sh script
script:
cmd: test-prometheus-efk.sh
executable: /bin/bash
chdir: "{{ kolla_ansible_src_dir }}"
environment:
TLS_ENABLED: "{{ tls_enabled }}"
when:
- is_upgrade
- scenario == "prometheus-opensearch"
- name: Run test-prometheus-opensearch.sh script
script:
cmd: test-prometheus-opensearch.sh
@ -528,7 +517,6 @@
environment:
TLS_ENABLED: "{{ tls_enabled }}"
when:
- not is_upgrade
- scenario == "prometheus-opensearch"
- name: Run test-venus.sh script

View File

@ -116,11 +116,6 @@ monitoring
network
storage
{% if is_upgrade %}
[elasticsearch:children]
control
{% endif %}
# NOTE(yoctozepto): Until we are able to isolate network namespaces in k-a,
# we are forced to separate Pacemaker remotes from full members.
# This is not as bad as it sounds, because it would be enforced in
@ -286,11 +281,6 @@ common
[kolla-toolbox:children]
common
{% if is_upgrade %}
[elasticsearch-curator:children]
elasticsearch
{% endif %}
[opensearch:children]
control
@ -704,11 +694,7 @@ monitoring
monitoring
[prometheus-elasticsearch-exporter:children]
{% if is_upgrade %}
elasticsearch
{% else %}
opensearch
{% endif %}
[prometheus-blackbox-exporter:children]
monitoring

View File

@ -1,189 +0,0 @@
#!/bin/bash
set -o xtrace
set -o errexit
set -o pipefail
# Enable unbuffered output
export PYTHONUNBUFFERED=1
function check_kibana {
# Perform and validate a basic status page check
KIBANA_URL=${OS_AUTH_URL%:*}:5601/api/status
output_path=$1
kibana_password=$(awk '$1 == "kibana_password:" { print $2 }' /etc/kolla/passwords.yml)
args=(
--include
--location
--fail
--user
kibana:$kibana_password
)
if [[ "$TLS_ENABLED" = "True" ]]; then
args+=(--cacert $OS_CACERT)
fi
if ! curl "${args[@]}" $KIBANA_URL > $output_path; then
return 1
fi
if ! grep 'Looking good' $output_path >/dev/null; then
return 1
fi
}
function check_elasticsearch {
# Verify that we see a healthy index created due to Fluentd forwarding logs
ELASTICSEARCH_URL=${OS_AUTH_URL%:*}:9200/_cluster/health
output_path=$1
args=(
--include
--location
--fail
)
if [[ "$TLS_ENABLED" = "True" ]]; then
args+=(--cacert $OS_CACERT)
fi
if ! curl "${args[@]}" $ELASTICSEARCH_URL > $output_path; then
return 1
fi
# NOTE(mgoddard): Status may be yellow because no indices have been
# created.
if ! grep -E '"status":"(green|yellow)"' $output_path >/dev/null; then
return 1
fi
}
function check_grafana {
# Query grafana, and check that the returned page looks like a grafana page.
GRAFANA_URL=${OS_AUTH_URL%:*}:3000
output_path=$1
grafana_password=$(awk '$1 == "grafana_admin_password:" { print $2 }' /etc/kolla/passwords.yml)
args=(
--include
--location
--fail
--user
admin:$grafana_password
)
if [[ "$TLS_ENABLED" = "True" ]]; then
args+=(--cacert $OS_CACERT)
fi
if ! curl "${args[@]}" $GRAFANA_URL > $output_path; then
return 1
fi
if ! grep '<title>Grafana</title>' $output_path >/dev/null; then
return 1
fi
}
function check_prometheus {
# Query prometheus graph, and check that the returned page looks like a
# prometheus page.
PROMETHEUS_URL=${OS_AUTH_URL%:*}:9091/graph
output_path=$1
args=(
--include
--location
--fail
)
if [[ "$TLS_ENABLED" = "True" ]]; then
args+=(--cacert $OS_CACERT)
fi
if ! curl "${args[@]}" $PROMETHEUS_URL > $output_path; then
return 1
fi
if ! grep '<title>Prometheus' $output_path >/dev/null; then
return 1
fi
}
function test_kibana {
echo "TESTING: Kibana"
output_path=$(mktemp)
attempt=1
while ! check_kibana $output_path; do
echo "Kibana not accessible yet"
attempt=$((attempt+1))
if [[ $attempt -eq 12 ]]; then
echo "FAILED: Kibana did not become accessible. Response:"
cat $output_path
return 1
fi
sleep 10
done
echo "SUCCESS: Kibana"
}
function test_elasticsearch {
echo "TESTING: Elasticsearch"
output_path=$(mktemp)
attempt=1
while ! check_elasticsearch $output_path; do
echo "Elasticsearch not accessible yet"
attempt=$((attempt+1))
if [[ $attempt -eq 12 ]]; then
echo "FAILED: Elasticsearch did not become accessible. Response:"
cat $output_path
return 1
fi
sleep 10
done
echo "SUCCESS: Elasticsearch"
}
function test_grafana {
echo "TESTING: Grafana"
output_path=$(mktemp)
attempt=1
while ! check_grafana $output_path; do
echo "Grafana not accessible yet"
attempt=$((attempt+1))
if [[ $attempt -eq 12 ]]; then
echo "FAILED: Grafana did not become accessible. Response:"
cat $output_path
return 1
fi
sleep 10
done
echo "SUCCESS: Grafana"
}
function test_prometheus {
# TODO(mgoddard): Query metrics.
echo "TESTING: Prometheus"
output_path=$(mktemp)
attempt=1
while ! check_prometheus $output_path; do
echo "Prometheus not accessible yet"
attempt=$((attempt+1))
if [[ $attempt -eq 12 ]]; then
echo "FAILED: Prometheus did not become accessible. Response:"
cat $output_path
return 1
fi
sleep 10
done
echo "SUCCESS: Prometheus"
}
function test_prometheus_efk_logged {
. /etc/kolla/admin-openrc.sh
test_kibana
test_elasticsearch
test_grafana
test_prometheus
}
function test_prometheus_efk {
echo "Testing prometheus and EFK"
test_prometheus_efk_logged > /tmp/logs/ansible/test-prometheus-efk 2>&1
result=$?
if [[ $result != 0 ]]; then
echo "Testing prometheus and EFK failed. See ansible/test-prometheus-efk for details"
else
echo "Successfully tested prometheus and EFK. See ansible/test-prometheus-efk for details"
fi
return $result
}
test_prometheus_efk

View File

@ -53,11 +53,6 @@ if [[ "$nova_instance_datadir_volume" != "nova_compute" && -d "$nova_instance_da
rm -rfv $nova_instance_datadir_volume
fi
if [[ "$elasticsearch_datadir_volume" != "elasticsearch" && -d "$elasticsearch_datadir_volume" ]]; then
echo "Removing elasticsearch volume if it is customzied"
rm -rfv $elasticsearch_datadir_volume
fi
if [[ "$gnocchi_metric_datadir_volume" != "gnocchi" && -d "$gnocchi_metric_datadir_volume" ]]; then
echo "Removing gnocchi volume if it is customzied"
rm -rfv $gnocchi_metric_datadir_volume