Skip to content

Commit ee188b1

Browse files
committed
Merge branch 'main' into change-ac-recipes-to-use-new-auth-cli
2 parents 5567399 + f45e4f6 commit ee188b1

5 files changed

Lines changed: 41 additions & 13 deletions

File tree

recipes/newrelic/apm/php/debian.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,13 +354,13 @@ install:
354354
add_nr_source:
355355
cmds:
356356
- |
357-
echo 'deb http://apt.newrelic.com/debian/ newrelic non-free' | sudo tee /etc/apt/sources.list.d/newrelic.list
357+
echo 'deb [signed-by=/usr/share/keyrings/download.newrelic.com-newrelic.gpg] http://apt.newrelic.com/debian/ newrelic non-free' | sudo tee /etc/apt/sources.list.d/newrelic.list
358358
silent: true
359359

360360
add_gpg_key:
361361
cmds:
362362
- |
363-
curl -s https://download.newrelic.com/548C16BF.gpg | sudo apt-key add -
363+
curl -s https://download.newrelic.com/NEWRELIC_APT_2DAD550E.public | sudo gpg --import --batch --no-default-keyring --keyring /usr/share/keyrings/download.newrelic.com-newrelic.gpg
364364
silent: true
365365

366366
update_apt_nr_source:

recipes/newrelic/infrastructure/agent-control/debian.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,7 @@ install:
509509
chown root:root /etc/newrelic-agent-control/keys
510510
chmod 700 /etc/newrelic-agent-control/keys
511511
sudo mv /usr/bin/newrelic-auth-cli/newrelic-auth-cli-* /usr/local/bin/newrelic-auth-cli2
512+
sudo chmod +x /usr/local/bin/newrelic-auth-cli2
512513
513514
TEMPORAL_FOLDER=$(mktemp -d newrelic-agent-control.XXXXXXXXXX)
514515
chown root:root "${TEMPORAL_FOLDER}"

recipes/newrelic/infrastructure/agent-control/rhel.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,8 @@ install:
449449
mkdir -p /etc/newrelic-agent-control/keys
450450
chown root:root /etc/newrelic-agent-control/keys
451451
chmod 700 /etc/newrelic-agent-control/keys
452-
sudo mv /usr/bin/newrelic-auth-cli/newrelic-auth-cli-* /usr/local/bin/newrelic-auth-cli2
452+
sudo mv /usr/bin/newrelic-auth-cli/newrelic-auth-cli-* /usr/local/bin/newrelic-auth-cli2
453+
sudo chmod +x /usr/local/bin/newrelic-auth-cli2
453454
454455
TEMPORAL_FOLDER=$(mktemp -d newrelic-agent-control.XXXXXXXXXX)
455456
chown root:root "${TEMPORAL_FOLDER}"

recipes/newrelic/infrastructure/agent-control/suse.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,11 @@ install:
400400
chown root:root /etc/newrelic-agent-control/keys
401401
chmod 700 /etc/newrelic-agent-control/keys
402402
sudo mv /usr/bin/newrelic-auth-cli/newrelic-auth-cli-* /usr/local/bin/newrelic-auth-cli2
403+
sudo chmod +x /usr/local/bin/newrelic-auth-cli2
404+
echo $PATH
405+
cd /usr/local/bin
406+
ls | grep newrelic
407+
403408
404409
TEMPORAL_FOLDER=$(mktemp -d newrelic-agent-control.XXXXXXXXXX)
405410
chown root:root "${TEMPORAL_FOLDER}"
@@ -464,15 +469,14 @@ install:
464469
exit 1
465470
fi
466471
done
467-
472+
468473
CLIENT_ID=$(echo "$IDENTITY" | /usr/local/bin/newrelic utils jq '.client_id' | tr -d '"')
469474
mv "$TEMPORAL_FOLDER/identity" "/etc/newrelic-agent-control/keys/$CLIENT_ID.key"
470475
sed -i 's~token_url: PLACEHOLDER~token_url: '"$TOKEN_RENEWAL_ENDPOINT"'~g' /etc/newrelic-agent-control/config.yaml
471476
sed -i 's/client_id: PLACEHOLDER/client_id: '"$CLIENT_ID"'/g' /etc/newrelic-agent-control/config.yaml
472477
sed -i 's/provider: PLACEHOLDER/provider: local/g' /etc/newrelic-agent-control/config.yaml
473478
sed -i 's~private_key_path: PLACEHOLDER~private_key_path: '"/etc/newrelic-agent-control/keys/$CLIENT_ID.key"'~g' /etc/newrelic-agent-control/config.yaml
474479
fi
475-
476480
config_host_monitoring_otel:
477481
status:
478482
- test -f /etc/newrelic-agent-control/.nr-cli

