Skip to content

Commit c5c1fa3

Browse files
authored
Remove code for migrating from ODFE and all other remaining ODFE-related code (#753)
1 parent 646a79b commit c5c1fa3

15 files changed

+36
-450
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
## Unreleased
44
* **Logging**
5+
* [ANNOUNCEMENT] The [OpenDistro for Elasticsearch (ODFE) project](https://opendistro.github.io/for-elasticsearch/) reached end-of-line in May of 2022 and our project moved to
6+
OpenSearch shorly thereafter. This release removes all remaining support for ODFE; including support for migration from ODFE
7+
and ability to use utility scripts (e.g. change_internal_password.sh) with ealier ODFE-backed deployments.
8+
* [REMOVAL] Remove support for migrating from an earlier deployment which included ODFE.
9+
* [REMOVAL] Remove support for the `LOG_SEARCH_BACKEND` environment variable. Scripts will terminate with an ERROR message if
10+
this environment variable is detected.
511
* [CHANGE] The Fluent Bit Deployment used for Kubernetes Event collection can now be integrated into the
612
SAS Viya Workload node placement strategy.
713
* [CHANGE] An obsolete configuration file related to the Event Router has been removed from the repo.

logging/bin/apiaccess-include.sh

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,6 @@ function get_kb_api_url {
168168
# Global vars: kb_api_url - URL to access KB API/service
169169
# kbpfpid - process id of KB portforwarding
170170

171-
#NOTE: Use of args implemented to support migration of
172-
# ODFE 1.7 Kibana content to OpenSearch Dashoards ONLY!
173-
LOG_SEARCH_BACKEND=${1:-$LOG_SEARCH_BACKEND}
174-
KB_SERVICENAME=${2:-$KB_SERVICENAME}
175-
KB_SERVICEPORT=${3:-$KB_SERVICEPORT}
176-
KB_INGRESSNAME=${4:-$KB_INGRESSNAME}
177-
KB_TLS_ENABLED=${5}
178171

179172
if [ -n "$kb_api_url" ]; then
180173
log_debug "Kibana API Endpoint already set [$kb_api_url]"
@@ -183,14 +176,7 @@ function get_kb_api_url {
183176

184177
pfPID=""
185178

186-
if [ -n "$KB_TLS_ENABLED" ]; then
187-
tlsrequired="$KB_TLS_ENABLED"
188-
log_debug "Kibana TLS setting [$KB_TLS_ENABLED] explicitly passed to get_kb_api_url"
189-
elif [ "$LOG_SEARCH_BACKEND" != "OPENSEARCH" ]; then
190-
tlsrequired="$(kubectl -n $LOG_NS get pod -l role=kibana -o=jsonpath='{.items[*].metadata.annotations.tls_required}')"
191-
else
192-
tlsrequired="$(kubectl -n $LOG_NS get secret v4m-osd-tls-enabled -o=jsonpath={.data.enable_tls} |base64 --decode)"
193-
fi
179+
tlsrequired="$(kubectl -n $LOG_NS get secret v4m-osd-tls-enabled -o=jsonpath={.data.enable_tls} |base64 --decode)"
194180
log_debug "TLS required to connect to Kibana? [$tlsrequired]"
195181

196182
get_api_url "$KB_SERVICENAME" '{.spec.ports[?(@.name=="'${KB_SERVICEPORT}'")].port}' $tlsrequired $KB_INGRESSNAME

logging/bin/change_internal_password.sh

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,10 @@ function show_usage {
2727
echo ""
2828
}
2929

30-
if [ "$LOG_SEARCH_BACKEND" == "OPENSEARCH" ]; then
31-
targetpod="v4m-search-0"
32-
targetcontainer="opensearch"
33-
toolsrootdir="/usr/share/opensearch/plugins/opensearch-security"
34-
else
35-
targetpod="v4m-es-master-0"
36-
targetcontainer="elasticsearch"
37-
toolsrootdir="/usr/share/elasticsearch/plugins/opendistro_security"
38-
fi
30+
# set vars used in curl commands
31+
targetpod="v4m-search-0"
32+
targetcontainer="opensearch"
33+
toolsrootdir="/usr/share/opensearch/plugins/opensearch-security"
3934

4035
USER_NAME=${1}
4136
NEW_PASSWD="${2}"
@@ -258,17 +253,10 @@ if [ "$success" == "true" ]; then
258253
log_notice " *********** IMPORTANT NOTE *********** "
259254
log_notice " "
260255
log_notice " After changing the password for the [kibanaserver] user, you need to restart the "
261-
if [ "$LOG_SEARCH_BACKEND" == "OPENSEARCH" ]; then
262-
log_notice " OpenSearch Dashboards pod to ensure OpenSearch Dashboards can still be accessed and used. "
263-
log_notice " "
264-
log_notice " This can be done by submitting the following command: "
265-
log_notice " kubectl -n $LOG_NS delete pods -l 'app=opensearch-dashboards'"
266-
else
267-
log_notice " Kibana pod to ensure Kibana can still be accessed and used."
268-
log_notice ""
269-
log_notice " This can be done by submitting the following command:"
270-
log_notice " kubectl -n $LOG_NS delete pods -l 'app=v4m-es,role=kibana'"
271-
fi
256+
log_notice " OpenSearch Dashboards pod to ensure OpenSearch Dashboards can still be accessed and used. "
257+
log_notice " "
258+
log_notice " This can be done by submitting the following command: "
259+
log_notice " kubectl -n $LOG_NS delete pods -l 'app=opensearch-dashboards'"
272260
echo ""
273261
;;
274262
metricgetter)

logging/bin/common.sh

Lines changed: 16 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,14 @@ if [ "$SAS_LOGGING_COMMON_SOURCED" = "" ]; then
1515
fi
1616
fi
1717

18-
19-
function require_opensearch {
20-
if [ "$LOG_SEARCH_BACKEND" != "OPENSEARCH" ]; then
21-
log_error "This script is only appropriate for use with OpenSearch as the search back-end."
22-
log_error "The LOG_SEARCH_BACKEND environment variable is currently set to [$LOG_SEARCH_BACKEND]"
23-
exit 1
24-
fi
25-
}
26-
export -f require_opensearch
27-
18+
#Check for obsolete env var
19+
if [ -n "$LOG_SEARCH_BACKEND" ]; then
20+
log_error "Support for the LOG_SEARCH_BACKEND environment variable has been removed."
21+
log_error "This script is only appropriate for use with OpenSearch as the search back-end."
22+
log_error "The LOG_SEARCH_BACKEND environment variable is currently set to [$LOG_SEARCH_BACKEND]"
23+
exit 1
24+
fi
25+
2826
export LOG_NS="${LOG_NS:-logging}"
2927

3028
#if TLS (w/in cluster; for all monitoring components) is requested, require TLS into OSD pod, too
@@ -35,33 +33,16 @@ if [ "$SAS_LOGGING_COMMON_SOURCED" = "" ]; then
3533
# TLS is required for logging components so hard-code to 'true'
3634
export TLS_ENABLE="true"
3735

38-
# OpenSearch or OpenDistro for Elasticsearch
39-
export LOG_SEARCH_BACKEND="${LOG_SEARCH_BACKEND:-OPENSEARCH}"
40-
log_debug "Search Backend set to [$LOG_SEARCH_BACKEND]"
41-
42-
if [ "$LOG_SEARCH_BACKEND" == "OPENSEARCH" ]; then
43-
export ES_SERVICENAME="v4m-search"
44-
export ES_INGRESSNAME="v4m-search"
45-
46-
export KB_SERVICENAME="v4m-osd"
47-
export KB_INGRESSNAME="v4m-osd"
48-
export KB_SERVICEPORT="http"
36+
# set some OpenSearch/OSD env vars
37+
export ES_SERVICENAME="v4m-search"
38+
export ES_INGRESSNAME="v4m-search"
4939

50-
export ES_PLUGINS_DIR="_plugins"
51-
export LOG_XSRF_HEADER="osd-xsrf:true"
52-
else
53-
export ES_SERVICENAME="v4m-es-client-service"
54-
export ES_INGRESSNAME="v4m-es-client-service"
55-
56-
export KB_SERVICENAME="v4m-es-kibana-svc"
57-
export KB_INGRESSNAME="v4m-es-kibana-ing"
58-
export KB_SERVICEPORT="kibana-svc"
59-
60-
61-
export ES_PLUGINS_DIR="_opendistro"
62-
export LOG_XSRF_HEADER="kbn-xsrf: true"
63-
fi
40+
export KB_SERVICENAME="v4m-osd"
41+
export KB_INGRESSNAME="v4m-osd"
42+
export KB_SERVICEPORT="http"
6443

44+
export ES_PLUGINS_DIR="_plugins"
45+
export LOG_XSRF_HEADER="osd-xsrf:true"
6546

6647
export V4M_NS=$LOG_NS
6748

@@ -73,8 +54,6 @@ if [ "$SAS_LOGGING_COMMON_SOURCED" = "" ]; then
7354

7455
export SAS_LOGGING_COMMON_SOURCED=true
7556

76-
#Environment vars related to upgrading ODFE 1.7.0 to ODFE 1.13.x
77-
export KB_GLOBAL_EXPORT_FILE=${KB_GLOBAL_EXPORT_FILE:-"$TMP_DIR/kibana_global_content.ndjson"}
7857
fi
7958
echo ""
8059

logging/bin/deploy_esexporter.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ fi
2020

2121
set -e
2222

23-
#Fail if not using OpenSearch back-end
24-
require_opensearch
25-
2623
log_info "Deploying Elasticsearch metric exporter ..."
2724

2825
# check for pre-reqs

logging/bin/deploy_fluentbit_k8sevents_opensearch.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ else
3333
wnpValuesFile="$TMP_DIR/empty.yaml"
3434
fi
3535

36-
#Fail if not using OpenSearch back-end
37-
require_opensearch
38-
3936
log_info "Deploying Fluent Bit for collecting Kubernetes Events..."
4037

4138
#TO DO: Check that OpenSearch is actually deployed and running?

logging/bin/deploy_fluentbit_opensearch.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ fi
2424

2525
set -e
2626

27-
#Fail if not using OpenSearch back-end
28-
require_opensearch
29-
3027
log_info "Deploying Fluent Bit ..."
3128

3229
# check for pre-reqs

logging/bin/deploy_logging.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ cd "$(dirname $BASH_SOURCE)/../.."
77
source logging/bin/common.sh
88
source bin/autogenerate-include.sh
99

10-
#Fail if not using OpenSearch back-end
11-
require_opensearch
12-
1310
# Confirm NOT on OpenShift
1411
if [ "$OPENSHIFT_CLUSTER" == "true" ]; then
1512
if [ "${CHECK_OPENSHIFT_CLUSTER:-true}" == "true" ]; then

logging/bin/deploy_logging_openshift.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@
66
cd "$(dirname $BASH_SOURCE)/../.."
77
source logging/bin/common.sh
88

9-
##################################
10-
# Confirm using OpenSearch #
11-
##################################
12-
require_opensearch
13-
14-
159
##################################
1610
# Confirm on OpenShift #
1711
##################################

0 commit comments

Comments
 (0)