Skip to content

Commit a002501

Browse files
Merge pull request #21 from OutSystems/RDSHDT-2032
2 parents fc38e36 + db50d3f commit a002501

File tree

3 files changed

+51
-6
lines changed

3 files changed

+51
-6
lines changed

scripts/linux-installer.sh

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ DEFAULT_ENV="ea" # Default environment as per the release state. Change this val
1414
DEFAULT_OPERATION="install"
1515
DEFAULT_USE_ACR="false" # Temporary backward compatibility for Azure ACR
1616
DEFAULT_PEGASUS_ENABLED="false" # Enable Pegasus features
17+
DEFAULT_KEVENTS_REPLICAS="0" # Number of Kevents replicas (0 or 1) - Used to push Kubernetes events to Grafana
1718

1819
# Environment-specific settings
1920
ECR_ALIAS_GA="j0s5s8b0/ga" # GA ECR alias
@@ -28,6 +29,7 @@ ENV="$DEFAULT_ENV"
2829
OPERATION="$DEFAULT_OPERATION"
2930
USE_ACR="$DEFAULT_USE_ACR"
3031
PEGASUS_ENABLED="$DEFAULT_PEGASUS_ENABLED"
32+
KEVENTS_REPLICAS="$DEFAULT_KEVENTS_REPLICAS"
3133

3234
# Derived configuration (set by setup_environment)
3335
ECR_ALIAS=""
@@ -76,6 +78,7 @@ OPTIONS:
7678
[TEMPORARY: Backward compatibility for Azure ACR]
7779
--pegasus-enabled=BOOLEAN Enable Pegasus features: true, false (default: false)
7880
Note: Only supported in test environment
81+
--kevents-replicas=NUMBER Number of Kevents replicas: 0, 1 (default: 0)
7982
--help, -h Show this help message
8083
8184
OPERATIONS:
@@ -156,6 +159,12 @@ validate_arguments() {
156159
log_info "Current environment: $ENV"
157160
return 1
158161
fi
162+
163+
# Validate Kevents replicas configuration
164+
if [[ "$KEVENTS_REPLICAS" != "0" && "$KEVENTS_REPLICAS" != "1" ]]; then
165+
log_error "Invalid value for kevents-replicas: '$KEVENTS_REPLICAS'. Must be 0 or 1"
166+
return 1
167+
fi
159168

160169
# Validate ACR configuration only for install operation
161170
if [[ "$USE_ACR" == "true" ]]; then
@@ -243,6 +252,14 @@ parse_arguments() {
243252
;;
244253
esac
245254
;;
255+
--kevents-replicas=*)
256+
KEVENTS_REPLICAS="${1#*=}"
257+
if [[ "$KEVENTS_REPLICAS" != "0" && "$KEVENTS_REPLICAS" != "1" ]]; then
258+
log_error "Invalid value for --kevents-replicas: '$KEVENTS_REPLICAS'. Must be 0 or 1"
259+
exit 1
260+
fi
261+
log_info "Kevents replicas set to: $KEVENTS_REPLICAS"
262+
;;
246263
--help|-h)
247264
show_usage
248265
exit 0
@@ -568,7 +585,8 @@ sho_install() {
568585
--set "registry.username=${SP_ID}" \
569586
--set "registry.password=${SP_SECRET}" \
570587
--set "enableECR.enabled=false" \
571-
--set "pegasusEnabled=$PEGASUS_ENABLED" 2>&1)
588+
--set "pegasusEnabled=$PEGASUS_ENABLED" \
589+
--set "keventsReplicas=$KEVENTS_REPLICAS" 2>&1)
572590
else
573591
install_output=$(helm upgrade --install "${CHART_NAME}" "${chart_file}" \
574592
--namespace "$NAMESPACE" \
@@ -578,7 +596,8 @@ sho_install() {
578596
--set "image.tag=v${SHO_VERSION}" \
579597
--set-string "podAnnotations.timestamp=$timestamp" \
580598
--set "ring=$ENV" \
581-
--set "pegasusEnabled=$PEGASUS_ENABLED" 2>&1)
599+
--set "pegasusEnabled=$PEGASUS_ENABLED" \
600+
--set "keventsReplicas=$KEVENTS_REPLICAS" 2>&1)
582601
fi
583602

