apiVersion: apps/v1
kind: Deployment
metadata:
  name: mitmproxy
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mitmproxy
  template:
    metadata:
      labels:
        app: mitmproxy
    spec:
      containers:
      - image: docker.io/mitmproxy/mitmproxy:7.0.4
        resources:
          limits:
            cpu: '4'
            memory: 6Gi
          requests:
            cpu: 50m
            memory: 256Mi
        command:
        - /bin/bash
        args:
        - -c
        - '
          ln -sf /home/mitmproxy/cert/mitmproxy-ca.pem /home/mitmproxy/mitmproxy-ca.pem &&
          source /home/mitmproxy/run/run.sh
          '
        name: mitmproxy
        ports:
        - name: proxy
          containerPort: 8080
          protocol: TCP
        volumeMounts:
        - name: home
          mountPath: /home/mitmproxy
        - name: ca-cert
          mountPath: /home/mitmproxy/cert
        - name: run
          mountPath: /home/mitmproxy/run
      volumes:
      - name: home
        emptyDir: {}
      - name: ca-cert
        secret:
          secretName: mitmproxy-ca-cert
      - name: run
        configMap:
          name: mitmproxy-run
