Skip to content

Commit

Permalink
fix: env variable not loaded by the scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
leiicamundi committed Nov 21, 2024
1 parent f39ee5e commit 01e66fe
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 39 deletions.
29 changes: 17 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ It verifies the presence and readiness of required containers within the deploym

##### Usage:
```bash
Usage: ./checks/kube/deployment.sh [-h] [-n NAMESPACE] [-d HELM_DEPLOYMENT_NAME] [-l] [-c REQUIRED_CONTAINERS]
Usage: ./checks/kube/deployment.sh [-h] [-n NAMESPACE] [-d HELM_DEPLOYMENT_NAME]
Options:
-h Display this help message
-n NAMESPACE Specify the namespace to use
-d HELM_DEPLOYMENT_NAME Specify the name of the helm deployment (default: camunda)
-l Skip checks of the helm deployment (default: 0)
-c REQUIRED_CONTAINERS Specify the list of containers to check (comma-separated, default: console connector web-modeler optimize zeebe zeebe-gateway)
-c Specify the list of containers to check (comma-separated, default: connector,optimize,zeebe,zeebe-gateway)
```

##### Example:
Expand All @@ -68,14 +68,17 @@ Please note that this check requires Helm to be deployed directly; using `helm t

##### Usage:
```bash
Usage: ./checks/kube/aws-irsa.sh [-h] [-n NAMESPACE] [-e EXCLUDE_COMPONENTS] [-p COMPONENTS_PG] [-l COMPONENTS_OS] [-s]
Usage: ./checks/kube/aws-irsa.sh [-h] [-n NAMESPACE] [-e EXCLUDE_COMPONENTS] [-p] [-l] [-s]
Options:
-h Display this help message
-n NAMESPACE Specify the namespace to use
-e EXCLUDE_COMPONENTS Comma-separated list of components to exclude from the check (reference of the component is the root key used in the chart)
-p COMPONENTS_PG Comma-separated list of components to check IRSA for PostgreSQL (overrides default list)
-l COMPONENTS_OS Comma-separated list of components to check IRSA for OpenSearch (overrides default list)
-s Disable pod spawn for IRSA and network flow verification
-n NAMESPACE Specify the namespace to use (required)
-e EXCLUDE_COMPONENTS Comma-separated list of Components to exclude from the check (reference of the component is the root key used in the chart)
-p Comma-separated list of Components to check IRSA for PostgreSQL (overrides default list: identityKeycloak,identity,webModeler)
-l Comma-separated list of Components to check IRSA for OpenSearch (overrides default list: zeebe,operate,tasklist,optimize)
-s Disable pod spawn for IRSA and connectivity verification.
By default, the script spawns jobs in the specified namespace to perform
IRSA checks and network connectivity tests. These jobs use the amazonlinux:latest
image and scan with nmap to verify connectivity.
```

##### Example:
Expand Down Expand Up @@ -106,7 +109,7 @@ It checks for the presence of services and ingresses that conform to the require

##### Usage:
```bash
Usage: ./checks/kube/connectivity.sh [-h] [-n NAMESPACE] [-i]
Usage: ./checks/kube/connectivity.sh [-h] [-n NAMESPACE] [-d HELM_DEPLOYMENT_NAME]
Options:
-h Display this help message
-n NAMESPACE Specify the namespace to use
Expand All @@ -133,10 +136,11 @@ This script retrieves an access token from an authorization server using client

