apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:
  annotations:
    alm-examples: |-
      [
        {
          "apiVersion": "nodemaintenance.kubevirt.io/v1beta1",
          "kind": "NodeMaintenance",
          "metadata": {
            "name": "nodemaintenance-sample"
          },
          "spec": {
            "nodeName": "node02",
            "reason": "Test node maintenance"
          }
        }
      ]
    capabilities: Basic Install
    categories: OpenShift Optional
    description: Node Maintenance Operator for cordoning and draining nodes.
    operators.openshift.io/infrastructure-features: '["disconnected"]'
    operators.operatorframework.io/builder: operator-sdk-v1.11.0+git
    operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
    repository: https://github.com/kubevirt/node-maintenance-operator
  name: node-maintenance-operator.v0.0.1
  namespace: placeholder
spec:
  apiservicedefinitions: {}
  customresourcedefinitions:
    owned:
    - description: NodeMaintenance is the Schema for the nodemaintenances API
      displayName: Node Maintenance
      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:
          - namespaces
          verbs:
          - get
        - apiGroups:
          - ""
          resources:
          - nodes
          verbs:
          - get
          - list
          - patch
          - update
          - watch
        - apiGroups:
          - ""
          resources:
          - pods
          verbs:
          - get
          - list
          - watch
        - apiGroups:
          - ""
          resources:
          - pods/eviction
          verbs:
          - create
        - apiGroups:
          - apps
          resources:
          - daemonsets
          - deployments
          - replicasets
          - statefulsets
          verbs:
          - get
          - list
          - watch
        - apiGroups:
          - coordination.k8s.io
          resources:
          - leases
          verbs:
          - create
          - get
          - list
          - patch
          - update
          - watch
        - apiGroups:
          - monitoring.coreos.com
          resources:
          - servicemonitors
          verbs:
          - create
          - get
        - apiGroups:
          - nodemaintenance.kubevirt.io
          resources:
          - nodemaintenances
          verbs:
          - create
          - delete
          - get
          - list
          - patch
          - update
          - watch
        - apiGroups:
          - nodemaintenance.kubevirt.io
          resources:
          - nodemaintenances/finalizers
          verbs:
          - update
        - apiGroups:
          - nodemaintenance.kubevirt.io
          resources:
          - nodemaintenances/status
          verbs:
          - get
          - patch
          - update
        - apiGroups:
          - oauth.openshift.io
          resources:
          - '*'
          verbs:
          - '*'
        - apiGroups:
          - policy
          resources:
          - poddisruptionbudgets
          verbs:
          - get
          - list
          - watch
        - apiGroups:
          - authentication.k8s.io
          resources:
          - tokenreviews
          verbs:
          - create
        - apiGroups:
          - authorization.k8s.io
          resources:
          - subjectaccessreviews
          verbs:
          - create
        serviceAccountName: node-maintenance-operator-controller-manager
      deployments:
      - name: node-maintenance-operator-controller-manager
        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:
              - args:
                - --health-probe-bind-address=:8081
                - --metrics-bind-address=:8080
                - --leader-elect
                command:
                - /manager
                env:
                - name: OPERATOR_NAMESPACE
                  valueFrom:
                    fieldRef:
                      fieldPath: metadata.namespace
                image: quay.io/kubevirt/node-maintenance-operator:latest
                livenessProbe:
                  httpGet:
                    path: /healthz
                    port: 8081
                  initialDelaySeconds: 15
                  periodSeconds: 20
                name: manager
                ports:
                - containerPort: 9443
                  name: webhook-server
                  protocol: TCP
                readinessProbe:
                  httpGet:
                    path: /readyz
                    port: 8081
                  initialDelaySeconds: 5
                  periodSeconds: 10
                resources:
                  limits:
                    cpu: 200m
                    memory: 100Mi
                  requests:
                    cpu: 100m
                    memory: 20Mi
                securityContext:
                  allowPrivilegeEscalation: false
              priorityClassName: system-cluster-critical
              securityContext:
                runAsNonRoot: true
              serviceAccountName: node-maintenance-operator-controller-manager
              terminationGracePeriodSeconds: 10
              tolerations:
              - effect: NoSchedule
                key: node-role.kubernetes.io/master
      permissions:
      - rules:
        - apiGroups:
          - ""
          resources:
          - configmaps
          verbs:
          - get
          - list
          - watch
          - create
          - update
          - patch
          - delete
        - apiGroups:
          - coordination.k8s.io
          resources:
          - leases
          verbs:
          - get
          - list
          - watch
          - create
          - update
          - patch
          - delete
        - apiGroups:
          - ""
          resources:
          - events
          verbs:
          - create
          - patch
        serviceAccountName: node-maintenance-operator-controller-manager
    strategy: deployment
  installModes:
  - supported: true
    type: OwnNamespace
  - supported: false
    type: SingleNamespace
  - supported: false
    type: MultiNamespace
  - supported: false
    type: AllNamespaces
  keywords:
  - KubeVirt
  - Virtualization
  - Node-maintenance
  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
  version: 0.0.1
  webhookdefinitions:
  - admissionReviewVersions:
    - v1
    - v1beta1
    containerPort: 443
    deploymentName: node-maintenance-operator-controller-manager
    failurePolicy: Fail
    generateName: vnodemaintenance.kb.io
    rules:
    - apiGroups:
      - nodemaintenance.kubevirt.io
      apiVersions:
      - v1beta1
      operations:
      - CREATE
      - UPDATE
      resources:
      - nodemaintenances
    sideEffects: None
    targetPort: 9443
    timeoutSeconds: 15
    type: ValidatingAdmissionWebhook
    webhookPath: /validate-nodemaintenance-kubevirt-io-v1beta1-nodemaintenance
