apiVersion: v1
kind: Namespace
metadata:
  name: mvp-cc
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: auth-service
  namespace: mvp-cc
spec:
  replicas: 1
  selector:
    matchLabels:
      app: auth-service
  template:
    metadata:
      labels:
        app: auth-service
    spec:
      containers:
      - name: app
        image: mvp-cc-platform:latest
        imagePullPolicy: IfNotPresent
        env:
        - name: APP_MODULE
          value: 'services.auth_service.app:app'
        - name: CC_DATA_DIR
          value: '/var/lib/mvp-cc/data'
        - name: APP_TOKEN_SECRET
          value: 'change-me-app-token-secret'
        - name: APP_TOKEN_TTL_SECONDS
          value: '3600'
        - name: ALLOW_LEGACY_HEADER_AUTH
          value: '1'
        - name: VOICE_ADAPTER_TRUSTED_SERVICE_SUBJECTS
          value: 'svc:asterisk-bridge,svc:ivr-service'
        - name: OIDC_ENABLED
          value: '0'
        - name: OIDC_PROVIDER
          value: 'keycloak'
        - name: OIDC_ISSUER_URL
          value: 'https://keycloak.example.local/realms/mvp-cc'
        - name: OIDC_CLIENT_ID
          value: 'mvp-cc'
        - name: OIDC_CLIENT_SECRET
          value: 'change-me-keycloak-client-secret'
        - name: OIDC_REDIRECT_URI
          value: 'https://cc.example.local/proxy/auth/auth/oidc/callback'
        - name: OIDC_SCOPES
          value: 'openid profile email'
        - name: OIDC_ROLE_CLAIM
          value: 'groups'
        - name: OIDC_ROLE_MAP_JSON
          value: '{"kc_admin":"admin","kc_supervisor":"supervisor","kc_operator":"operator","kc_analyst":"analyst"}'
        ports:
        - containerPort: 8000
        readinessProbe:
          httpGet:
            path: /health
            port: 8000
          initialDelaySeconds: 5
          periodSeconds: 10
---
apiVersion: v1
kind: Service
metadata:
  name: auth-service
  namespace: mvp-cc
spec:
  selector:
    app: auth-service
  ports:
  - name: http
    port: 8000
    targetPort: 8000
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: audit-service
  namespace: mvp-cc
spec:
  replicas: 1
  selector:
    matchLabels:
      app: audit-service
  template:
    metadata:
      labels:
        app: audit-service
    spec:
      containers:
      - name: app
        image: mvp-cc-platform:latest
        imagePullPolicy: IfNotPresent
        env:
        - name: APP_MODULE
          value: 'services.audit_service.app:app'
        - name: CC_DATA_DIR
          value: '/var/lib/mvp-cc/data'
        - name: APP_TOKEN_SECRET
          value: 'change-me-app-token-secret'
        - name: APP_TOKEN_TTL_SECONDS
          value: '3600'
        - name: ALLOW_LEGACY_HEADER_AUTH
          value: '1'
        - name: RECORDING_IMPORT_TRUSTED_SERVICE_SUBJECTS
          value: 'svc:asterisk-bridge'
        - name: RECORDING_IMPORT_ALLOW_ADMIN
          value: '1'
        ports:
        - containerPort: 8000
        readinessProbe:
          httpGet:
            path: /health
            port: 8000
          initialDelaySeconds: 5
          periodSeconds: 10
---
apiVersion: v1
kind: Service
metadata:
  name: audit-service
  namespace: mvp-cc
spec:
  selector:
    app: audit-service
  ports:
  - name: http
    port: 8000
    targetPort: 8000
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: customer-service
  namespace: mvp-cc
