apiVersion: apps/v1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    io.kompose.service: trillian-ctfe
  name: trillian-ctfe-deployment
spec:
  replicas: 4
  selector:
    matchLabels:
        io.kompose.service: trillian-ctfe
  strategy: {}
  template:
    metadata:
      labels:
        io.kompose.service: trillian-ctfe
    spec:
      containers:
        - name: trillian-ctfe
          args: [
            "--http_endpoint=0.0.0.0:6962",
            "--metrics_endpoint=0.0.0.0:6963",
            "--log_config=/ctfe-config/ct_server.cfg",
            "--alsologtostderr"
          ]
          image: gcr.io/${PROJECT_ID}/ctfe:${IMAGE_TAG}
          imagePullPolicy: Always
          resources:
            limits:
              cpu: 1.8
            requests:
              cpu: 300m
          livenessProbe:
            httpGet:
              path: /metrics
              port: metrics
            failureThreshold: 3
            periodSeconds: 30
            timeoutSeconds: 30
          env:
            - name: CLOUD_PROJECT
              valueFrom:
                configMapKeyRef:
                  name: ctfe-configmap
                  key: cloud-project
          ports:
          - containerPort: 6962
            name: http
          - containerPort: 6963
            name: http-metrics
          volumeMounts:
          - name: ctfe-config-volume
            mountPath: /ctfe-config
        - name: prometheus-to-sd
          image: gcr.io/google-containers/prometheus-to-sd:v0.5.2
          ports:
            - name: profiler
              containerPort: 6060
          command:
            - /monitor
            - --stackdriver-prefix=custom.googleapis.com
            - --source=ctfe:http://localhost:6963/metrics
            - --pod-id=$(POD_NAME)
            - --namespace-id=$(POD_NAMESPACE)
            - --scrape-interval=5s
            - --export-interval=60s
          env:
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: POD_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
      volumes:
        - name: ctfe-config-volume
          configMap:
            name: ctfe-configmap
            items:
            - key: ctfe-config-file
              path: ct_server.cfg
            - key: roots
              path: roots
      restartPolicy: Always
status: {}