##### Usage:
```bash
Usage: ./checks/zeebe/token.sh [-h] [-a ZEEBE_AUTHORIZATION_SERVER_URL] [-i ZEEBE_CLIENT_ID] [-s ZEEBE_CLIENT_SECRET] [-u ZEEBE_TOKEN_AUDIENCE]
Usage: ./checks/zeebe/token.sh [-h] [-a AUTH_SERVER_URL] [-i CLIENT_ID] [-s CLIENT_SECRET] [-u TOKEN_AUDIENCE]
Options:
-h Display this help message
-a ZEEBE_AUTHORIZATION_SERVER_URL Specify the authorization server URL (e.g.: https://local.distro.ultrawombat.com/auth/realms/camunda-platform/protocol/openid-connect/token)
-a ZEEBE_AUTHORIZATION_SERVER_URL Specify the authorization server URL (e.g.: https://local.distro.ultrawombat.com/auth/realms/camunda-platform/protocol/openid-connect/t
oken)
-i ZEEBE_CLIENT_ID Specify the client ID
-s ZEEBE_CLIENT_SECRET Specify the client secret
-u ZEEBE_TOKEN_AUDIENCE Specify the token audience
Expand Down Expand Up @@ -172,7 +176,8 @@ Options:
-k Skip TLS verification (insecure mode)
-r CACERT Specify the path to CA certificate file
-j CLIENTCERT Specify the path to Client certificate file
-a ZEEBE_AUTHORIZATION_SERVER_URL Specify the authorization server URL (e.g.: https://local.distro.example.com/auth/realms/camunda-platform/protocol/openid-connect/token)
-a ZEEBE_AUTHORIZATION_SERVER_URL Specify the authorization server URL (e.g.: https://local.distro.example.com/auth/realms/camunda-platform/protocol/openid-connect/t
oken)
-i ZEEBE_CLIENT_ID Specify the client ID
-s ZEEBE_CLIENT_SECRET Specify the client secret
-u ZEEBE_TOKEN_AUDIENCE Specify the token audience
Expand Down
10 changes: 5 additions & 5 deletions checks/kube/aws-irsa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ DIR_NAME=$(dirname "$0")
LVL_1_SCRIPT_NAME="$DIR_NAME/$SCRIPT_NAME"

# Default variables
NAMESPACE=""
NAMESPACE="${NAMESPACE:-""}"
SCRIPT_STATUS_OUTPUT=0
CHART_NAME="camunda-platform"
SPAWN_POD=true # By default, the pod will spawn for verification
Expand All @@ -21,7 +21,7 @@ COMPONENTS_TO_CHECK_IRSA_OS="zeebe,operate,tasklist,optimize"
# The second list is for components that need IRSA to authenticate to PostgreSQL
COMPONENTS_TO_CHECK_IRSA_PG="identityKeycloak,identity,webModeler"

EXCLUDE_COMPONENTS=""
EXCLUDE_COMPONENTS="${EXCLUDE_COMPONENTS:-""}"


# Associative array for case-insensitive component mapping
Expand All @@ -41,13 +41,13 @@ REQUIRED_AWSCLI_VERSION_V1="1.27.160"

# Usage message
usage() {
echo "Usage: $0 [-h] [-n NAMESPACE] [-e EXCLUDE_COMPONENTS] [-p COMPONENTS_PG] [-l COMPONENTS_OS] [-s]"
echo "Usage: $0 [-h] [-n NAMESPACE] [-e EXCLUDE_COMPONENTS] [-p] [-l] [-s]"
echo "Options:"
echo " -h Display this help message"
echo " -n NAMESPACE Specify the namespace to use (required)"
echo " -e EXCLUDE_COMPONENTS Comma-separated list of Components to exclude from the check (reference of the component is the root key used in the chart)"
echo " -p COMPONENTS_PG Comma-separated list of Components to check IRSA for PostgreSQL (overrides default list: $COMPONENTS_TO_CHECK_IRSA_PG)"
echo " -l COMPONENTS_OS Comma-separated list of Components to check IRSA for OpenSearch (overrides default list: $COMPONENTS_TO_CHECK_IRSA_OS)"
echo " -p Comma-separated list of Components to check IRSA for PostgreSQL (overrides default list: $COMPONENTS_TO_CHECK_IRSA_PG)"
echo " -l Comma-separated list of Components to check IRSA for OpenSearch (overrides default list: $COMPONENTS_TO_CHECK_IRSA_OS)"
echo " -s Disable pod spawn for IRSA and connectivity verification."
echo " By default, the script spawns jobs in the specified namespace to perform"
echo " IRSA checks and network connectivity tests. These jobs use the amazonlinux:latest"
Expand Down
2 changes: 1 addition & 1 deletion checks/kube/connectivity.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ DIR_NAME=$(dirname "$0")
LVL_1_SCRIPT_NAME="$DIR_NAME/$SCRIPT_NAME"

# Define default variables
NAMESPACE=""
NAMESPACE="${NAMESPACE:-""}"
SKIP_CHECK_INGRESS_CLASS=0

usage() {
Expand Down
9 changes: 5 additions & 4 deletions checks/kube/deployment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ DIR_NAME=$(dirname "$0")
LVL_1_SCRIPT_NAME="$DIR_NAME/$SCRIPT_NAME"

# Define default variables
NAMESPACE=""
HELM_DEPLOYMENT_NAME="camunda"
NAMESPACE="${NAMESPACE:-""}"
HELM_DEPLOYMENT_NAME="${HELM_DEPLOYMENT_NAME:-"camunda"}"
SKIP_CHECK_HELM_DEPLOYMENT=0
REQUIRED_CONTAINERS=("connector" "optimize" "zeebe" "zeebe-gateway")
DEFAULT_REQUIRED_CONTAINERS="connector,optimize,zeebe,zeebe-gateway"
REQUIRED_CONTAINERS=()

usage() {
echo "Usage: $0 [-h] [-n NAMESPACE] [-d HELM_DEPLOYMENT_NAME]"
Expand All @@ -20,7 +21,7 @@ usage() {
echo " -n NAMESPACE Specify the namespace to use"
echo " -d HELM_DEPLOYMENT_NAME Specify the name of the helm deployment (default: $HELM_DEPLOYMENT_NAME)"
echo " -l Skip checks of the helm deployment (default: $SKIP_CHECK_HELM_DEPLOYMENT)"
echo " -c REQUIRED_CONTAINERS Specify the list of containers to check (comma-separated, default: ${REQUIRED_CONTAINERS[*]})"
echo " -c Specify the list of containers to check (comma-separated, default: ${DEFAULT_REQUIRED_CONTAINERS})"
exit 1
}

Expand Down
23 changes: 12 additions & 11 deletions checks/zeebe/connectivity.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,25 @@ DIR_NAME=$(dirname "$0")
LVL_1_SCRIPT_NAME="$DIR_NAME/$SCRIPT_NAME"

# Define default variables
ZEEBE_HOST=""
PROTO_FILE=""
ZEEBE_HOST="${ZEEBE_HOST:-""}"
PROTO_FILE="${PROTO_FILE:-""}"
SKIP_TLS_VERIFICATION=""
EXTRA_FLAGS_CURL=""
EXTRA_FLAGS_GRPCURL=""
EXTRA_FLAGS_ZBCTL=""
EXTRA_FLAGS_TOKEN=""
CACERT=""
CLIENTCERT=""
ZEEBE_AUTHORIZATION_SERVER_URL=""
ZEEBE_CLIENT_ID=""
ZEEBE_CLIENT_SECRET=""
ZEEBE_TOKEN_AUDIENCE=""
ZEEBE_TOKEN_SCOPE="camunda-identity"
API_PROTOCOL="grpc"
CACERT="${CACERT:-""}"
CLIENTCERT="${CLIENTCERT:-""}"
ZEEBE_AUTHORIZATION_SERVER_URL="${ZEEBE_AUTHORIZATION_SERVER_URL:-""}"
ZEEBE_CLIENT_ID="${ZEEBE_CLIENT_ID:-""}"
ZEEBE_CLIENT_SECRET="${ZEEBE_CLIENT_SECRET:-""}"
ZEEBE_TOKEN_AUDIENCE="${ZEEBE_TOKEN_AUDIENCE:-""}"
ZEEBE_TOKEN_SCOPE="${ZEEBE_TOKEN_SCOPE:-"camunda-identity"}"
API_PROTOCOL="${API_PROTOCOL:-"grpc"}"

# renovate: datasource=github-releases depName=camunda/zeebe
ZEEBE_VERSION="8.6.5"
ZEEBE_DEFAULT_VERSION="8.6.5"
ZEEBE_VERSION="${ZEEBE_VERSION:-$ZEEBE_DEFAULT_VERSION}"

# Function to display script usage
usage() {
Expand Down
12 changes: 6 additions & 6 deletions checks/zeebe/token.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ DIR_NAME=$(dirname "$0")
LVL_1_SCRIPT_NAME="$DIR_NAME/$SCRIPT_NAME"

# Define default variables
ZEEBE_AUTHORIZATION_SERVER_URL=""
ZEEBE_CLIENT_ID=""
ZEEBE_CLIENT_SECRET=""
ZEEBE_TOKEN_AUDIENCE=""
ZEEBE_AUTHORIZATION_SERVER_URL="${ZEEBE_AUTHORIZATION_SERVER_URL:-""}"
ZEEBE_CLIENT_ID="${ZEEBE_CLIENT_ID:-""}"
ZEEBE_CLIENT_SECRET="${ZEEBE_CLIENT_SECRET:-""}"
ZEEBE_TOKEN_AUDIENCE="${ZEEBE_TOKEN_AUDIENCE:-""}"
SKIP_TLS_VERIFICATION=""
CACERT=""
CLIENTCERT=""
CACERT="${CACERT:-""}"
CLIENTCERT="${CLIENTCERT:-""}"
EXTRA_FLAGS_CURL=""

# Function to display script usage
Expand Down

0 comments on commit 01e66fe

Please sign in to comment.