spec:
  replicas: 1
  selector:
    matchLabels:
      app: customer-service
  template:
    metadata:
      labels:
        app: customer-service
    spec:
      containers:
      - name: app
        image: mvp-cc-platform:latest
        imagePullPolicy: IfNotPresent
        env:
        - name: APP_MODULE
          value: 'services.customer_service.app:app'
        - name: CC_DATA_DIR
          value: '/var/lib/mvp-cc/data'
        - name: APP_TOKEN_SECRET
          value: 'change-me-app-token-secret'
        - name: APP_TOKEN_TTL_SECONDS
          value: '3600'
        - name: ALLOW_LEGACY_HEADER_AUTH
          value: '1'
        - name: IVR_RUNTIME_TRUSTED_SERVICE_SUBJECTS
          value: 'svc:asterisk-bridge'
        ports:
        - containerPort: 8000
        readinessProbe:
          httpGet:
            path: /health
            port: 8000
          initialDelaySeconds: 5
          periodSeconds: 10
---
apiVersion: v1
kind: Service
metadata:
  name: customer-service
  namespace: mvp-cc
spec:
  selector:
    app: customer-service
  ports:
  - name: http
    port: 8000
    targetPort: 8000
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: interaction-service
  namespace: mvp-cc
spec:
  replicas: 1
  selector:
    matchLabels:
      app: interaction-service
  template:
    metadata:
      labels:
        app: interaction-service
    spec:
      containers:
      - name: app
        image: mvp-cc-platform:latest
        imagePullPolicy: IfNotPresent
        env:
        - name: APP_MODULE
          value: 'services.interaction_service.app:app'
        - name: CC_DATA_DIR
          value: '/var/lib/mvp-cc/data'
        - name: APP_TOKEN_SECRET
          value: 'change-me-app-token-secret'
        - name: APP_TOKEN_TTL_SECONDS
          value: '3600'
        - name: ALLOW_LEGACY_HEADER_AUTH
          value: '1'
        ports:
        - containerPort: 8000
        readinessProbe:
          httpGet:
            path: /health
            port: 8000
          initialDelaySeconds: 5
          periodSeconds: 10
---
apiVersion: v1
kind: Service
metadata:
  name: interaction-service
  namespace: mvp-cc
spec:
  selector:
    app: interaction-service
  ports:
  - name: http
    port: 8000
    targetPort: 8000
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: routing-service
  namespace: mvp-cc
spec:
  replicas: 1
  selector:
    matchLabels:
      app: routing-service
  template:
    metadata:
      labels:
        app: routing-service
    spec:
      containers:
      - name: app
        image: mvp-cc-platform:latest
        imagePullPolicy: IfNotPresent
        env:
        - name: APP_MODULE
          value: 'services.routing_service.app:app'
        - name: CC_DATA_DIR
          value: '/var/lib/mvp-cc/data'
        - name: APP_TOKEN_SECRET
          value: 'change-me-app-token-secret'
        - name: APP_TOKEN_TTL_SECONDS
          value: '3600'
        - name: ALLOW_LEGACY_HEADER_AUTH
          value: '1'
        ports:
        - containerPort: 8000
        readinessProbe:
          httpGet:
            path: /health
            port: 8000
          initialDelaySeconds: 5
          periodSeconds: 10
---
apiVersion: v1
kind: Service
metadata:
  name: routing-service
  namespace: mvp-cc
spec:
  selector:
    app: routing-service
  ports:
  - name: http
    port: 8000
    targetPort: 8000
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: voice-adapter-service
  namespace: mvp-cc
spec:
  replicas: 1
  selector:
    matchLabels:
      app: voice-adapter-service
  template:
    metadata:
      labels:
        app: voice-adapter-service
    spec:
      containers:
      - name: app
        image: mvp-cc-platform:latest
        imagePullPolicy: IfNotPresent
        env:
        - name: APP_MODULE
          value: 'services.voice_adapter_service.app:app'
        - name: CC_DATA_DIR
          value: '/var/lib/mvp-cc/data'
        - name: APP_TOKEN_SECRET
          value: 'change-me-app-token-secret'
        - name: APP_TOKEN_TTL_SECONDS
          value: '3600'
        - name: ALLOW_LEGACY_HEADER_AUTH
          value: '1'
        ports:
        - containerPort: 8000
        readinessProbe:
          httpGet:
            path: /health
            port: 8000
          initialDelaySeconds: 5
          periodSeconds: 10
---
apiVersion: v1
kind: Service
metadata:
  name: voice-adapter-service
  namespace: mvp-cc
