apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/name: webhook-example
  name: webhook-example
  namespace: default
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: webhook-example
  template:
    metadata:
      labels:
        app.kubernetes.io/name: webhook-example
    spec:
      serviceAccountName: webhook-example
      containers:
        - env:
            - name: WEBHOOK_SERVER_HTTPS_PORT
              value: "8443"
            - name: NAMESPACE
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: metadata.namespace
            - name: CONTROLLER_USER_NAME
              value: system:serviceaccount:default:webhook-example
          image: armarny/webhook-example:latest
          imagePullPolicy: IfNotPresent
          name: webhook-example
          ports:
            - containerPort: 8443
              name: https
              protocol: TCP
          resources: {}
          securityContext:
            capabilities:
              add:
                - SYS_ADMIN