Skip to content
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## Unreleased
* **Logging**
* [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
OpenSearch shorly thereafter. This release removes all remaining support for ODFE; including support for migration from ODFE
and ability to use utility scripts (e.g. change_internal_password.sh) with ealier ODFE-backed deployments.
* [REMOVAL] Remove support for migrating from an earlier deployment which included ODFE.
* [REMOVAL] Remove support for the `LOG_SEARCH_BACKEND` environment variable. Scripts will terminate with an ERROR message if
this environment variable is detected.
* [CHANGE] The Fluent Bit Deployment used for Kubernetes Event collection can now be integrated into the
SAS Viya Workload node placement strategy.
* [CHANGE] An obsolete configuration file related to the Event Router has been removed from the repo.
Expand Down
16 changes: 1 addition & 15 deletions logging/bin/apiaccess-include.sh
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,6 @@ function get_kb_api_url {
# Global vars: kb_api_url - URL to access KB API/service
# kbpfpid - process id of KB portforwarding

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

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

pfPID=""

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

get_api_url "$KB_SERVICENAME" '{.spec.ports[?(@.name=="'${KB_SERVICEPORT}'")].port}' $tlsrequired $KB_INGRESSNAME
Expand Down
28 changes: 8 additions & 20 deletions logging/bin/change_internal_password.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,10 @@ function show_usage {
echo ""
}

if [ "$LOG_SEARCH_BACKEND" == "OPENSEARCH" ]; then
targetpod="v4m-search-0"
targetcontainer="opensearch"
toolsrootdir="/usr/share/opensearch/plugins/opensearch-security"
else
targetpod="v4m-es-master-0"
targetcontainer="elasticsearch"
toolsrootdir="/usr/share/elasticsearch/plugins/opendistro_security"
fi
# set vars used in curl commands
targetpod="v4m-search-0"
targetcontainer="opensearch"
toolsrootdir="/usr/share/opensearch/plugins/opensearch-security"

USER_NAME=${1}
NEW_PASSWD="${2}"
Expand Down Expand Up @@ -258,17 +253,10 @@ if [ "$success" == "true" ]; then
log_notice " *********** IMPORTANT NOTE *********** "
log_notice " "
log_notice " After changing the password for the [kibanaserver] user, you need to restart the "
if [ "$LOG_SEARCH_BACKEND" == "OPENSEARCH" ]; then
log_notice " OpenSearch Dashboards pod to ensure OpenSearch Dashboards can still be accessed and used. "
log_notice " "
log_notice " This can be done by submitting the following command: "
log_notice " kubectl -n $LOG_NS delete pods -l 'app=opensearch-dashboards'"
else
log_notice " Kibana pod to ensure Kibana can still be accessed and used."
log_notice ""
log_notice " This can be done by submitting the following command:"
log_notice " kubectl -n $LOG_NS delete pods -l 'app=v4m-es,role=kibana'"
fi
log_notice " OpenSearch Dashboards pod to ensure OpenSearch Dashboards can still be accessed and used. "
log_notice " "
log_notice " This can be done by submitting the following command: "
log_notice " kubectl -n $LOG_NS delete pods -l 'app=opensearch-dashboards'"
echo ""
;;
metricgetter)
Expand Down
53 changes: 16 additions & 37 deletions logging/bin/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,14 @@ if [ "$SAS_LOGGING_COMMON_SOURCED" = "" ]; then
fi
fi


function require_opensearch {
if [ "$LOG_SEARCH_BACKEND" != "OPENSEARCH" ]; then
log_error "This script is only appropriate for use with OpenSearch as the search back-end."
log_error "The LOG_SEARCH_BACKEND environment variable is currently set to [$LOG_SEARCH_BACKEND]"
exit 1
fi
}
export -f require_opensearch

#Check for obsolete env var
if [ -n "$LOG_SEARCH_BACKEND" ]; then
log_error "Support for the LOG_SEARCH_BACKEND environment variable has been removed."
log_error "This script is only appropriate for use with OpenSearch as the search back-end."
log_error "The LOG_SEARCH_BACKEND environment variable is currently set to [$LOG_SEARCH_BACKEND]"
exit 1
fi

export LOG_NS="${LOG_NS:-logging}"

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

# OpenSearch or OpenDistro for Elasticsearch
export LOG_SEARCH_BACKEND="${LOG_SEARCH_BACKEND:-OPENSEARCH}"
log_debug "Search Backend set to [$LOG_SEARCH_BACKEND]"

if [ "$LOG_SEARCH_BACKEND" == "OPENSEARCH" ]; then
export ES_SERVICENAME="v4m-search"
export ES_INGRESSNAME="v4m-search"

export KB_SERVICENAME="v4m-osd"
export KB_INGRESSNAME="v4m-osd"
export KB_SERVICEPORT="http"
# set some OpenSearch/OSD env vars
export ES_SERVICENAME="v4m-search"
export ES_INGRESSNAME="v4m-search"

export ES_PLUGINS_DIR="_plugins"
export LOG_XSRF_HEADER="osd-xsrf:true"
else
export ES_SERVICENAME="v4m-es-client-service"
export ES_INGRESSNAME="v4m-es-client-service"

export KB_SERVICENAME="v4m-es-kibana-svc"
export KB_INGRESSNAME="v4m-es-kibana-ing"
export KB_SERVICEPORT="kibana-svc"


export ES_PLUGINS_DIR="_opendistro"
export LOG_XSRF_HEADER="kbn-xsrf: true"
fi
export KB_SERVICENAME="v4m-osd"
export KB_INGRESSNAME="v4m-osd"
export KB_SERVICEPORT="http"

export ES_PLUGINS_DIR="_plugins"
export LOG_XSRF_HEADER="osd-xsrf:true"

export V4M_NS=$LOG_NS

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

export SAS_LOGGING_COMMON_SOURCED=true

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

3 changes: 0 additions & 3 deletions logging/bin/deploy_esexporter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ fi

set -e

#Fail if not using OpenSearch back-end
require_opensearch

log_info "Deploying Elasticsearch metric exporter ..."

# check for pre-reqs
Expand Down
3 changes: 0 additions & 3 deletions logging/bin/deploy_fluentbit_k8sevents_opensearch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ else
wnpValuesFile="$TMP_DIR/empty.yaml"
fi

#Fail if not using OpenSearch back-end
require_opensearch

log_info "Deploying Fluent Bit for collecting Kubernetes Events..."

#TO DO: Check that OpenSearch is actually deployed and running?
Expand Down
3 changes: 0 additions & 3 deletions logging/bin/deploy_fluentbit_opensearch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ fi

set -e

#Fail if not using OpenSearch back-end
require_opensearch

log_info "Deploying Fluent Bit ..."

# check for pre-reqs
Expand Down
3 changes: 0 additions & 3 deletions logging/bin/deploy_logging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ cd "$(dirname $BASH_SOURCE)/../.."
source logging/bin/common.sh
source bin/autogenerate-include.sh

#Fail if not using OpenSearch back-end
require_opensearch

# Confirm NOT on OpenShift
if [ "$OPENSHIFT_CLUSTER" == "true" ]; then
if [ "${CHECK_OPENSHIFT_CLUSTER:-true}" == "true" ]; then
Expand Down
6 changes: 0 additions & 6 deletions logging/bin/deploy_logging_openshift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@
cd "$(dirname $BASH_SOURCE)/../.."
source logging/bin/common.sh

##################################
# Confirm using OpenSearch #
##################################
require_opensearch


##################################
# Confirm on OpenShift #
##################################
Expand Down
Loading