apiVersion: apps/v1
kind: Deployment
metadata:
  name: pod-modifier-webhook-deployment
  labels:
    app: solace-pod-modifier-webhook
spec:
  # provide multiple replicas for redundancy
  replicas: 1
  selector:
    matchLabels:
      app: solace-pod-modifier-webhook
  template:
    metadata:
      labels:
        app: solace-pod-modifier-webhook
    spec:
      #imagePullSecrets:
      #  - name: <optionalPullSecretName>
      serviceAccountName: solace-mutating-webhook-configurer-sa
      containers:
        - name: pod-modifier
          image: pod-modifier
          imagePullPolicy: Always
          args:
          - -service-name=pod-modifier-webhook
          env:
          - name: POD_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          lifecycle:
            preStop:
              exec:
                command: ["/bin/sh", "-c", "/prestop.sh"]
