kind: Deployment
apiVersion: apps/v1
metadata:
  name: znc
  namespace: znc
  labels:
    app.kubernetes.io/name: znc
spec:
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app.kubernetes.io/name: znc
  template:
    metadata:
      labels:
        app.kubernetes.io/name: znc
    spec:
      initContainers:
      - name: configure
        image: znc:1.8.2-slim
        command:
        - /bin/sh
        args:
        - /usr/local/bin/script.sh
        resources:
          limits:
            cpu: 10m
            memory: 10Mi
          requests:
            cpu: 10m
            memory: 10Mi
        securityContext:
          capabilities:
            drop:
            - ALL
          readOnlyRootFilesystem: true
          allowPrivilegeEscalation: false
          runAsNonRoot: true
          runAsUser: 100
          runAsGroup: 101
        volumeMounts:
        - mountPath: /usr/local/bin
          name: script
        - mountPath: /znc-data
          name: data
      containers:
      - name: znc
        image: znc:1.8.2-slim
        ports:
        - containerPort: 6697
          hostPort: 6697
        livenessProbe:
          tcpSocket:
            port: 6697
        readinessProbe:
          tcpSocket:
            port: 6697
        startupProbe:
          tcpSocket:
            port: 6697
          failureThreshold: 30
          periodSeconds: 10
        securityContext:
          capabilities:
            drop:
            - ALL
          readOnlyRootFilesystem: true
          allowPrivilegeEscalation: false
          runAsNonRoot: true
          runAsUser: 100
          runAsGroup: 101
        resources:
          limits:
            cpu: "1"
            memory: 32Mi
          requests:
            cpu: 20m
            memory: 4Mi
        volumeMounts:
        - mountPath: /znc-data
          name: data
      volumes:
      - name: script
        configMap:
          name: script
      - name: data
        hostPath:
          path: /var/lib/znc
          type: Directory
