Skip to content

Commit

Permalink
Update script
Browse files Browse the repository at this point in the history
  • Loading branch information
svetlanabrennan committed Dec 20, 2023
1 parent d230f98 commit fb16c7e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions recipes/newrelic/infrastructure/kubernetes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ install:
fi
ARGS="${ARGS} --set ksm.enabled=${NR_CLI_KSM}"
# if installing in GKE Autopilot, we need to turn off controlPlane and set kubelet scheme and port
# if installing in GKE Autopilot, we need to turn off controlPlane and pixie and set kubelet scheme and port
if [[ "$GKE_AUTOPILOT_ANSWER" == "Y" ]]; then
ARGS="${ARGS} --set newrelic-infrastructure.controlPlane.enabled=false"
ARGS="${ARGS} --set newrelic-infrastructure.kubelet.config.scheme=http"
Expand Down Expand Up @@ -620,10 +620,16 @@ install:
echo "{\"Metadata\":{\"helmVersion\":\"$($SUDO helm version -c --short)\", \"helmCommandBeforeExecution\":\"$SUDO helm upgrade $CLEANED_ARGS\", \"K8sClientVersion\":\"$CLIENT_MAJOR_VERSION.$CLIENT_MINOR_VERSION\",\"K8sServerVersion\":\"$SERVER_MAJOR_VERSION.$SERVER_MINOR_VERSION\",\"DebugMessage\":\"$DEBUG_MESSAGE\"}}" | tee -a {{.NR_CLI_OUTPUT}} > /dev/null
# With 2>&1 >/dev/null, ERROR only keeps the error message if $? is non-zero and is empty if $? is zero
echo "Installing newrelic-bundle......."
ERROR=$($SUDO helm upgrade $ARGS 2>&1 >/dev/null)
if [[ "${ERROR}" != "" ]]; then
echo "helm (version $HELM_VERSION) repo upgrade installation failed due to: $ERROR"
exit 131
if [[ "${GKE_AUTOPILOT_ANSWER}" == "Y" ]] && ! (echo "${ERROR}" | grep -q "Error"); then
echo "Warnings from GKE Autopilot: $ERROR"
break
else
echo "helm (version $HELM_VERSION) repo upgrade installation failed due to: $ERROR"
exit 131
fi
fi
else
echo ""
Expand Down Expand Up @@ -651,7 +657,7 @@ install:
BODY="${BODY},\"global.lowDataMode\":\"${NR_CLI_LOW_DATA_MODE}\""
BODY="${BODY},\"ksm.enabled\":\"${NR_CLI_KSM}\""
# # if installing in GKE Autopilot, turn off controlPlane and set kubelet scheme and port
# if installing in GKE Autopilot, turn off controlPlane and set kubelet scheme and port
# BODY="${BODY},\"newrelic-infrastructure.controlPlane\":\"false\""
# BODY="${BODY},\"newrelic-infrastructure.kubelet.config.scheme\":\"http\""
# BODY="${BODY},\""newrelic-infrastructure.kubelet.config.port\":\"10255\""
Expand Down

0 comments on commit fb16c7e

Please sign in to comment.