spec:
  selector:
    app: voice-adapter-service
  ports:
  - name: http
    port: 8000
    targetPort: 8000
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: telegram-adapter-service
  namespace: mvp-cc
spec:
  replicas: 1
  selector:
    matchLabels:
      app: telegram-adapter-service
  template:
    metadata:
      labels:
        app: telegram-adapter-service
    spec:
      containers:
      - name: app
        image: mvp-cc-platform:latest
        imagePullPolicy: IfNotPresent
        env:
        - name: APP_MODULE
          value: 'services.telegram_adapter_service.app:app'
        - name: CC_DATA_DIR
          value: '/var/lib/mvp-cc/data'
        - name: APP_TOKEN_SECRET
          value: 'change-me-app-token-secret'
        - name: APP_TOKEN_TTL_SECONDS
          value: '3600'
        - name: ALLOW_LEGACY_HEADER_AUTH
          value: '1'
        ports:
        - containerPort: 8000
        readinessProbe:
          httpGet:
            path: /health
            port: 8000
          initialDelaySeconds: 5
          periodSeconds: 10
---
apiVersion: v1
kind: Service
metadata:
  name: telegram-adapter-service
  namespace: mvp-cc
spec:
  selector:
    app: telegram-adapter-service
  ports:
  - name: http
    port: 8000
    targetPort: 8000
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: webchat-adapter-service
  namespace: mvp-cc
spec:
  replicas: 1
  selector:
    matchLabels:
      app: webchat-adapter-service
  template:
    metadata:
      labels:
        app: webchat-adapter-service
    spec:
      containers:
      - name: app
        image: mvp-cc-platform:latest
        imagePullPolicy: IfNotPresent
        env:
        - name: APP_MODULE
          value: 'services.webchat_adapter_service.app:app'
        - name: CC_DATA_DIR
          value: '/var/lib/mvp-cc/data'
        - name: APP_TOKEN_SECRET
          value: 'change-me-app-token-secret'
        - name: APP_TOKEN_TTL_SECONDS
          value: '3600'
        - name: ALLOW_LEGACY_HEADER_AUTH
          value: '1'
        - name: EVENT_BUS_ENABLED
          value: '1'
        - name: EVENT_BUS_URL
          value: 'amqp://guest:guest@rabbitmq:5672/'
        - name: EVENT_BUS_EXCHANGE
          value: 'mvpcc.domain.events'
        - name: EVENT_BUS_CONSUMER_ENABLED
          value: '1'
        - name: EVENT_BUS_AUDIT_QUEUE
          value: 'mvpcc.audit.events'
        - name: EVENT_BUS_REPORTING_QUEUE
          value: 'mvpcc.reporting.events'
        ports:
        - containerPort: 8000
        readinessProbe:
          httpGet:
            path: /health
            port: 8000
          initialDelaySeconds: 5
          periodSeconds: 10
---
apiVersion: v1
kind: Service
metadata:
  name: webchat-adapter-service
  namespace: mvp-cc
spec:
  selector:
    app: webchat-adapter-service
  ports:
  - name: http
    port: 8000
    targetPort: 8000
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: email-adapter-service
  namespace: mvp-cc
spec:
  replicas: 1
  selector:
    matchLabels:
      app: email-adapter-service
  template:
    metadata:
      labels:
        app: email-adapter-service
    spec:
      containers:
      - name: app
        image: mvp-cc-platform:latest
        imagePullPolicy: IfNotPresent
        env:
        - name: APP_MODULE
          value: 'services.email_adapter_service.app:app'
        - name: CC_DATA_DIR
          value: '/var/lib/mvp-cc/data'
        - name: APP_TOKEN_SECRET
          value: 'change-me-app-token-secret'
        - name: APP_TOKEN_TTL_SECONDS
          value: '3600'
        - name: ALLOW_LEGACY_HEADER_AUTH
          value: '1'
        - name: EVENT_BUS_ENABLED
          value: '1'
        - name: EVENT_BUS_URL
          value: 'amqp://guest:guest@rabbitmq:5672/'
        - name: EVENT_BUS_EXCHANGE
          value: 'mvpcc.domain.events'
        - name: EVENT_BUS_CONSUMER_ENABLED
          value: '1'
        - name: EVENT_BUS_AUDIT_QUEUE
          value: 'mvpcc.audit.events'
        - name: EVENT_BUS_REPORTING_QUEUE
          value: 'mvpcc.reporting.events'
        ports:
        - containerPort: 8000
        readinessProbe:
          httpGet:
            path: /health
            port: 8000
          initialDelaySeconds: 5
          periodSeconds: 10
