apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    k8s-app: jicofo
  name: jicofo
  namespace: jitsi
spec:
  replicas: 1 # one jicofo instance per shard
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
  selector:
    matchLabels:
      k8s-app: jicofo
  template:
    metadata:
      labels:
        k8s-app: jicofo
    spec:
      containers:
        - name: jicofo
          image: jitsi/jicofo:stable-5870
          imagePullPolicy: Always
          readinessProbe:
            # caution: this readinessProbe tries to create a new conference and hence also fails if
            # dependencies (jvb, prosody) are not available
            httpGet:
              path: /about/health
              port: 8888
          env:
            - name: XMPP_SERVER
              value: prosody
            - name: XMPP_DOMAIN
              value: peopleundercloud.com
            - name: XMPP_AUTH_DOMAIN
              value: auth.peopleundercloud.com
            - name: XMPP_MUC_DOMAIN
              value: muc.peopleundercloud.com
            - name: XMPP_INTERNAL_MUC_DOMAIN
              value: internal-muc.peopleundercloud.com
            - name: JICOFO_COMPONENT_SECRET
              valueFrom:
                secretKeyRef:
                  name: jitsi-config
                  key: JICOFO_COMPONENT_SECRET
            - name: JICOFO_AUTH_USER
              value: focus
            - name: JICOFO_AUTH_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: jitsi-config
                  key: JICOFO_AUTH_PASSWORD
            - name: TZ
              value: Asia/Seoul
            - name: JVB_BREWERY_MUC
              value: jvbbrewery
            - name: JICOFO_ENABLE_HEALTH_CHECKS
              value: "true"
            - name: PUBLIC_URL
              value: "https://peopleundercloud.com"
            - name: ENABLE_OCTO
              value: "true"