Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
2809558
Upgrade Log Monitoring stack
gsmith-sas May 21, 2025
1e3791e
version bump: esexporter
gsmith-sas May 21, 2025
9fe5e60
upgrade: OpenSearch Datasource plugin
gsmith-sas May 21, 2025
2406781
Updated CHANGELOG.md
gsmith-sas May 21, 2025
ec2ef70
Remove ODFE Migration Logic
gsmith-sas May 21, 2025
57a2602
Remove support for LOG_SEARCH_BACKEND env var
gsmith-sas May 21, 2025
1a9841d
Remove calls to require_opensearch function
gsmith-sas May 21, 2025
ce2186a
Update CHANGELOG.md
gsmith-sas May 21, 2025
0e219ff
Error if LOG_SEARCH_BACKEND env var is set to any value
gsmith-sas May 21, 2025
957d134
Remove remaining calls to require_opensearch
gsmith-sas May 22, 2025
f02744d
linting: common.sh
gsmith-sas May 22, 2025
acc9c0d
Linting: deploy_logging.sh
gsmith-sas May 22, 2025
8af3648
Linting: deploy_osd_content.sh
gsmith-sas May 22, 2025
f107314
Remove whitespace
gsmith-sas May 22, 2025
716ab93
Linting: rework
gsmith-sas May 22, 2025
4d34ec2
Linting: Rework (2)
gsmith-sas May 22, 2025
a6c4bbf
Linting: change_internal_password.sh
gsmith-sas May 22, 2025
22dd9f9
Linting: change_internal_password (2)
gsmith-sas May 22, 2025
190026d
Linting: change_internal_password.sh (3)
gsmith-sas May 22, 2025
ad71a08
Linting: change_internal_password (4)
gsmith-sas May 22, 2025
1021f98
change_internal_password.sh: removed chmod of hash utility due to rea…
gsmith-sas May 22, 2025
53036bc
Linting: deploy_esexporter.sh
gsmith-sas May 22, 2025
97da128
Linting: deploy_esexporter.sh (2)
gsmith-sas May 22, 2025
e40481a
Linting: deploy_esexporter.sh (3)
gsmith-sas May 22, 2025
b0a308b
Linting: deploy_openshift_prereqs.sh
gsmith-sas May 22, 2025
9e58f92
Linting: deploy_openshift_prereqs.sh (2)
gsmith-sas May 22, 2025
d992fe4
Linting: deploy_openshift_prereqs.sh (3)
gsmith-sas May 22, 2025
772a24f
Linting: apiaccess-include.sh
gsmith-sas May 23, 2025
4b63eec
Linting: apiaccess-include.sh (2)
gsmith-sas May 23, 2025
b08dfb3
Linting: deploy_opensearch_content.sh
gsmith-sas May 23, 2025
e0d9663
Linting: apiaccess-include.sh (3)
gsmith-sas May 23, 2025
8b78390
Linting: deploy_opensearch_content.sh (2)
gsmith-sas May 23, 2025
8bb7f22
Linting: deploy_osd.sh
gsmith-sas May 23, 2025
d5866e0
Linting: deploy_osd.sh (2)
gsmith-sas May 23, 2025
3081594
Linting: deploy_logging_openshift.sh
gsmith-sas May 29, 2025
4c131b8
Liniting: deploy_opensearch.sh
gsmith-sas May 29, 2025
5fd4ec6
Liniting: deploy_opensearch.sh (2)
gsmith-sas May 29, 2025
e270633
Remove files accidently added to PR
gsmith-sas May 29, 2025
7e7d232
Liniting: deploy_opensearch.sh (3)
gsmith-sas May 29, 2025
0cc0266
Linting: remove_esexporter.sh
gsmith-sas May 29, 2025
30ab4fb
Remove obsolete stub script (remove_logging_open.sh)
gsmith-sas May 29, 2025
7216f86
Linting: remove_logging_openshift.sh
gsmith-sas May 29, 2025
5894928
Linting: remove_logging.sh
gsmith-sas May 29, 2025
cfad3d8
Linting: remove_opensearch.sh
gsmith-sas May 29, 2025
26dc010
Linting: remove_openshift_artifacts.sh
gsmith-sas May 29, 2025
9654627
Linting: logging/bin/remove_osd.sh
gsmith-sas May 29, 2025
99aad6f
Remove obsolete stub script (deploy_logging_open.sh)
gsmith-sas May 29, 2025
cff5147
Linting: remove_logging.sh (2)
gsmith-sas May 29, 2025
0b9646d
Linting: remove_esexporter.sh (2)
gsmith-sas May 29, 2025
4480828
Linting: remove_logging.sh (2)
gsmith-sas May 29, 2025
0377d92
Linting: remove_logging_openshift.sh (2)
gsmith-sas May 29, 2025
0ef71b2
Linting: remove_opensearch.sh
gsmith-sas May 29, 2025
dbdadca
Linting: remove_openshift_artifacts.sh (2)
gsmith-sas May 29, 2025
5c0e808
Linting: remove_osd.sh (2)
gsmith-sas May 29, 2025
4fb4cca
Linting: remove_logging.sh (3)
gsmith-sas May 29, 2025
157741f
Linting: create_openshift_route.sh
gsmith-sas May 30, 2025
e0b50de
Linting: create_openshift_route.sh (2)
gsmith-sas May 30, 2025
b5cad48
Linting: shfmt stragglers
gsmith-sas May 30, 2025
ec8e70b
Linting: shfmt stragglers (2)
gsmith-sas May 30, 2025
e041cd8
Remove obsolete script stub (remove_logging_fluentbit_azmonitor.sh)
gsmith-sas May 30, 2025
6d3d434
Linting: import_osd_content.sh
gsmith-sas May 30, 2025
ec9cdff
Linting: import_osd_content.sh (2)
gsmith-sas May 30, 2025
aac57a2
Consistency: remove_fluentbit_* scripts
gsmith-sas May 30, 2025
554ca0d
Linting: rbac-include.sh
gsmith-sas May 30, 2025
4926bf6
Linting: rbac-include.sh (2)
gsmith-sas May 30, 2025
4645801
Linting: rbac-include.sh (3)
gsmith-sas May 30, 2025
c6f7a49
Linting: rbac-include.sh (4)
gsmith-sas May 30, 2025
87aca0a
Linting: secrets-include.sh
gsmith-sas May 30, 2025
af1bf38
Linting: secrets-include.sh (2)
gsmith-sas May 30, 2025
dad3147
various minor clean-up tweaks
gsmith-sas May 30, 2025
742e989
Linting: remove_openshift_routes.sh
gsmith-sas May 30, 2025
7e953f5
Linting: secret-include - remove quotes around labels when creating K…
gsmith-sas Jun 4, 2025
eccfe94
Added comments explaining shell check exception
gsmith-sas Jun 4, 2025
235a9c5
Misc cleanup
gsmith-sas Jun 4, 2025
bdf8d89
Merge branch 'main' into removemigrateshellck
gsmith-sas Jun 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
410 changes: 203 additions & 207 deletions logging/bin/apiaccess-include.sh

