apiVersion: apps/v1
kind: Deployment
metadata:
  name: wowhoneypot
  namespace: wowhoneypot
  labels:
    app: wowhoneypot
    type: honeypot
spec:
  replicas: 3
  selector:
    matchLabels:
      app: wowhoneypot
  template:
    metadata:
      labels:
        app: wowhoneypot
    spec:
      containers:
        - name: fluentd
          image: fluent/fluentd-kubernetes-daemonset:v1.11.5-debian-cloudwatch-1.0
          env:
            - name: REGION
              value: us-east-2
            - name: AWS_REGION
              value: us-east-2
            - name: CLUSTER_NAME
              value: honeypot
          resources:
            limits:
              memory: 400Mi
            requests:
              cpu: 100m
              memory: 200Mi
          volumeMounts:
            - name: fluentdconf
              mountPath: /fluentd/etc
            - name: access-log
              mountPath: /var/log/containers
        - name: wowhoneypot
          image: ryusa/wowhoneypot:1.0
          resources:
            requests: {}
            limits:
              cpu: 100m
              memory: 64Mi
          securityContext:
            allowPrivilegeEscalation: false
            runAsNonRoot: true
            readOnlyRootFilesystem: true
            capabilities:
              drop:
                - ALL
          env:
            - name: "PORT"
              value: "8080"
            - name: ACCESS_LOG
              value: "/var/log/containers/access.log"
          ports:
            - containerPort: 8080
          volumeMounts:
            - name: access-log
              mountPath: /var/log/containers/
      volumes:
        - name: access-log
          emptyDir: {}
        - name: fluentdconf
          configMap:
            name: fluentd-wowhoneypot-config
