apiVersion: v1
kind: Pod
metadata:
  labels:
    app: platform-pod
  name: platform-pod
spec:
  automountServiceAccountToken: false
  containers:
  
    # Zookeeper
    - args:
        - /opt/bitnami/scripts/zookeeper/run.sh
      env:
        - name: ZOOKEEPER_TICK_TIME
          value: "2000"
        - name: ZOOKEEPER_CLIENT_PORT
          value: "2181"
        - name: ALLOW_ANONYMOUS_LOGIN
          value: "1"
      image: docker.io/bitnami/zookeeper:3.7
      name: zookeeper
      resources: {}
      securityContext:
        capabilities:
          drop:
            - CAP_MKNOD
            - CAP_NET_RAW
            - CAP_AUDIT_WRITE

    # Kafka
    - args:
        - /opt/bitnami/scripts/kafka/run.sh
      env:
        - name: KAFKA_BROKER_ID
          value: "1"
        - name: KAFKA_ZOOKEEPER_CONNECT
          value: localhost:2181
        - name: ALLOW_PLAINTEXT_LISTENER
          value: "1"
        - name: KAFKA_LOG4J_ROOT_LOGLEVEL
          value: INFO
        - name: KAFKA_ADVERTISED_LISTENERS
          value: PLAINTEXT://localhost:9092
        - name: KAFKA_LOG4J_LOGGERS
          value: kafka.controller
        - name: KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR
          value: "1"
      image: docker.io/bitnami/kafka:2.8.1
      name: kafka
      ports:
        - containerPort: 9092
          hostPort: 9092
      resources: {}
      securityContext:
        capabilities:
          drop:
            - CAP_MKNOD
            - CAP_NET_RAW
            - CAP_AUDIT_WRITE

    # Postgres
    - args:
        - postgres
      env:
        - name: POSTGRES_PORT
          value: "5432"
        - name: HOME
          value: /root
        - name: POSTGRES_USER
          value: postgres
        - name: POSTGRES_DB
          value: platform
        - name: POSTGRES_PASSWORD
          value: open
      image: docker.io/library/postgres:14-alpine
      name: database
      ports:
        - containerPort: 5432
          hostPort: 5432
      resources: {}
      securityContext:
        capabilities:
          drop:
            - CAP_MKNOD
            - CAP_NET_RAW
            - CAP_AUDIT_WRITE
      volumeMounts:
        - mountPath: /var/lib/postgresql/data
          name: platform-data-pvc

  enableServiceLinks: false
  hostname: platform-dev
  restartPolicy: Never
  volumes:
    - name: platform-data-pvc
      emptyDir:
        medium: Memory
        claimName: platform-data
status: {}