---
apiVersion: v1
kind: Service
metadata:
  name: email-adapter-service
  namespace: mvp-cc
spec:
  selector:
    app: email-adapter-service
  ports:
  - name: http
    port: 8000
    targetPort: 8000
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: kb-service
  namespace: mvp-cc
spec:
  replicas: 1
  selector:
    matchLabels:
      app: kb-service
  template:
    metadata:
      labels:
        app: kb-service
    spec:
      containers:
      - name: app
        image: mvp-cc-platform:latest
        imagePullPolicy: IfNotPresent
        env:
        - name: APP_MODULE
          value: 'services.kb_service.app:app'
        - name: CC_DATA_DIR
          value: '/var/lib/mvp-cc/data'
        - name: APP_TOKEN_SECRET
          value: 'change-me-app-token-secret'
        - name: APP_TOKEN_TTL_SECONDS
          value: '3600'
        - name: ALLOW_LEGACY_HEADER_AUTH
          value: '1'
        ports:
        - containerPort: 8000
        readinessProbe:
          httpGet:
            path: /health
            port: 8000
          initialDelaySeconds: 5
          periodSeconds: 10
---
apiVersion: v1
kind: Service
metadata:
  name: kb-service
  namespace: mvp-cc
spec:
  selector:
    app: kb-service
  ports:
  - name: http
    port: 8000
    targetPort: 8000
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: reporting-service
  namespace: mvp-cc
spec:
  replicas: 1
  selector:
    matchLabels:
      app: reporting-service
  template:
    metadata:
      labels:
        app: reporting-service
    spec:
      containers:
      - name: app
        image: mvp-cc-platform:latest
        imagePullPolicy: IfNotPresent
        env:
        - name: APP_MODULE
          value: 'services.reporting_service.app:app'
        - name: CC_DATA_DIR
          value: '/var/lib/mvp-cc/data'
        - name: APP_TOKEN_SECRET
          value: 'change-me-app-token-secret'
        - name: APP_TOKEN_TTL_SECONDS
          value: '3600'
        - name: ALLOW_LEGACY_HEADER_AUTH
          value: '1'
        ports:
        - containerPort: 8000
        readinessProbe:
          httpGet:
            path: /health
            port: 8000
          initialDelaySeconds: 5
          periodSeconds: 10
---
apiVersion: v1
kind: Service
metadata:
  name: reporting-service
  namespace: mvp-cc
spec:
  selector:
    app: reporting-service
  ports:
  - name: http
    port: 8000
    targetPort: 8000
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: supervisor-service
  namespace: mvp-cc
spec:
  replicas: 1
  selector:
    matchLabels:
      app: supervisor-service
  template:
    metadata:
      labels:
        app: supervisor-service
    spec:
      containers:
      - name: app
        image: mvp-cc-platform:latest
        imagePullPolicy: IfNotPresent
        env:
        - name: APP_MODULE
          value: 'services.supervisor_service.app:app'
        - name: CC_DATA_DIR
          value: '/var/lib/mvp-cc/data'
        ports:
        - containerPort: 8000
        readinessProbe:
          httpGet:
            path: /health
            port: 8000
          initialDelaySeconds: 5
          periodSeconds: 10
---
apiVersion: v1
kind: Service
metadata:
  name: supervisor-service
  namespace: mvp-cc
spec:
  selector:
    app: supervisor-service
  ports:
  - name: http
    port: 8000
    targetPort: 8000
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: recording-service
  namespace: mvp-cc
spec:
  replicas: 1
  selector:
    matchLabels:
      app: recording-service
  template:
    metadata:
      labels:
        app: recording-service
    spec:
      containers:
      - name: app
        image: mvp-cc-platform:latest
        imagePullPolicy: IfNotPresent
        env:
        - name: APP_MODULE
          value: 'services.recording_service.app:app'
        - name: CC_DATA_DIR
          value: '/var/lib/mvp-cc/data'
        - name: CC_RECORDINGS_DIR
          value: '/var/lib/mvp-cc/data/recordings'
        - name: RECORDING_MAX_BYTES
          value: '26214400'
        - name: APP_TOKEN_SECRET
          value: 'change-me-app-token-secret'
        - name: APP_TOKEN_TTL_SECONDS
          value: '3600'
        - name: ALLOW_LEGACY_HEADER_AUTH
          value: '1'
        ports:
        - containerPort: 8000
        readinessProbe:
          httpGet:
            path: /health
            port: 8000
          initialDelaySeconds: 5
          periodSeconds: 10
---
apiVersion: v1
kind: Service
metadata:
  name: recording-service
  namespace: mvp-cc
spec:
  selector:
    app: recording-service
  ports:
  - name: http
    port: 8000
    targetPort: 8000
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: ivr-service
  namespace: mvp-cc
spec:
  replicas: 1
  selector:
    matchLabels:
      app: ivr-service
  template:
    metadata:
      labels:
        app: ivr-service
    spec:
      containers:
      - name: app
        image: mvp-cc-platform:latest
        imagePullPolicy: IfNotPresent
        env:
        - name: APP_MODULE
          value: 'services.ivr_service.app:app'
        - name: CC_DATA_DIR
          value: '/var/lib/mvp-cc/data'
        - name: APP_TOKEN_SECRET
          value: 'change-me-app-token-secret'
        - name: APP_TOKEN_TTL_SECONDS
          value: '3600'
        - name: ALLOW_LEGACY_HEADER_AUTH
          value: '1'
        ports:
        - containerPort: 8000
        readinessProbe:
          httpGet:
            path: /health
            port: 8000
          initialDelaySeconds: 5
          periodSeconds: 10
---
apiVersion: v1
kind: Service
metadata:
  name: ivr-service
  namespace: mvp-cc
spec:
  selector:
    app: ivr-service
  ports:
  - name: http
    port: 8000
    targetPort: 8000
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: api-gateway
  namespace: mvp-cc
spec:
  replicas: 1
  selector:
    matchLabels:
      app: api-gateway
  template:
    metadata:
      labels:
        app: api-gateway
    spec:
      containers:
      - name: app
        image: mvp-cc-platform:latest
        imagePullPolicy: IfNotPresent
        env:
        - name: APP_MODULE
          value: 'gateway.app:app'
        - name: CC_DATA_DIR
          value: '/var/lib/mvp-cc/data'
        - name: APP_TOKEN_SECRET
          value: 'change-me-app-token-secret'
        - name: APP_TOKEN_TTL_SECONDS
          value: '3600'
        - name: ALLOW_LEGACY_HEADER_AUTH
          value: '1'
        - name: AUTH_SERVICE_URL
          value: 'http://auth-service:8000'
        - name: AUDIT_SERVICE_URL
          value: 'http://audit-service:8000'
        - name: CUSTOMER_SERVICE_URL
          value: 'http://customer-service:8000'
        - name: INTERACTION_SERVICE_URL
          value: 'http://interaction-service:8000'
        - name: ROUTING_SERVICE_URL
          value: 'http://routing-service:8000'
        - name: VOICE_ADAPTER_SERVICE_URL
          value: 'http://voice-adapter-service:8000'
        - name: RECORDING_SERVICE_URL
          value: 'http://recording-service:8000'
        - name: IVR_SERVICE_URL
          value: 'http://ivr-service:8000'
        - name: TELEGRAM_ADAPTER_SERVICE_URL
          value: 'http://telegram-adapter-service:8000'
        - name: WEBCHAT_ADAPTER_SERVICE_URL
          value: 'http://webchat-adapter-service:8000'
        - name: EMAIL_ADAPTER_SERVICE_URL
          value: 'http://email-adapter-service:8000'
        - name: KB_SERVICE_URL
          value: 'http://kb-service:8000'
        - name: REPORTING_SERVICE_URL
          value: 'http://reporting-service:8000'
        - name: SUPERVISOR_SERVICE_URL
          value: 'http://supervisor-service:8000'
        - name: EVENT_BUS_SERVICE_URL
          value: 'http://event-bus-service:8000'
        - name: ASTERISK_BRIDGE_SERVICE_URL
          value: 'http://asterisk-bridge-service:8000'
        ports:
        - containerPort: 8000
        readinessProbe:
          httpGet:
            path: /health
            port: 8000
          initialDelaySeconds: 5
          periodSeconds: 10
---
apiVersion: v1
kind: Service
metadata:
  name: api-gateway
  namespace: mvp-cc
spec:
  selector:
    app: api-gateway
  ports:
  - name: http
    port: 8000
    targetPort: 8000
  type: LoadBalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: rabbitmq
  namespace: mvp-cc
spec:
  replicas: 1
  selector:
    matchLabels:
      app: rabbitmq
  template:
    metadata:
      labels:
        app: rabbitmq
    spec:
      containers:
      - name: rabbitmq
        image: rabbitmq:3-management
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 5672
        - containerPort: 15672
---
apiVersion: v1
kind: Service
metadata:
  name: rabbitmq
  namespace: mvp-cc
spec:
  selector:
    app: rabbitmq
  ports:
  - name: amqp
    port: 5672
    targetPort: 5672
  - name: management
    port: 15672
    targetPort: 15672
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: event-bus-service
  namespace: mvp-cc
spec:
  replicas: 1
  selector:
    matchLabels:
      app: event-bus-service
  template:
    metadata:
      labels:
        app: event-bus-service
    spec:
      containers:
      - name: app
        image: mvp-cc-platform:latest
        imagePullPolicy: IfNotPresent
        env:
        - name: APP_MODULE
          value: 'services.event_bus_service.app:app'
        - name: CC_DATA_DIR
          value: '/var/lib/mvp-cc/data'
        - name: APP_TOKEN_SECRET
          value: 'change-me-app-token-secret'
        - name: APP_TOKEN_TTL_SECONDS
          value: '3600'
        - name: ALLOW_LEGACY_HEADER_AUTH
          value: '1'
        - name: EVENT_BUS_ENABLED
          value: '1'
        - name: EVENT_BUS_URL
          value: 'amqp://guest:guest@rabbitmq:5672/'
        - name: EVENT_BUS_EXCHANGE
          value: 'mvpcc.domain.events'
        - name: EVENT_BUS_DISPATCH_BATCH_SIZE
          value: '50'
        - name: EVENT_BUS_MAX_ATTEMPTS
          value: '5'
        - name: EVENT_BUS_POLL_INTERVAL_SECONDS
          value: '2'
        - name: EVENT_BUS_CONSUMER_ENABLED
          value: '1'
        - name: EVENT_BUS_AUDIT_QUEUE
          value: 'mvpcc.audit.events'
        - name: EVENT_BUS_REPORTING_QUEUE
          value: 'mvpcc.reporting.events'
        ports:
        - containerPort: 8000
        readinessProbe:
          httpGet:
            path: /health
            port: 8000
          initialDelaySeconds: 5
          periodSeconds: 10
---
apiVersion: v1
kind: Service
metadata:
  name: event-bus-service
  namespace: mvp-cc
spec:
  selector:
    app: event-bus-service
  ports:
  - name: http
    port: 8000
    targetPort: 8000
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: asterisk-bridge-service
  namespace: mvp-cc
