Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
theodolite
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sören Henning
theodolite
Commits
58f93b14
Commit
58f93b14
authored
3 years ago
by
Sören Henning
Browse files
Options
Downloads
Patches
Plain Diff
Add brief pause after K8s deletion (fix
#220
)
parent
ecc3aea7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!159
Re-implementation of Theodolite with Kotlin/Quarkus
,
!157
Update Graal Image in CI pipeline
,
!83
WIP: Re-implementation of Theodolite with Kotlin/Quarkus
Pipeline
#2925
canceled
3 years ago
Stage: build
Stage: test
Stage: check
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmarkDeployment.kt
+8
-2
8 additions, 2 deletions
...lin/theodolite/benchmark/KubernetesBenchmarkDeployment.kt
with
8 additions
and
2 deletions
theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmarkDeployment.kt
+
8
−
2
View file @
58f93b14
...
...
@@ -3,11 +3,14 @@ package theodolite.benchmark
import
io.fabric8.kubernetes.api.model.KubernetesResource
import
io.fabric8.kubernetes.client.NamespacedKubernetesClient
import
io.quarkus.runtime.annotations.RegisterForReflection
import
mu.KotlinLogging
import
org.apache.kafka.clients.admin.NewTopic
import
theodolite.k8s.K8sManager
import
theodolite.k8s.TopicManager
import
theodolite.util.KafkaConfig
private
val
logger
=
KotlinLogging
.
logger
{}
/**
* Organizes the deployment of benchmarks in Kubernetes.
*
...
...
@@ -26,7 +29,8 @@ class KubernetesBenchmarkDeployment(
)
:
BenchmarkDeployment
{
private
val
kafkaController
=
TopicManager
(
this
.
kafkaConfig
)
private
val
kubernetesManager
=
K8sManager
(
client
)
private
val
LABEL
=
"app.kubernetes.io/name=kafka-lag-exporter"
private
val
LAG_EXPORTER_POD_LABEL
=
"app.kubernetes.io/name=kafka-lag-exporter"
private
val
SLEEP_AFTER_K8S_DELETION_MS
=
2000L
/**
* Setup a [KubernetesBenchmark] using the [TopicManager] and the [K8sManager]:
...
...
@@ -52,7 +56,9 @@ class KubernetesBenchmarkDeployment(
resources
.
forEach
{
kubernetesManager
.
remove
(
it
)
}
logger
.
info
{
"Kubernetes resources deleted. Allow for short pause before continuing."
}
Thread
.
sleep
(
SLEEP_AFTER_K8S_DELETION_MS
)
kafkaController
.
removeTopics
(
this
.
topics
.
map
{
topic
->
topic
.
name
})
KafkaLagExporterRemover
(
client
).
remove
(
LABEL
)
KafkaLagExporterRemover
(
client
).
remove
(
LAG_EXPORTER_POD_
LABEL
)
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment