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"
...@@ -16,7 +16,7 @@ class DeploymentManager { ...@@ -16,7 +16,7 @@ class DeploymentManager {
val path = "/home/lorenz/git/spesb/theodolite-quarkus/YAML/" val path = "/home/lorenz/git/spesb/theodolite-quarkus/YAML/"
val theodoliteDeploment = "theodolite.yaml" val theodoliteDeploment = "theodolite.yaml"
val service = "aggregation-service.yaml" val service = "aggregation-service.yaml"
val workload = "workloadGenerator" val workloadFile = "workloadGenerator.yaml"
val inputStream: InputStream = path.byteInputStream() val inputStream: InputStream = path.byteInputStream()
val client = DefaultKubernetesClient().inNamespace("default") val client = DefaultKubernetesClient().inNamespace("default")
...@@ -24,14 +24,17 @@ class DeploymentManager { ...@@ -24,14 +24,17 @@ class DeploymentManager {
val dp: Service = client.services().load(path+service).get(); val dp: Service = client.services().load(path+service).get();
val workload : Deployment = client.apps().deployments().load(path+workloadFile).get();
fun printFile(){ // TODO MAKE YAML LOADING CATCH EXEPTION
println() fun printFile(){
println(dp.toString()) //println(workload)
changeWorkloadNumInstances(workload,5000)
//println(workload)
println(path) println(path)
...@@ -48,5 +51,19 @@ class DeploymentManager { ...@@ -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.
Please register or to comment