spec:
  # Must stay singleton: background AMI consumption and retry/reconcile loops are not multi-replica safe.
  replicas: 1
  selector:
    matchLabels:
      app: asterisk-bridge-service
  template:
    metadata:
      labels:
        app: asterisk-bridge-service
    spec:
      containers:
      - name: app
        image: mvp-cc-platform:latest
        imagePullPolicy: IfNotPresent
        env:
        - name: APP_MODULE
          value: 'services.asterisk_bridge_service.app:app'
        - name: CC_DATA_DIR
          value: '/var/lib/mvp-cc/data'
        - name: APP_TOKEN_SECRET
          value: 'change-me-app-token-secret'
        - name: APP_TOKEN_TTL_SECONDS
          value: '3600'
        - name: ALLOW_LEGACY_HEADER_AUTH
          value: '0'
        - name: ASTERISK_BRIDGE_ENABLED
          value: '0'
        - name: ASTERISK_AMI_HOST
          value: ''
        - name: ASTERISK_AMI_PORT
          value: '5038'
        - name: ASTERISK_AMI_USERNAME
          value: ''
        - name: ASTERISK_AMI_SECRET
          value: ''
        - name: ASTERISK_AMI_EVENT_PREFIX
          value: 'MVPCC'
        - name: ASTERISK_QUEUE_MAP_JSON
          value: '{}'
        - name: ASTERISK_SFTP_HOST
          value: ''
        - name: ASTERISK_SFTP_PORT
          value: '22'
        - name: ASTERISK_SFTP_USERNAME
          value: ''
        - name: ASTERISK_SFTP_PASSWORD
          value: ''
        - name: ASTERISK_SFTP_BASE_PATH
          value: '/var/spool/asterisk/monitor'
        - name: ASTERISK_BRIDGE_POLL_INTERVAL_SECONDS
          value: '1'
        - name: ASTERISK_BRIDGE_AUTH_MODE
          value: 'bearer'
        - name: ASTERISK_BRIDGE_AUTH_FALLBACK_LEGACY
          value: '0'
        - name: ASTERISK_BRIDGE_AUTH_SUBJECT
          value: 'svc:asterisk-bridge'
        - name: ASTERISK_BRIDGE_AUTH_USER
          value: 'asterisk-bridge'
        - name: ASTERISK_BRIDGE_AUTH_ROLE
          value: 'admin'
        - name: ASTERISK_BRIDGE_AUTH_TOKEN_TTL_SECONDS
          value: '300'
        - name: ASTERISK_IVR_FASTAGI_ENABLED
          value: '0'
        - name: ASTERISK_IVR_FASTAGI_HOST
          value: '0.0.0.0'
        - name: ASTERISK_IVR_FASTAGI_PORT
          value: '4573'
        - name: ASTERISK_IVR_DTMF_TIMEOUT_SECONDS
          value: '5'
        - name: ASTERISK_IVR_MAX_NO_INPUT_RETRIES
          value: '2'
        - name: ASTERISK_IVR_MAX_INVALID_RETRIES
          value: '2'
        - name: ASTERISK_IVR_CALL_LINK_WAIT_SECONDS
          value: '5'
        - name: ASTERISK_CALLCONTROL_ENABLED
          value: '0'
        - name: ASTERISK_CALLCONTROL_ACTION_TIMEOUT_SECONDS
          value: '10'
        - name: ASTERISK_OPERATOR_EXTENSION_MAP_JSON
          value: '{}'
        - name: ASTERISK_TRANSFER_TARGET_MAP_JSON
          value: '{}'
        - name: ASTERISK_CALLCONTROL_CLAIM_CONTEXT
          value: 'mvpcc-claim'
        - name: ASTERISK_CALLCONTROL_TRANSFER_CONTEXT
          value: 'mvpcc-transfer'
        - name: INTERACTION_SERVICE_URL
          value: 'http://interaction-service:8000'
        - name: VOICE_ADAPTER_SERVICE_URL
          value: 'http://voice-adapter-service:8000'
        - name: RECORDING_SERVICE_URL
          value: 'http://recording-service:8000'
        - name: IVR_SERVICE_URL
          value: 'http://ivr-service:8000'
        ports:
        - containerPort: 8000
        - containerPort: 4573
        readinessProbe:
          httpGet:
            path: /health
            port: 8000
          initialDelaySeconds: 5
          periodSeconds: 10
---
apiVersion: v1
kind: Service
metadata:
  name: asterisk-bridge-service
  namespace: mvp-cc
spec:
  selector:
    app: asterisk-bridge-service
  ports:
  - name: http
    port: 8000
    targetPort: 8000
  - name: fastagi
    port: 4573
    targetPort: 4573
---

