---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: fibonacci
  labels:
    app: fibonacci
    greymatter.io/control: fibonacci
spec:
  replicas: 1
  selector:
    matchLabels:
      app: fibonacci
      greymatter.io/control: fibonacci
  template:
    metadata:
      labels:
        app: fibonacci
        greymatter.io/control: fibonacci
    spec:
      containers:
        - name: fibonacci
          image: quay.io/colemanx/fibonacci:latest
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 8080
        - name: sidecar
          image: "docker.greymatter.io/release/gm-proxy:1.6.3"
          imagePullPolicy: IfNotPresent
          ports:
            - name: metrics
              containerPort: 8081
            - name: proxy
              containerPort: 10808
          env:
            - name: ENVOY_ADMIN_LOG_PATH
              value: "/dev/stdout"
            - name: PROXY_DYNAMIC
              value: "true"
            - name: SPIRE_PATH
              value: "/run/spire/socket/agent.sock"
            - name: XDS_CLUSTER
              value: "fibonacci"
            - name: XDS_HOST
              value: "control.greymatter.svc.cluster.local"
            - name: XDS_NODE_ID
              value: "default"
            - name: XDS_PORT
              value: "50000"
            - name: XDS_ZONE
              value: "default-zone"
          volumeMounts:
            - name: spire-socket
              mountPath: /run/spire/socket
              readOnly: false
          resources:
            requests:
              cpu: 50m
              memory: 64Mi
            limits:
              cpu: 100m
              memory: 128Mi
      imagePullSecrets:
        - name: docker.secret
      volumes:
        - name: spire-socket
          hostPath:
            path: /run/spire/socket
            type: DirectoryOrCreate
