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

Add sample Yamls + method to edit them

parent b0151b59
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"
apiVersion: v1
kind: Service
metadata:
name: titan-ccp-aggregation
labels:
app: titan-ccp-aggregation
spec:
#type: NodePort
selector:
app: titan-ccp-aggregation
ports:
- name: http
port: 80
targetPort: 80
protocol: TCP
- name: metrics
port: 9980
apiVersion: batch/v1
kind: Job
metadata:
name: theodolite
spec:
template:
spec:
volumes:
- name: theodolite-pv-storage
persistentVolumeClaim:
claimName: theodolite-pv-claim
containers:
- name: theodolite
image: bvonheid/theodolite:latest
# imagePullPolicy: Never # Used to pull "own" local image
env:
- name: UC # mandatory
value: "1"
- name: LOADS # mandatory
value: "100000, 200000"
- name: INSTANCES # mandatory
value: "1, 2, 3"
# - name: DURATION
# value: "5"
# - name: PARTITIONS
# value: "40"
# - name: DOMAIN_RESTRICTION
# value: "True"
# - name: SEARCH_STRATEGY
# value: "linear-search"
# - name: CPU_LIMIT
# value: "1000m"
# - name: MEMORY_LIMIT
# value: "4Gi"
- name: PROMETHEUS_BASE_URL
value: "http://prometheus-operated:9090"
# - name: NAMESPACE
# value: "default"
# - name: CONFIGURATIONS
# value: "COMMIT_INTERVAL_MS=100, NUM_STREAM_THREADS=1"
- name: RESULT_PATH
value: "results"
- name: PYTHONUNBUFFERED # Enable logs in Kubernetes
value: "1"
volumeMounts:
- mountPath: "/app/results"
name: theodolite-pv-storage
restartPolicy: Never
# Uncomment if RBAC is enabled and configured
# serviceAccountName: theodolite
backoffLimit: 4
apiVersion: apps/v1
kind: Deployment
metadata:
name: titan-ccp-load-generator
spec:
selector:
matchLabels:
app: titan-ccp-load-generator
replicas: 1
template:
metadata:
labels:
app: titan-ccp-load-generator
spec:
terminationGracePeriodSeconds: 0
containers:
- name: workload-generator
image: workload-generator:latest
env:
# Order need to be preserved for run_uc.py
- name: NUM_SENSORS
value: "25000"
- name: INSTANCES
value: "1"
- name: NUM_NESTED_GROUPS
value: "5"
- name: ZK_HOST
value: "my-confluent-cp-zookeeper"
- name: ZK_PORT
value: "2181"
- name: KAFKA_BOOTSTRAP_SERVERS
value: "my-confluent-cp-kafka:9092"
- name: SCHEMA_REGISTRY_URL
value: "http://my-confluent-cp-schema-registry:8081"
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
package theodolite
import com.fasterxml.jackson.annotation.JsonProperty
import io.fabric8.kubernetes.api.model.Service
import io.fabric8.kubernetes.api.model.apps.Deployment
import io.fabric8.kubernetes.client.DefaultKubernetesClient
import io.fabric8.kubernetes.client.dsl.RollableScalableResource
import java.io.File
import java.io.InputStream
import java.nio.file.Paths
class DeploymentManager {
val absolute = Paths.get("").toAbsolutePath().toString()
val path = "/home/lorenz/git/spesb/theodolite-quarkus/YAML/"
val theodoliteDeploment = "theodolite.yaml"
val service = "aggregation-service.yaml"
val workload = "workloadGenerator"
val inputStream: InputStream = path.byteInputStream()
val client = DefaultKubernetesClient().inNamespace("default")
//val deployment = client.apps().deployments().load(absolute + path)
val dp: Service = client.services().load(path+service).get();
fun printFile(){
println()
println(dp.toString())
println(path)
val f : File = File(path+theodoliteDeploment);
val fileAsString : String = String(f.readBytes())
//println(fileAsString.replace("theodolite","spesb"))
}
fun changeServiceName (service: Service,newName : String){
service.metadata.apply {
name = newName
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment