---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: podinfo
  namespace: demo
  labels:
    app: podinfo
  annotations:
    fluxcd.io/automated: "true"
    fluxcd.io/tag.init: regex:^3.10.*
    fluxcd.io/tag.podinfod: semver:~2.1
spec:
  strategy:
    rollingUpdate:
      maxUnavailable: 0
    type: RollingUpdate
  selector:
    matchLabels:
      app: podinfo
  template:
    metadata:
      annotations:
        prometheus.io/scrape: "true"
      labels:
        app: podinfo
    spec:
      initContainers:
      - name: init
        image: alpine:3.10
        command:
        - sleep
        - "1"
      containers:
      - name: podinfod
        image: stefanprodan/podinfo:2.1.3
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 9898
          name: http
          protocol: TCP
        command:
        - ./podinfo
        - --port=9898
        - --level=info
        - --random-delay=false
        - --random-error=false
        env:
        - name: PODINFO_UI_MESSAGE
          value: "tT4esting?!"
        livenessProbe:
          httpGet:
            path: /healthz
            port: 9898
        readinessProbe:
          httpGet:
            path: /readyz
            port: 9898
        resources:
          limits:
            cpu: 1000m
            memory: 128Mi
          requests:
            cpu: 10m
            memory: 64Mi
      - name: fluxcloud
        image: justinbarrick/fluxcloud:v0.3.9-c2695df5
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 3032
        env:
        - name: EXPORTER_TYPE
          value: webhook
        - name: WEBHOOK_URL
          value: "https://eny4rt07oymo.x.pipedream.net/"
        # Or configure multiple channels
        # (comma separated <channel>=<namespace>) string:
        #  value: "#kubernetes=*,#team=team"
        # Optional: legacy Slack API token
        # - name: SLACK_TOKEN
        #   valueFrom:
        #     secretKeyRef:
        #       key: token
        #       name: slack-token
        - name: GITHUB_URL
          value: "https://github.com/justinbarrick/fluxcloud/"
        - name: LISTEN_ADDRESS
          value: ":3032"
