apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/component: api
    app.kubernetes.io/instance: observatorium-api
    app.kubernetes.io/name: observatorium-api
    app.kubernetes.io/version: master-2020-09-04-v0.1.1-131-ga4c5a9c
  name: observatorium-api
  namespace: observatorium
spec:
  replicas: 3
  selector:
    matchLabels:
      app.kubernetes.io/component: api
      app.kubernetes.io/instance: observatorium-api
      app.kubernetes.io/name: observatorium-api
  strategy:
    rollingUpdate:
      maxSurge: 0
      maxUnavailable: 1
  template:
    metadata:
      labels:
        app.kubernetes.io/component: api
        app.kubernetes.io/instance: observatorium-api
        app.kubernetes.io/name: observatorium-api
        app.kubernetes.io/version: master-2020-09-04-v0.1.1-131-ga4c5a9c
    spec:
      containers:
      - args:
        - --web.listen=0.0.0.0:8080
        - --web.internal.listen=0.0.0.0:8081
        - --metrics.read.endpoint=http://127.0.0.1:9091
        - --metrics.write.endpoint=http://127.0.0.1:19291
        - --log.level=warn
        - --logs.read.endpoint=http://127.0.0.1:3100
        - --logs.tail.endpoint=http://127.0.0.1:3100
        - --logs.write.endpoint=http://127.0.0.1:3100
        - --rbac.config=/etc/observatorium/rbac.yaml
        - --tenants.config=/etc/observatorium/tenants.yaml
        image: quay.io/observatorium/observatorium:master-2020-09-04-v0.1.1-131-ga4c5a9c
        livenessProbe:
          failureThreshold: 10
          httpGet:
            path: /live
            port: 8081
            scheme: HTTP
          periodSeconds: 30
        name: observatorium-api
        ports:
        - containerPort: 8081
          name: internal
        - containerPort: 8080
          name: public
        readinessProbe:
          failureThreshold: 12
          httpGet:
            path: /ready
            port: 8081
            scheme: HTTP
          periodSeconds: 5
        volumeMounts:
        - mountPath: /etc/observatorium/rbac.yaml
          name: rbac
          readOnly: true
          subPath: rbac.yaml
        - mountPath: /etc/observatorium/tenants.yaml
          name: tenants
          readOnly: true
          subPath: tenants.yaml
      serviceAccount: observatorium-api
      volumes:
      - configMap:
          name: observatorium-api
        name: rbac
      - name: tenants
        secret:
          secretName: observatorium-api