recipes/newrelic/infrastructure/kubernetes.yml

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ install:
8181
NR_CLI_LOGGING_LOW_DATA_MODE="{{.NR_CLI_LOGGING_LOW_DATA_MODE}}"
8282
NR_CLI_AGENT_OPERATOR="{{.NR_CLI_AGENT_OPERATOR}}"
8383
NR_CLI_EAPM_AGENT="{{.NR_CLI_EAPM_AGENT}}"
84+
NR_CLI_WINDOWS="{{.NR_CLI_WINDOWS}}"
8485
8586
# Prometheus integrations
8687
@@ -146,6 +147,11 @@ install:
146147
echo "{\"Metadata\":{\"UnsupportedReason\":\"cut is not installed\"}}" | tee -a {{.NR_CLI_OUTPUT}}
147148
exit 131
148149
fi
150+
if [[ "{{.NR_CLI_OPEN_SHIFT}}" == "true" ]] && [[ "{{.NR_CLI_GKE_AUTOPILOT}}" == "true" ]] ; then
151+
echo "Both OpenShift and Gke Autopilot selected only one is allowed. Please only set one of NR_CLI_OPEN_SHIFT or NR_CLI_GKE_AUTOPILOT." >&2
152+
echo "{\"Metadata\":{\"UnsupportedReason\":\"cut is not installed\"}}" | tee -a {{.NR_CLI_OUTPUT}}
153+
exit 131
154+
fi
149155
150156
# Check the Kubernetes version
151157
KUBECTL_VERSION=$($SUDO $KUBECTL version --short 2>&1)
@@ -279,6 +285,12 @@ install:
279285
NR_CLI_LOGGING_LINUX_MOUNT_PATH=${NR_CLI_LOGGING_LINUX_MOUNT_PATH:-""}
280286
NR_CLI_AGENT_OPERATOR=${NR_CLI_AGENT_OPERATOR:-false}
281287
NR_CLI_EAPM_AGENT=${NR_CLI_EAPM_AGENT:-false}
288+
NR_CLI_WINDOWS=${NR_CLI_WINDOWS:-false}
289+
290+
NR_CLI_LOGGING_WINDOWS=false
291+
if [[ "$NR_CLI_LOGGING" == "true" && "$NR_CLI_WINDOWS" == "true" ]]; then
292+
NR_CLI_LOGGING_WINDOWS=true
293+
fi
282294
283295
# Prometheus integrations
284296
@@ -582,15 +594,20 @@ install:
582594
ARGS="${ARGS} --set ksm.enabled=${NR_CLI_KSM}"
583595
ARGS="${ARGS} --set k8s-agents-operator.enabled=${NR_CLI_AGENT_OPERATOR}"
584596
ARGS="${ARGS} --set newrelic-eapm-agent.enabled=${NR_CLI_EAPM_AGENT}"
597+
ARGS="${ARGS} --set newrelic-infrastructure.enableWindows=${NR_CLI_WINDOWS}"
598+
ARGS="${ARGS} --set newrelic-logging.enableWindows=${NR_CLI_LOGGING_WINDOWS}"
585599
586-
# if installing in GKE Autopilot, we need to turn off controlPlane and pixie and set kubelet scheme and port
600+
# if installing in GKE Autopilot, set the Provider to GKE_AUTOPILOT
587601
if [[ "{{.NR_CLI_GKE_AUTOPILOT}}" == "true" ]]; then
588-
ARGS="${ARGS} --set newrelic-infrastructure.controlPlane.enabled=false"
589-
ARGS="${ARGS} --set newrelic-infrastructure.kubelet.config.scheme=http"
590-
ARGS="${ARGS} --set newrelic-infrastructure.kubelet.config.port=10255"
602+
ARGS="${ARGS} --set global.provider=GKE_AUTOPILOT"
591603
ARGS="${ARGS} --set newrelic-pixie.enabled=false"
592604
fi
593605
606+
# if installing in OpenShift, set the Provider to OPEN_SHIFT
607+
if [[ "{{.NR_CLI_OPEN_SHIFT}}" == "true" ]]; then
608+
ARGS="${ARGS} --set global.provider=OPEN_SHIFT"
609+
fi
610+
594611
# leaving this commented out for the future
595612
# if [[ $SERVER_MAJOR_VERSION -eq 1 && $SERVER_MINOR_VERSION -lt 25 ]]; then
596613
# ARGS="${ARGS} --set kube-state-metrics.image.tag=v2.6.0"
@@ -699,12 +716,17 @@ install:
699716
BODY="${BODY},\"ksm.enabled\":\"${NR_CLI_KSM}\""
700717
BODY="${BODY},\"k8s-agents-operator.enabled\":\"${NR_CLI_AGENT_OPERATOR}\""
701718
BODY="${BODY},\"newrelic-eapm-agent.enabled\":\"${NR_CLI_EAPM_AGENT}\""
719+
BODY="${BODY},\"newrelic-infrastructure.enableWindows\":\"${NR_CLI_WINDOWS}\""
720+
BODY="${BODY},\"newrelic-logging.enableWindows\":\"${NR_CLI_LOGGING_WINDOWS}\""
702721
703-
# if installing in GKE Autopilot, turn off controlPlane and set kubelet scheme and port
722+
# if installing in GKE Autopilot, set Provider to GKE_AUTOPILOT
704723
if [[ "{{.NR_CLI_GKE_AUTOPILOT}}" == "true" ]]; then
705-
BODY="${BODY},\"newrelic-infrastructure.controlPlane.enabled\":\"false\""
706-
BODY="${BODY},\"newrelic-infrastructure.kubelet.config.scheme\":\"http\""
707-
BODY="${BODY},\"newrelic-infrastructure.kubelet.config.port\":\"10255\""
724+
BODY="${BODY},\"global.provider\":\"GKE_AUTOPILOT\""
725+
fi
726+
727+
# if installing in OpenShift, set Provider to OPEN_SHIFT
728+
if [[ "{{.NR_CLI_OPEN_SHIFT}}" == "true" ]]; then
729+
BODY="${BODY},\"global.provider\":\"OPEN_SHIFT\""
708730
fi
709731
710732
# leaving this commented out for the future

0 commit comments

Comments
 (0)