Large diffs are not rendered by default.

439 changes: 217 additions & 222 deletions logging/bin/change_internal_password.sh

Large diffs are not rendered by default.

15 changes: 9 additions & 6 deletions logging/bin/common.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#! /bin/bash

# Copyright © 2020, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

Expand All @@ -8,21 +10,23 @@ if [ "$SAS_LOGGING_COMMON_SOURCED" = "" ]; then
source bin/common.sh

if [ -f "$USER_DIR/logging/user.env" ]; then
userEnv=$(grep -v '^[[:blank:]]*$' $USER_DIR/logging/user.env | grep -v '^#' | xargs)
userEnv=$(grep -v '^[[:blank:]]*$' "$USER_DIR/logging/user.env" | grep -v '^#' | xargs)

log_verbose "Loading user environment file: $USER_DIR/logging/user.env"
if [ "$userEnv" ]; then
export $userEnv
# shellcheck disable=SC2086,SC2163
export $userEnv
fi
fi

#Check for obsolete env var
if [ -n "$LOG_SEARCH_BACKEND" ]; then
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 @@ -47,7 +51,7 @@ if [ "$SAS_LOGGING_COMMON_SOURCED" = "" ]; then
export V4M_NS=$LOG_NS

if [ "$AIRGAP_DEPLOYMENT" == "true" ]; then
source bin/airgap-include.sh
source bin/airgap-include.sh
fi

