Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions multipass/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ commands will detect it and remind you to do so if necessary.
- `splunk_realm`: Observability Realm
- `splunk_presetup`: Provide a preconfigured instance (OTel Collector and Online Boutique deployed with RUM enabled)
- `splunk_jdk`: Install OpenJDK and Maven on the instance (for PetClinic workshop or other Java based workshops)
- `otel_demo` : Install and configure the OpenTelemetry Telescope Shop Demo. This requires that `splunk_presetup` is set to FALSE. The default is FALSE

## 6. Create Terraform variables file

Expand All @@ -76,6 +77,7 @@ splunk_rum_token = "1234xxxx5678yyyy"
splunk_realm = "us1"
splunk_presetup = true
splunk_jdk = false
otel_demo = false
```

Then run `terraform plan` to see what will be created. Once happy run `terraform apply` to create the instances.
Expand Down
1 change: 1 addition & 0 deletions multipass/terraform.tfvars.template
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ splunk_realm = ""
# Optional
splunk_presetup = false
splunk_jdk = false
otel_demo = false
1 change: 1 addition & 0 deletions workshop/aws/ec2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ The following variables are available. Edit `terraform.tfvars` to reflect what y

- `splunk_presetup`: Provide a preconfigured instance (OTel Collector and Online Boutique deployed with RUM enabled). The default is FALSE.
- `splunk_jdk`: Install OpenJDK and Maven on the instance. The default is FALSE.
- `otel_demo` : Install and configure the OpenTelemetry Astronomy Shop Demo. This requires that `splunk_presetup` is set to FALSE. The default is FALSE

## 6. Create a Terraform plan

Expand Down
6 changes: 6 additions & 0 deletions workshop/aws/ec2/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ locals {
realm = var.splunk_realm
presetup = var.splunk_presetup
jdk = var.splunk_jdk
otel_demo = var.otel_demo
instance_password = random_string.password.result
}
}
Expand Down Expand Up @@ -219,5 +220,10 @@ resource "aws_instance" "observability-instance" {
condition = var.splunk_presetup ? try(var.splunk_access_token, "") != "" && try(var.splunk_realm, "") != "" && try(var.splunk_rum_token, "") != "" : true
error_message = "When requesting a pre-setup instance, splunk_realm, splunk_access_token and splunk_rum_token are required and cannot be null/empty"
}
precondition {
# if otel_demo=true, tokens and realm cannot be empty. also presetup cannot also be true.
condition = var.otel_demo ? try(var.splunk_access_token, "") != "" && try(var.splunk_realm, "") != "" && try(var.splunk_rum_token, "") != "" && try(var.splunk_presetup, "") == false : true
error_message = "When requesting an otel_demo, splunk_realm, splunk_access_token and splunk_rum_token are required and cannot be null/empty. splunk_presetup variable must also be set to false. "
}
}
}
15 changes: 15 additions & 0 deletions workshop/aws/ec2/templates/userdata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,21 @@ write_files:
fi
%{ endif ~}

%{ if otel_demo == true ~}
export RUM_TOKEN=${rum_token}
mkdir otel-demo && cd otel-demo
curl -s -OL https://raw.githubusercontent.com/splunk/observability-workshop/main/oteldemo/otel-demo-collector.yaml
curl -s -OL https://raw.githubusercontent.com/splunk/observability-workshop/main/oteldemo/otel-demo.yaml
if [ ! -f ~/.helmok ]; then
helm repo add splunk-otel-collector-chart https://signalfx.github.io/splunk-otel-collector-chart
helm repo update
helm install splunk-otel-collector --set="splunkObservability.realm=$REALM" --set="splunkObservability.accessToken=$ACCESS_TOKEN" --set="clusterName=$(hostname)-k3s-cluster" --set="splunkObservability.logsEnabled=true" --set="logsEngine=otel" --set="splunkObservability.profilingEnabled=true" --set="splunkObservability.infrastructureMonitoringEventsEnabled=true" --set="networkExplorer.enabled=true" --set="networkExplorer.podSecurityPolicy.enabled=false" --set="agent.enabled=true" --set="gateway.replicaCount=1" --set="gateway.resources.limits.cpu=500m" --set="gateway.resources.limits.memory=1Gi" --set="clusterReceiver.enabled=true" --set="environment=$(hostname)-apm-env" splunk-otel-collector-chart/splunk-otel-collector -f otel-demo-collector.yaml
helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts
helm install my-otel-demo open-telemetry/opentelemetry-demo --values otel-demo.yaml
cd /home/ubuntu
fi
%{ endif ~}

export KUBECONFIG=/home/ubuntu/.kube/config
alias kc='kubectl'
alias dc='docker-compose'
Expand Down
1 change: 1 addition & 0 deletions workshop/aws/ec2/terraform.tfvars.template
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ splunk_realm = ""
# optional
splunk_presetup = false
splunk_jdk = false
otel_demo = false
6 changes: 6 additions & 0 deletions workshop/aws/ec2/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ variable "splunk_jdk" {
default = false
}

variable "otel_demo" {
description = "Spin up the OpenTelemetry Astronomy Shop Demo? (true/false)"
type = bool
default = false
}

variable "aws_instance_count" {
description = "Instance Count (Usually 1)"
nullable = false
Expand Down