apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    deployment.kubernetes.io/revision: "1"
  creationTimestamp: "2026-04-06T12:12:33Z"
  generation: 1
  labels:
    app: kubernetes-nmstate
    component: kubernetes-nmstate-webhook
  name: nmstate-webhook
  namespace: openshift-nmstate
  ownerReferences:
  - apiVersion: nmstate.io/v1
    blockOwnerDeletion: true
    controller: true
    kind: NMState
    name: nmstate
    uid: ea5cf991-7d99-416c-a2f3-79a2a3d7223a
  resourceVersion: "36019"
  uid: dc88591f-d648-43c1-afa0-728e8be2a342
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      name: nmstate-webhook
  strategy:
    type: Recreate
  template:
    metadata:
      annotations:
        description: kubernetes-nmstate-webhook resets NNCP status
      creationTimestamp: null
      labels:
        app: kubernetes-nmstate
        component: kubernetes-nmstate-webhook
        name: nmstate-webhook
    spec:
      affinity:
        nodeAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - preference:
              matchExpressions:
              - key: node-role.kubernetes.io/control-plane
                operator: Exists
            weight: 10
          - preference:
              matchExpressions:
              - key: node-role.kubernetes.io/master
                operator: Exists
            weight: 1
      containers:
      - args:
        - --zap-time-encoding=iso8601
        command:
        - manager
        env:
        - name: WATCH_NAMESPACE
        - name: POD_NAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.name
        - name: POD_NAMESPACE
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.namespace
        - name: RUN_WEBHOOK_SERVER
        - name: OPERATOR_NAME
          value: nmstate
        - name: ENABLE_PROFILER
          value: "False"
        - name: PROFILER_PORT
          value: "6060"
        image: registry.redhat.io/openshift4/ose-kubernetes-nmstate-handler-rhel9@sha256:b1744b2b84d6e23d83f465f450d2621a86bfec595d64373438b2e7ce5331e82e
        imagePullPolicy: Always
        name: nmstate-webhook
        ports:
        - containerPort: 9443
          name: webhook-server
          protocol: TCP
        readinessProbe:
          failureThreshold: 3
          httpGet:
            httpHeaders:
            - name: Content-Type
              value: application/json
            path: /readyz
            port: webhook-server
            scheme: HTTPS
          initialDelaySeconds: 10
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 1
        resources:
          requests:
            cpu: 30m
            memory: 20Mi
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /tmp/k8s-webhook-server/serving-certs/
          name: tls-key-pair
          readOnly: true
      dnsPolicy: ClusterFirst
      nodeSelector:
        kubernetes.io/arch: amd64
      priorityClassName: system-cluster-critical
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      serviceAccount: nmstate-handler
      serviceAccountName: nmstate-handler
      terminationGracePeriodSeconds: 30
      tolerations:
      - effect: NoSchedule
        key: node-role.kubernetes.io/master
        operator: Exists
      - effect: NoSchedule
        key: node-role.kubernetes.io/control-plane
        operator: Exists
      topologySpreadConstraints:
      - labelSelector:
          matchLabels:
            component: kubernetes-nmstate-webhook
        maxSkew: 1
        topologyKey: kubernetes.io/hostname
        whenUnsatisfiable: DoNotSchedule
      volumes:
      - name: tls-key-pair
        secret:
          defaultMode: 420
          secretName: openshift-nmstate-webhook
status:
  availableReplicas: 1
  conditions:
  - lastTransitionTime: "2026-04-06T12:12:54Z"
    lastUpdateTime: "2026-04-06T12:12:54Z"
    message: Deployment has minimum availability.
    reason: MinimumReplicasAvailable
    status: "True"
    type: Available
  - lastTransitionTime: "2026-04-06T12:12:33Z"
    lastUpdateTime: "2026-04-06T12:12:54Z"
    message: ReplicaSet "nmstate-webhook-5f558f5558" has successfully progressed.
    reason: NewReplicaSetAvailable
    status: "True"
    type: Progressing
  observedGeneration: 1
  readyReplicas: 1
  replicas: 1
  updatedReplicas: 1