source bin/version-include.sh
Expand All @@ -56,4 +60,3 @@ if [ "$SAS_LOGGING_COMMON_SOURCED" = "" ]; then

fi
echo ""

147 changes: 57 additions & 90 deletions logging/bin/create_openshift_route.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
# Copyright © 2021, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

cd "$(dirname $BASH_SOURCE)/../.."
cd "$(dirname "$BASH_SOURCE")/../.." || exit 1
source logging/bin/common.sh

this_script=`basename "$0"`
this_script=$(basename "$0")

log_debug "Script [$this_script] has started [$(date)]"

Expand All @@ -15,131 +15,98 @@ log_debug "Script [$this_script] has started [$(date)]"
##################################

if [ "$OPENSHIFT_CLUSTER" != "true" ]; then
if [ "${CHECK_OPENSHIFT_CLUSTER:-true}" == "true" ]; then
log_error "This script should only be run on OpenShift clusters"
exit 1
fi
if [ "${CHECK_OPENSHIFT_CLUSTER:-true}" == "true" ]; then
log_error "This script should only be run on OpenShift clusters"
exit 1
fi
fi

app=${1}
app=$(echo "$app"| tr '[:lower:]' '[:upper:]')
app=$(echo "$app" | tr '[:lower:]' '[:upper:]')

case "$app" in
"KIBANA"|"KB")
namespace="$LOG_NS"
service_name="v4m-es-kibana-svc"
port="kibana-svc"
tls_enable="true"
tls_secret="kibana-tls-secret"
ingress_tls_secret="kibana-ingress-tls-secret"
route_name="$service_name"
if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
route_host=${OPENSHIFT_ROUTE_HOST_KIBANA:-v4m-$namespace.$OPENSHIFT_ROUTE_DOMAIN}
route_path="/kibana"
else
route_host=${OPENSHIFT_ROUTE_HOST_KIBANA:-$service_name-$namespace.$OPENSHIFT_ROUTE_DOMAIN}
route_path="/"
fi
;;
"ELASTICSEARCH"|"ES")
namespace="$LOG_NS"
service_name="v4m-es-client-service"
port="http"
tls_enable="true"
tls_secret="es-rest-tls-secret"
ingress_tls_secret="elasticsearch-ingress-tls-secret"
route_name="$service_name"
if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
route_host=${OPENSHIFT_ROUTE_HOST_ELASTICSEARCH:-v4m-$namespace.$OPENSHIFT_ROUTE_DOMAIN}
route_path="/elasticsearch"
else
route_host=${OPENSHIFT_ROUTE_HOST_ELASTICSEARCH:-$service_name-$namespace.$OPENSHIFT_ROUTE_DOMAIN}
route_path="/"
fi
;;
"OPENSEARCH"|"OS")
namespace="$LOG_NS"
service_name="v4m-search"
port="http"
tls_enable="true"
tls_secret="es-rest-tls-secret"
ingress_tls_secret="elasticsearch-ingress-tls-secret"
route_name="$service_name"
if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
"OPENSEARCH" | "OS")
namespace="$LOG_NS"
service_name="v4m-search"
port="http"
tls_enable="true"
tls_secret="es-rest-tls-secret"
ingress_tls_secret="elasticsearch-ingress-tls-secret"
route_name="$service_name"
if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
route_host=${OPENSHIFT_ROUTE_HOST_ELASTICSEARCH:-v4m-$namespace.$OPENSHIFT_ROUTE_DOMAIN}
route_path="/opensearch"
else
else
route_host=${OPENSHIFT_ROUTE_HOST_ELASTICSEARCH:-$service_name-$namespace.$OPENSHIFT_ROUTE_DOMAIN}
route_path="/"
fi
;;
"OSD"|"OPENSEARCHDASHBOARD"|"OPENSEARCHDASHBOARDS")
namespace="$LOG_NS"
service_name="v4m-osd"
port="http"
tls_enable="true"
tls_secret="kibana-tls-secret"
ingress_tls_secret="kibana-ingress-tls-secret"
route_name="$service_name"
if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
fi
;;
"OSD" | "OPENSEARCHDASHBOARD" | "OPENSEARCHDASHBOARDS")
namespace="$LOG_NS"
service_name="v4m-osd"
port="http"
tls_enable="true"
tls_secret="kibana-tls-secret"
ingress_tls_secret="kibana-ingress-tls-secret"
route_name="$service_name"
if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
route_host=${OPENSHIFT_ROUTE_HOST_KIBANA:-v4m-$namespace.$OPENSHIFT_ROUTE_DOMAIN}
route_path="/dashboards"
else
else
route_host=${OPENSHIFT_ROUTE_HOST_KIBANA:-$service_name-$namespace.$OPENSHIFT_ROUTE_DOMAIN}
route_path="/"
fi
;;
""|*)
log_error "Application name is invalid or missing."
log_error "The APPLICATION NAME is required; valid values are: OpenSearch or OpenSearchDashboards"
exit 1
;;
fi
;;
"" | *)
log_error "Application name is invalid or missing."
log_error "The APPLICATION NAME is required; valid values are: OpenSearch or OpenSearchDashboards"
exit 1
;;
esac

