apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:
  annotations:
    alm-examples: |-
      [
        {
          "apiVersion": "nodemaintenance.kubevirt.io/v1beta1",
          "kind": "NodeMaintenance",
          "metadata": {
            "name": "nodemaintenance-example"
          },
          "spec": {
            "nodeName": "node02",
            "reason": "Test node maintenance"
          }
        }
      ]
    capabilities: Basic Install
    categories: OpenShift Optional
    containerImage: quay.io/kubevirt/node-maintenance-operator:latest
    description: Node Maintenance Operator for cordoning and draining nodes.
    repository: https://github.com/kubevirt/node-maintenance-operator
  name: node-maintenance-operator.v0.7.0
  namespace: placeholder
spec:
  apiservicedefinitions: {}
  customresourcedefinitions:
    owned:
    - description: NodeMaintenance is the Schema for the nodemaintenances API
      kind: NodeMaintenance
      name: nodemaintenances.nodemaintenance.kubevirt.io
      version: v1beta1
  description: |
    Node Maintenance Operator

    This operator will keep nodes cordoned and drained while a matching node maintenance CR exists.
    This is useful when investigating problems with a machine, or performing an operation on the underlying machine that might result in node failure.

    Primarily used in bare-metal environments.
  displayName: Node Maintenance Operator
  icon:
  - base64data: [encoded data, 26068 characters]
    mediatype: image/png
  install:
    spec:
      clusterPermissions:
      - rules:
        - apiGroups:
          - ""
          resources:
          - services
          - endpoints
          - events
          - configmaps
          - serviceaccounts
          verbs:
          - '*'
        - apiGroups:
          - coordination.k8s.io
          resources:
          - leases
          verbs:
          - get
          - list
          - update
          - patch
          - watch
          - create
        - apiGroups:
          - policy
          resources:
          - poddisruptionbudgets
          verbs:
          - get
          - list
          - watch
        - apiGroups:
          - ""
          resources:
          - nodes
          verbs:
          - get
          - list
          - update
          - patch
          - watch
        - apiGroups:
          - ""
          resources:
          - pods
          verbs:
          - get
          - list
          - watch
        - apiGroups:
          - ""
          resources:
          - pods/eviction
          verbs:
          - create
        - apiGroups:
          - ""
          resources:
          - namespaces
          verbs:
          - get
        - apiGroups:
          - apps
          resources:
          - deployments
          - daemonsets
          - replicasets
          - statefulsets
          verbs:
          - '*'
        - apiGroups:
          - monitoring.coreos.com
          resources:
          - servicemonitors
          verbs:
          - get
          - create
        - apiGroups:
          - nodemaintenance.kubevirt.io
          resources:
          - '*'
          verbs:
          - '*'
        - apiGroups:
          - oauth.openshift.io
          resources:
          - '*'
          verbs:
          - '*'
        serviceAccountName: node-maintenance-operator
      deployments:
      - name: node-maintenance-operator
        spec:
          replicas: 1
          selector:
            matchLabels:
              name: node-maintenance-operator
          strategy: {}
          template:
            metadata:
              labels:
                name: node-maintenance-operator
            spec:
              affinity:
                nodeAffinity:
                  requiredDuringSchedulingIgnoredDuringExecution:
                    nodeSelectorTerms:
                    - matchExpressions:
                      - key: node-role.kubernetes.io/master
                        operator: Exists
              containers:
              - env:
                - name: WATCH_NAMESPACE
                  valueFrom:
                    fieldRef:
                      fieldPath: metadata.annotations['olm.targetNamespaces']
                - name: POD_NAME
                  valueFrom:
                    fieldRef:
                      fieldPath: metadata.name
                - name: OPERATOR_NAME
                  value: node-maintenance-operator
                image: quay.io/kubevirt/node-maintenance-operator:latest
                imagePullPolicy: Always
                name: node-maintenance-operator
                resources: {}
              serviceAccountName: node-maintenance-operator
              tolerations:
              - effect: NoSchedule
                key: node-role.kubernetes.io/master
    strategy: deployment
  installModes:
  - supported: true
    type: OwnNamespace
  - supported: false
    type: SingleNamespace
  - supported: false
    type: MultiNamespace
  - supported: false
    type: AllNamespaces
  keywords:
  - KubeVirt
  - Virtualization
  - Node-maintenance
  labels:
    alm-owner-kubevirt: nodemaintenanceoperator
    operated-by: nodemaintenanceoperator
  links:
  - name: KubeVirt
    url: https://kubevirt.io
  - name: Source Code
    url: https://github.com/kubevirt/node-maintenance-operator
  maintainers:
  - email: kubevirt-dev@googlegroups.com
    name: KubeVirt project
  maturity: beta
  provider:
    name: Red Hat
  selector:
    matchLabels:
      alm-owner-kubevirt: nodemaintenanceoperator
      operated-by: nodemaintenanceoperator
  version: 0.7.0
  webhookdefinitions:
  - admissionReviewVersions:
    - v1beta1
    containerPort: 8443
    deploymentName: node-maintenance-operator
    failurePolicy: Fail
    generateName: nodemaintenance-validation.kubevirt.io
    rules:
    - apiGroups:
      - nodemaintenance.kubevirt.io
      apiVersions:
      - v1beta1
      operations:
      - CREATE
      - UPDATE
      resources:
      - nodemaintenances
      scope: Cluster
    sideEffects: None
    timeoutSeconds: 15
    type: ValidatingAdmissionWebhook
    webhookPath: /validate-nodemaintenance-kubevirt-io-v1beta1-nodemaintenances
