Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
#255 Removed live.dynatrace.com
Browse files Browse the repository at this point in the history
  • Loading branch information
johannes-b committed May 9, 2019
1 parent 8d2c4b1 commit 471da33
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
10 changes: 5 additions & 5 deletions install/scripts/applyAutoTaggingRules.sh
Expand Up @@ -2,11 +2,11 @@

source ./utils.sh

DT_TENANT_ID=$1
DT_TENANT=$1
DT_API_TOKEN=$2

curl -X POST \
"https://$DT_TENANT_ID.live.dynatrace.com/api/config/v1/autoTags?Api-Token=$DT_API_TOKEN" \
"https://$DT_TENANT/api/config/v1/autoTags?Api-Token=$DT_API_TOKEN" \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{
Expand Down Expand Up @@ -39,12 +39,12 @@ curl -X POST \

if [[ $1 != '0' ]]; then
echo ""
print_error "Tagging rule for service could not be created in tenant $DT_TENANT_ID."
print_error "Tagging rule for service could not be created in tenant $DT_TENANT."
exit 1
fi

curl -X POST \
"https://$DT_TENANT_ID.live.dynatrace.com/api/config/v1/autoTags?Api-Token=$DT_API_TOKEN" \
"https://$DT_TENANT/api/config/v1/autoTags?Api-Token=$DT_API_TOKEN" \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{
Expand Down Expand Up @@ -77,6 +77,6 @@ curl -X POST \

if [[ $1 != '0' ]]; then
echo ""
print_error "Tagging rule for environment could not be created in tenant $DT_TENANT_ID."
print_error "Tagging rule for environment could not be created in tenant $DT_TENANT."
exit 1
fi
9 changes: 6 additions & 3 deletions install/scripts/createServiceEntry.sh
Expand Up @@ -2,16 +2,19 @@

source ./utils.sh

entries=$(curl https://$1.live.dynatrace.com/api/v1/deployment/installer/agent/connectioninfo?Api-Token=$2 | jq -r '.communicationEndpoints[]')
DT_TENANT=$1
DT_API_TOKEN=$2

entries=$(curl https://$DT_TENANT/api/v1/deployment/installer/agent/connectioninfo?Api-Token=$DT_API_TOKEN | jq -r '.communicationEndpoints[]')

rm -f ../manifests/gen/service_entries_oneagent.yml
rm -f ../manifests/gen/hosts
rm -f ../manifests/gen/service_entries

cat ../manifests/istio/service_entries_tpl/header_tmpl >> ../manifests/gen/service_entries_oneagent.yml

echo -e " - $1.live.dynatrace.com" >> ../manifests/gen/hosts
cat ../manifests/istio/service_entries_tpl/service_entry_tmpl | sed 's~ENDPOINT_PLACEHOLDER~'"$1"'.live.dynatrace.com~' >> ../manifests/gen/service_entries
echo -e " - $DT_TENANT" >> ../manifests/gen/hosts
cat ../manifests/istio/service_entries_tpl/service_entry_tmpl | sed 's~ENDPOINT_PLACEHOLDER~'"$DT_TENANT"'~' >> ../manifests/gen/service_entries

for row in $entries; do
row=$(echo $row | sed 's~https://~~')
Expand Down
2 changes: 1 addition & 1 deletion install/scripts/defineDynatraceCredentials.sh
Expand Up @@ -7,7 +7,7 @@ CREDS=./creds_dt.json
rm $CREDS 2> /dev/null

echo -e "${YLW}Please enter the credentials as requested below: ${NC}"
read -p "Dynatrace Tenant ID (8-digits) (default=$DTENV): " DTENVC
read -p "Dynatrace Tenant {your-domain}/e/{your-environment-id} for managed or {your-environment-id}.live.dynatrace.com for SaaS (default=$DTENV): " DTENVC
read -p "Dynatrace API Token (default=$DTAPI): " DTAPIC
read -p "Dynatrace PaaS Token (default=$DTAPI): " DTPAAST
echo ""
Expand Down
10 changes: 5 additions & 5 deletions install/scripts/deployDynatrace.sh
Expand Up @@ -2,7 +2,7 @@

source ./utils.sh

DT_TENANT_ID=$(cat creds_dt.json | jq -r '.dynatraceTenant')
DT_TENANT=$(cat creds_dt.json | jq -r '.dynatraceTenant')
DT_API_TOKEN=$(cat creds_dt.json | jq -r '.dynatraceApiToken')
DT_PAAS_TOKEN=$(cat creds_dt.json | jq -r '.dynatracePaaSToken')

Expand All @@ -27,22 +27,22 @@ verify_kubectl $? "Creating secret for Dynatrace OneAgent failed."
rm -f ../manifests/gen/cr.yml

curl -o ../manifests/dynatrace/cr.yml https://raw.githubusercontent.com/Dynatrace/dynatrace-oneagent-operator/$LATEST_RELEASE/deploy/cr.yaml
cat ../manifests/dynatrace/cr.yml | sed 's/ENVIRONMENTID/'"$DT_TENANT_ID"'/' >> ../manifests/gen/cr.yml
cat ../manifests/dynatrace/cr.yml | sed 's/ENVIRONMENTID/'"$DT_TENANT"'/' >> ../manifests/gen/cr.yml

kubectl apply -f ../manifests/gen/cr.yml
verify_kubectl $? "Creating Dynatrace OneAgent failed."

# Apply auto tagging rules in Dynatrace
print_info "Applying auto tagging rules in Dynatrace."
./applyAutoTaggingRules.sh $DT_TENANT_ID $DT_API_TOKEN
./applyAutoTaggingRules.sh $DT_TENANT $DT_API_TOKEN
verify_install_step $? "Applying auto tagging rules in Dynatrace failed."
print_info "Applying auto tagging rules in Dynatrace done."

print_info "Creating service entries for Dynatrace OneAgent."
./createServiceEntry.sh $DT_TENANT_ID $DT_PAAS_TOKEN
./createServiceEntry.sh $DT_TENANT $DT_PAAS_TOKEN
verify_install_step $? "Creating service entries for Dynatrace OneAgent failed."
print_info "Creating service entries for Dynatrace OneAgent done."

# Create secrets to be used by keptn services
kubectl -n keptn create secret generic dynatrace --from-literal="DT_API_TOKEN=$DT_API_TOKEN" --from-literal="DT_TENANT_ID=$DT_TENANT_ID"
kubectl -n keptn create secret generic dynatrace --from-literal="DT_API_TOKEN=$DT_API_TOKEN" --from-literal="DT_TENANT=$DT_TENANT"
verify_kubectl $? "Creating dynatrace secret for keptn services failed."

0 comments on commit 471da33

Please sign in to comment.