584603
if [[ $? -eq 0 ]]; then
@@ -881,6 +900,7 @@ show_configuration() {
881900
if [[ "$OPERATION" == "install" ]]; then
882901
echo "Version: ${SHO_VERSION:-latest}"
883902
echo "Use ACR: $USE_ACR"
903+
echo "Kevents Replicas: $KEVENTS_REPLICAS"
884904
fi
885905
echo "Namespace: $NAMESPACE"
886906
echo "Chart Name: $CHART_NAME"

scripts/macos-installer.sh

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ DEFAULT_ENV="ea" # Default environment as per the release state. Change this val
1414
DEFAULT_OPERATION="install"
1515
DEFAULT_USE_ACR="false" # Temporary backward compatibility for Azure ACR
1616
DEFAULT_PEGASUS_ENABLED="false" # Enable Pegasus features
17+
DEFAULT_KEVENTS_REPLICAS="0" # Number of Kevents replicas (0 or 1) - Used to push Kubernetes events to Grafana
1718

1819
# Environment-specific settings
1920
ECR_ALIAS_GA="j0s5s8b0/ga" # GA ECR alias
@@ -28,6 +29,7 @@ ENV="$DEFAULT_ENV"
2829
OPERATION="$DEFAULT_OPERATION"
2930
USE_ACR="$DEFAULT_USE_ACR"
3031
PEGASUS_ENABLED="$DEFAULT_PEGASUS_ENABLED"
32+
KEVENTS_REPLICAS="$DEFAULT_KEVENTS_REPLICAS"
3133

3234
# Derived configuration (set by setup_environment)
3335
ECR_ALIAS=""
@@ -79,6 +81,7 @@ OPTIONS:
7981
[TEMPORARY: Backward compatibility for Azure ACR]
8082
--pegasus-enabled=BOOLEAN Enable Pegasus features: true, false (default: false)
8183
Note: Only supported in test environment
84+
--kevents-replicas=NUMBER Number of Kevents replicas: 0, 1 (default: 0)
8285
--help, -h Show this help message
8386
8487
OPERATIONS:
@@ -160,6 +163,12 @@ validate_arguments() {
160163
log_info "Current environment: $ENV"
161164
return 1
162165
fi
166+
167+
# Validate Kevents replicas configuration
168+
if [[ "$KEVENTS_REPLICAS" != "0" && "$KEVENTS_REPLICAS" != "1" ]]; then
169+
log_error "Invalid value for kevents-replicas: '$KEVENTS_REPLICAS'. Must be 0 or 1"
170+
return 1
171+
fi
163172

164173
# Validate ACR configuration only for install operation
165174
if [[ "$USE_ACR" == "true" ]]; then
@@ -247,6 +256,14 @@ parse_arguments() {
247256
;;
248257
esac
249258
;;
259+
--kevents-replicas=*)
260+
KEVENTS_REPLICAS="${1#*=}"
261+
if [[ "$KEVENTS_REPLICAS" != "0" && "$KEVENTS_REPLICAS" != "1" ]]; then
262+
log_error "Invalid value for --kevents-replicas: '$KEVENTS_REPLICAS'. Must be 0 or 1"
263+
exit 1
264+
fi
265+
log_info "Kevents replicas set to: $KEVENTS_REPLICAS"
266+
;;
250267
--help|-h)
251268
show_usage
252269
exit 0
@@ -578,7 +595,8 @@ sho_install() {
578595
--set "registry.username=${SP_ID}" \
579596
--set "registry.password=${SP_SECRET}" \
580597
--set "enableECR.enabled=false" \
581-
--set "pegasusEnabled=$PEGASUS_ENABLED" 2>&1)
598+
--set "pegasusEnabled=$PEGASUS_ENABLED" \
599+
--set "keventsReplicas=$KEVENTS_REPLICAS" 2>&1)
582600
else
583601
install_output=$(helm upgrade --install "${CHART_NAME}" "${chart_file}" \
584602
--namespace "$NAMESPACE" \
@@ -588,7 +606,8 @@ sho_install() {
588606
--set "image.tag=v${SHO_VERSION}" \
589607
--set-string "podAnnotations.timestamp=$timestamp" \
590608
--set "ring=$ENV" \
591-
--set "pegasusEnabled=$PEGASUS_ENABLED" 2>&1)
609+
--set "pegasusEnabled=$PEGASUS_ENABLED" \
610+
--set "keventsReplicas=$KEVENTS_REPLICAS" 2>&1)
592611
fi
593612

