---
apiVersion: apps/v1
kind: Deployment
spec:
  selector:
    matchLabels:
      app: syslog
  replicas: 1
  template:
    metadata:
      labels:
        app: syslog
    spec:
      containers:
        - image: docker.io/sbezverk/syslog2cloud:0.0.0
          name: syslog2cloud
          imagePullPolicy: Always
          ports:
            - name: syslog
              protocol: UDP
              containerPort: 514
          env:
            - name: POD_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
          volumeMounts:
            - name: syslog
              mountPath: /var/log
          securityContext:
            privileged: true
      volumes:
        - hostPath:
            path: /var/log
            type: DirectoryOrCreate
          name: syslog
metadata:
  name: syslog2cloud
  namespace: default
