#
# Copyright (c) Dell Inc., or its subsidiaries. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#

# Kubernetes deployment for rtsp-camera-to-pravega.py.
#
# Install with:
#   kubectl -n examples create secret generic camera-group-1 --type=kubernetes.io/basic-auth --from-literal=username=yourname --from-literal=password=yourpassword
#   kubectl -n examples apply -f rtsp-camera-to-pravega-sample.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: rtsp-camera-to-pravega-1
spec:
  replicas: 1
  selector:
    matchLabels:
      app: rtsp-camera-to-pravega-1
  template:
    metadata:
      labels:
        app: rtsp-camera-to-pravega-1
    spec:
      serviceAccount: examples-pravega
      containers:
      - name: gstreamer
        image: devops-repo.isus.emc.com:8116/nautilus/gstreamer:pravega-dev
        imagePullPolicy: Always
        command: ["rtsp-camera-to-pravega.py"]
        env:
        - name: ALLOW_CREATE_SCOPE
          value: "false"
        - name: CAMERA_ADDRESS
          value: "10.246.27.131"
        - name: CAMERA_PATH
          #value: "/cam/realmonitor?width=2048&height=1080&fps=60&key_frame_interval_max=60&show_clock=false&target_rate_kilobytes_per_sec=4000"
          value: "/cam/realmonitor?width=1280&height=720&fps=30&key_frame_interval_max=30&show_clock=true&target_rate_kilobytes_per_sec=400"
        - name: CAMERA_PORT
          value: "8554"
        - name: CAMERA_PROTOCOLS
          value: "tcp"
        - name: CAMERA_USER
          valueFrom:
            secretKeyRef:
              name: camera-group-1
              key: username
        - name: CAMERA_PASSWORD
          valueFrom:
            secretKeyRef:
              name: camera-group-1
              key: password
        - name: DEBUGSPY
          value: "false"
        - name: FAKESINK
          value: "false"
        - name: GST_DEBUG
          value: "WARNING,rtspsrc:INFO,rtpbin:INFO,rtpsession:INFO,rtpjitterbuffer:INFO,h264parse:WARN,pravegasink:DEBUG"
        - name: pravega_client_tls_cert_path
          value: "/etc/ssl/certs/DST_Root_CA_X3.pem"
        - name: PRAVEGA_STREAM
          value: "video35"