594613
if [[ $? -eq 0 ]]; then
@@ -892,6 +911,7 @@ show_configuration() {
892911
if [[ "$OPERATION" == "install" ]]; then
893912
echo "Version: ${SHO_VERSION:-latest}"
894913
echo "Use ACR: $USE_ACR"
914+
echo "Kevents Replicas: $KEVENTS_REPLICAS"
895915
fi
896916
echo "Namespace: $NAMESPACE"
897917
echo "Chart Name: $CHART_NAME"

scripts/windows-installer.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ param(
1010
[string]$use_acr = "false", # Temporary backward compatibility for Azure ACR
1111
[ValidateSet("true", "false")]
1212
[string]$pegasus_enabled = "false", # Enable Pegasus features
13+
[ValidateSet("0", "1")]
14+
[string]$kevents_replicas = "0", # Number of Kevents replicas - Used to push Kubernetes events to Grafana
1315
[switch]$UseAcr,
1416
[Alias("h")]
1517
[switch]$help
@@ -41,6 +43,7 @@ $Script:Env = $env
4143
$Script:Op = $operation
4244
$Script:UseAcr = if ($UseAcr.IsPresent) { $true } elseif ($use_acr -eq "true") { $true } else { $false }
4345
$Script:PegasusEnabled = if ($pegasus_enabled -eq "true") { $true } else { $false }
46+
$Script:KeventsReplicas = [int]$kevents_replicas
4447

4548
# Derived configuration
4649
$Script:EcrAlias = ""
@@ -100,6 +103,7 @@ OPTIONS:
100103
[TEMPORARY: Backward compatibility for Azure ACR]
101104
-pegasus_enabled BOOLEAN Enable Pegasus features: true, false (default: false)
102105
Note: Only supported in test environment
106+
-kevents_replicas NUMBER Number of Kevents replicas: 0, 1 (default: 0)
103107
-help, -h Show this help message
104108
105109
OPERATIONS:
@@ -613,7 +617,8 @@ function Install-Sho {
613617

614618
# Add pegasusEnabled to helm arguments
615619
$helmArgs += @(
616-
"--set", "pegasusEnabled=$($Script:PegasusEnabled.ToString().ToLower())"
620+
"--set", "pegasusEnabled=$($Script:PegasusEnabled.ToString().ToLower())",
621+
"--set", "keventsReplicas=$Script:KeventsReplicas"
617622
)
618623

619624
$installOutput = & helm $helmArgs 2>&1
@@ -1075,7 +1080,7 @@ Chart Name: $Script:ChartName
10751080
Repository: $Script:PubRegistry/$Script:ChartRepository
10761081
Image Registry: $Script:PubRegistry/$Script:ImageRegistry
10771082
$(if ($Script:Op -eq 'install') {
1078-
"Version: $Script:ShoVersion`nUse ACR: $Script:UseAcr"
1083+
"Version: $Script:ShoVersion`nUse ACR: $Script:UseAcr`nKevents Replicas: $Script:KeventsReplicas"
10791084
})
10801085
10811086
"@

0 commit comments

Comments
 (0)