apiVersion: apps/v1
kind: Deployment
metadata:
  name: traefik
  labels:
    app: traefik
spec:
  replicas: 1
  selector:
    matchLabels:
      app: traefik
  template:
    metadata:
      labels:
        app: traefik
    spec:
      shareProcessNamespace: true
      containers:
        - image: traefik:2.5.4
          name: traefik
          ports:
            - name: http
              containerPort: 80
          volumeMounts:
            - mountPath: /etc/traefik/traefik.yml
              name: config-static
              subPath: traefik.yaml
            - mountPath: /var/log
              name: logs
        - image: fischerscode/traefik-geologger-city:test
          imagePullPolicy: Always
          name: geologger
          env:
            - name: ENABLE_METRICS
              value: "true"
            - name: METRICS_PORT
              value: "8081"
            - name: TRAEFIK_PROCESS_NAME
              value: "traefik"
            - name: MAX_LOG_SIZE
              value: "1"
          volumeMounts:
            - mountPath: /var/log
              name: logs
          ports:
            - name: metrics
              containerPort: 8081
          securityContext:
            capabilities:
              add:
                - SYS_PTRACE
        - image: busybox
          name: shell
          securityContext:
            capabilities:
              add:
                - SYS_PTRACE
          stdin: true
          tty: true
      imagePullSecrets:
        - name: docker-cred
      volumes:
        - name: config-static
          configMap:
            name: traefik-config-static
        - name: logs
          emptyDir: {}