if oc -n $namespace get route $route_name 2>/dev/null 1>&2; then
log_info "Skipping route creation; the requested route [$route_name] already exists in the namespace [$namespace]."
exit 0
if oc -n "$namespace" get route $route_name > /dev/null 2>&1; then
log_info "Skipping route creation; the requested route [$route_name] already exists in the namespace [$namespace]."
exit 0
fi

if [ "$tls_enable" != "true" ]; then
tls_mode="edge"
tls_mode="edge"
else
if oc -n $namespace get secret $tls_secret 2>/dev/null 1>&2; then
tls_mode="reencrypt"
else
log_error "The specified secret [$tls_secret] does NOT exists in the namespace [$namespace]."
exit 1
fi
if oc -n "$namespace" get secret $tls_secret > /dev/null 2>&1; then
tls_mode="reencrypt"
else
log_error "The specified secret [$tls_secret] does NOT exists in the namespace [$namespace]."
exit 1
fi
fi

oc -n $namespace create route $tls_mode $route_name \
oc -n "$namespace" create route $tls_mode $route_name \
--service $service_name \
--port=$port \
--insecure-policy=Redirect \
--hostname $route_host \
--hostname "$route_host" \
--path $route_path
rc=$?

if [ "$OPENSHIFT_PATH_ROUTES" == "true" ]; then
oc -n $namespace annotate route $route_name "haproxy.router.openshift.io/rewrite-target=/"
oc -n "$namespace" annotate route $route_name "haproxy.router.openshift.io/rewrite-target=/"
fi

if [ "$rc" != "0" ]; then
log_error "There was a problem creating the route for [$route_name]. [$rc]"
exit 1
log_error "There was a problem creating the route for [$route_name]. [$rc]"
exit 1
fi

if [ "$tls_enable" == "true" ]; then
# identify secret containing destination CA
oc -n $namespace annotate route $route_name cert-utils-operator.redhat-cop.io/destinationCA-from-secret=$tls_secret
# identify secret containing destination CA
oc -n "$namespace" annotate route $route_name cert-utils-operator.redhat-cop.io/destinationCA-from-secret=$tls_secret
fi


if oc -n $namespace get secret $ingress_tls_secret 2>/dev/null 1>&2; then
# Add annotation to identify secret containing TLS certs
oc -n $namespace annotate route $route_name cert-utils-operator.redhat-cop.io/certs-from-secret=$ingress_tls_secret
if oc -n "$namespace" get secret $ingress_tls_secret > /dev/null 2>&1; then
# Add annotation to identify secret containing TLS certs
oc -n "$namespace" annotate route $route_name cert-utils-operator.redhat-cop.io/certs-from-secret=$ingress_tls_secret
else
log_debug "The ingress secret [$ingress_tls_secret] does NOT exists, omitting annotation [certs-from-secret]."
log_debug "The ingress secret [$ingress_tls_secret] does NOT exists, omitting annotation [certs-from-secret]."
fi

log_info "OpenShift Route [$route_name] has been created."
Expand Down
Loading