Skip to content

Commit 8d1b7f4

Browse files
committed
Use configmap hack
It turns out that the problem discussed in the last commit is fixed by kubernetes/minikube#13013. This is not present in a minikube release yet, so we can't rely on it. That said, this commit introduces a hack whereby the bootstrap is passed in a configmap. This limits the size of the bootstrap with all the problems that come along with a low-entropy experiment. Signed-off-by: Brian L. Troutwine <[email protected]>
1 parent ac55a60 commit 8d1b7f4

File tree

10 files changed

+40
-25
lines changed

10 files changed

+40
-25
lines changed

soaks/bin/run_experiment.sh

-10
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,6 @@ minikube mount "${SOAK_CAPTURE_DIR}:/captures" &
9090
CAPTURE_MOUNT_PID=$!
9191
popd
9292

93-
pushd "${SOAK_ROOT}/tests/${SOAK_NAME}"
94-
mkdir --parents data
95-
# Mount the data directory. This is where the data that supports the test are
96-
# mounted into the minikube. The software running in the minikube will not write
97-
# to this directory.
98-
minikube mount "${SOAK_ROOT}/tests/${SOAK_NAME}/data:/data" &
99-
DATA_MOUNT_PID=$!
100-
popd
101-
10293
pushd "${SOAK_ROOT}/tests/${SOAK_NAME}/terraform"
10394
terraform init
10495
terraform apply -var "type=${VARIANT}" -var "vector_image=${IMAGE}" -var "vector_cpus=${VECTOR_CPUS}" -var "lading_image=ghcr.io/blt/lading:sha-0da91906d56acc899b829cea971d79f13e712e21" -auto-approve -compact-warnings -input=false -no-color
@@ -108,7 +99,6 @@ sleep "${WARMUP_GRACE}"
10899
echo "[${VARIANT}] Recording captures to ${SOAK_CAPTURE_DIR}"
109100
sleep "${TOTAL_SAMPLES}"
110101
kill "${CAPTURE_MOUNT_PID}"
111-
kill "${DATA_MOUNT_PID}"
112102
popd
113103

114104
pushd "${__dir}"

soaks/common/terraform/modules/lading_http_blackhole/variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ variable "http-blackhole-yaml" {
1515

1616
variable "lading_image" {
1717
description = "The lading image to run"
18-
type = string
18+
type = string
1919
}

soaks/common/terraform/modules/lading_http_gen/main.tf

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
resource "kubernetes_config_map" "lading_bootstrap" {
2+
metadata {
3+
name = "lading-http-gen-bootstrap"
4+
namespace = var.namespace
5+
}
6+
7+
data = {
8+
"bootstrap.log" = var.http-gen-static-bootstrap
9+
}
10+
}
11+
112
resource "kubernetes_config_map" "lading" {
213
metadata {
314
name = "lading-http-gen"
@@ -113,8 +124,8 @@ resource "kubernetes_deployment" "http-gen" {
113124
}
114125
volume {
115126
name = "data"
116-
host_path {
117-
path = "/data"
127+
config_map {
128+
name = kubernetes_config_map.lading_bootstrap.metadata[0].name
118129
}
119130
}
120131
}

soaks/common/terraform/modules/lading_http_gen/variables.tf

+8-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,14 @@ variable "http-gen-yaml" {
1313
type = string
1414
}
1515

16+
variable "http-gen-static-bootstrap" {
17+
description = "Boostrap log to be used for static variant, mounted at /data/boostrap.log"
18+
type = string
19+
default = ""
20+
}
21+
22+
1623
variable "lading_image" {
1724
description = "The lading image to run"
18-
type = string
25+
type = string
1926
}

soaks/common/terraform/modules/lading_splunk_hec_blackhole/variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ variable "splunk-hec-blackhole-yaml" {
1515

1616
variable "lading_image" {
1717
description = "The lading image to run"
18-
type = string
18+
type = string
1919
}

soaks/common/terraform/modules/lading_splunk_hec_gen/variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ variable "splunk-hec-gen-yaml" {
1515

1616
variable "lading_image" {
1717
description = "The lading image to run"
18-
type = string
18+
type = string
1919
}

soaks/common/terraform/modules/lading_tcp_gen/variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ variable "tcp-gen-yaml" {
1515

1616
variable "lading_image" {
1717
description = "The lading image to run"
18-
type = string
18+
type = string
1919
}

soaks/tests/http_pipelines_blackhole/terraform/http_gen.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ prometheus_addr: "0.0.0.0:9090"
44
targets:
55
vector:
66
headers: {}
7-
target_uri: "http://vector:8282/v1/input"
7+
target_uri: "http://vector:8282/"
88
bytes_per_second: "500 Mb"
99
parallel_connections: 10
1010
method:
1111
post:
1212
maximum_prebuild_cache_size_bytes: "256 Mb"
1313
variant:
1414
static:
15-
static_path: "/tmp/input.log"
15+
static_path: "/data/bootstrap.log"

soaks/tests/http_pipelines_blackhole/terraform/main.tf

+13-6
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,17 @@ module "vector" {
4444
depends_on = [module.monitoring]
4545
}
4646
module "http-gen" {
47-
source = "../../../common/terraform/modules/lading_http_gen"
48-
type = var.type
49-
http-gen-yaml = file("${path.module}/http_gen.yaml")
50-
namespace = kubernetes_namespace.soak.metadata[0].name
51-
lading_image = var.lading_image
52-
depends_on = [module.monitoring, module.vector]
47+
source = "../../../common/terraform/modules/lading_http_gen"
48+
type = var.type
49+
http-gen-yaml = file("${path.module}/http_gen.yaml")
50+
# This is a hack. Ultimately this creates a configmap in the minikube, where
51+
# we would _prefer_ to simply mount a directory into the kube. This is not
52+
# possible, pending introductoin of
53+
# https://github.com/kubernetes/minikube/issues/12301 into a release. Keep in
54+
# mind that the bootstrap _must_ be below 1MB in size, which severely limits
55+
# the entropy of our experiment.
56+
http-gen-static-bootstrap = file("${path.module}/data/http_gen_bootstrap.log")
57+
namespace = kubernetes_namespace.soak.metadata[0].name
58+
lading_image = var.lading_image
59+
depends_on = [module.monitoring, module.vector]
5360
}

0 commit comments

Comments
 (0)