Skip to content
Snippets Groups Projects
Commit 160f286a authored by Lorenz Boguhn's avatar Lorenz Boguhn
Browse files

Method to chage env Variables

parent 5607e330
No related branches found
No related tags found
4 merge requests!159Re-implementation of Theodolite with Kotlin/Quarkus,!157Update Graal Image in CI pipeline,!83WIP: Re-implementation of Theodolite with Kotlin/Quarkus,!78Resolve "Implement Quarkus/Kotlin protype"
This commit is part of merge request !78. Comments created here will be created in the context of that merge request.
......@@ -16,7 +16,7 @@ class DeploymentManager {
val path = "/home/lorenz/git/spesb/theodolite-quarkus/YAML/"
val theodoliteDeploment = "theodolite.yaml"
val service = "aggregation-service.yaml"
val workload = "workloadGenerator"
val workloadFile = "workloadGenerator.yaml"
val inputStream: InputStream = path.byteInputStream()
val client = DefaultKubernetesClient().inNamespace("default")
......@@ -24,14 +24,17 @@ class DeploymentManager {
val dp: Service = client.services().load(path+service).get();
val workload : Deployment = client.apps().deployments().load(path+workloadFile).get();
// TODO MAKE YAML LOADING CATCH EXEPTION
fun printFile(){
println()
fun printFile(){
println(dp.toString())
//println(workload)
changeWorkloadNumInstances(workload,5000)
//println(workload)
println(path)
......@@ -48,5 +51,19 @@ class DeploymentManager {
}
}
fun changeWorkloadNumInstances (dep: Deployment,num: String){
val vars = dep.spec.template.spec.containers.get(0).env.filter {
it.name == "NUM_SENSORS"
}.forEach {
x ->
x.value = num
}
println(vars)
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment