apiVersion: v1
kind: ConfigMap
metadata:
  name: example-configmap
data:
  uc1-kstreams-deployment.yaml: |-
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: titan-ccp-aggregation
    spec:
      selector:
        matchLabels:
          app: titan-ccp-aggregation
      replicas: 1
      template:
        metadata:
          labels:
            app: titan-ccp-aggregation
        spec:
          terminationGracePeriodSeconds: 0
          containers:
            - name: uc-application
              image: ghcr.io/cau-se/theodolite-uc1-kstreams-app:latest
              env:
                - name: KAFKA_BOOTSTRAP_SERVERS
                  value: "theodolite-cp-kafka:9092"
                - name: SCHEMA_REGISTRY_URL
                  value: "http://theodolite-cp-schema-registry:8081"
                - name: JAVA_OPTS
                  value: "-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=5555"
                - name: COMMIT_INTERVAL_MS # Set as default for the applications
                  value: "100"
              resources:
                limits:
                  memory: 4Gi
                  cpu: 1000m
  uc1-load-generator-deployment.yaml: |
    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: ghcr.io/cau-se/theodolite-uc1-workload-generator:latest
              ports:
                - containerPort: 5701
                  name: coordination
              env:
                - name: KUBERNETES_NAMESPACE
                  valueFrom:
                    fieldRef:
                      fieldPath: metadata.namespace
                - name: KUBERNETES_DNS_NAME
                  value: "titan-ccp-load-generator.$(KUBERNETES_NAMESPACE).svc.cluster.local"
                - name: KAFKA_BOOTSTRAP_SERVERS
                  value: "theodolite-cp-kafka:9092"
                - name: SCHEMA_REGISTRY_URL
                  value: "http://theodolite-cp-schema-registry:8081"
  uc1-load-generator-service.yaml: |
    apiVersion: v1
    kind: Service
    metadata:
      name: titan-ccp-load-generator
      labels:
        app: titan-ccp-load-generator
    spec:
      type: ClusterIP
      clusterIP: None
      selector:
        app: titan-ccp-load-generator
      ports:
        - name: coordination
          port: 5701
          targetPort: 5701
          protocol: TCP