apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: cyclenodestatuses.atlassian.com
spec:
  group: atlassian.com
  names:
    kind: CycleNodeStatus
    listKind: CycleNodeStatusList
    plural: cyclenodestatuses
    shortNames:
    - cns
    singular: cyclenodestatus
  scope: Namespaced
  versions:
  - additionalPrinterColumns:
    - description: The name of the node
      jsonPath: .status.currentNode.name
      name: Node
      type: string
    - description: The provider ID of the node
      jsonPath: .status.currentNode.providerId
      name: Provider ID
      type: string
    - description: The method being used for the cycle operation
      jsonPath: .spec.cycleSettings.method
      name: Method
      type: string
    - description: The status of the request
      jsonPath: .status.phase
      name: Status
      type: string
    - description: Age of the request
      jsonPath: .metadata.creationTimestamp
      name: Age
      type: date
    name: v1
    schema:
      openAPIV3Schema:
        description: CycleNodeStatus is the Schema for the cyclenodestatus API
        properties:
          apiVersion:
            description: 'APIVersion defines the versioned schema of this representation
              of an object. Servers should convert recognized schemas to the latest
              internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
            type: string
          kind:
            description: 'Kind is a string value representing the REST resource this
              object represents. Servers may infer this from the endpoint the client
              submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
            type: string
          metadata:
            type: object
          spec:
            description: CycleNodeStatusSpec defines the desired state of CycleNodeStatus
            properties:
              cycleSettings:
                description: CycleSettings stores the settings to use for cycling
                  the node.
                properties:
                  concurrency:
                    description: Concurrency is the number of nodes that one CycleNodeRequest
                      will work on in parallel. Defaults to the size of the node group.
                    format: int64
                    type: integer
                  cyclingTimeout:
                    description: CyclingTimeout is a string in time duration format
                      that defines how long a until an in-progress CNS request timeout
                      from the time it's worked on by the controller. If no cyclingTimeout
                      is provided, CNS will use the default controller CNS cyclingTimeout.
                    type: string
                  ignoreNamespaces:
                    description: IgnoreNamespaces is a list of namespace names in
                      which running pods should be ignored when deciding whether a
                      node has no more pods running.
                    items:
                      type: string
                    type: array
                  ignorePodsLabels:
                    additionalProperties:
                      items:
                        type: string
                      type: array
                    description: 'IgnorePodLabels is a map of values for labels that
                      describes which pods should be ignored when deciding whether
                      a node has no more pods running. This map defines a union: any
                      pod that matches any of the values for a given label name will
                      be ignored.'
                    type: object
                  labelsToRemove:
                    description: LabelsToRemove is an array of labels to remove off
                      of the pods running on the node This can be used to remove a
                      pod from a service/endpoint before evicting/deleting it to prevent
                      traffic being sent to it.
                    items:
                      type: string
                    type: array
                  method:
                    description: Method describes the type of cycle operation to use.
                    enum:
                    - Drain
                    - Wait
                    type: string
                required:
                - method
                type: object
              nodeName:
                description: NodeName is the name of the node object in Kubernetes
                  that will be drained and terminated.
                type: string
            required:
            - cycleSettings
            - nodeName
            type: object
          status:
            description: CycleNodeStatusStatus defines the observed state of a node
              being cycled by a CycleNodeRequest
            properties:
              currentNode:
                description: CurrentNode stores this node that is being "worked on"
                properties:
                  name:
                    description: Name of the node
                    type: string
                  nodeGroupName:
                    description: NodeGroupName stores current cloud provider node
                      group name which this node belongs to
                    type: string
                  privateIp:
                    description: Private ip of the instance
                    type: string
                  providerId:
                    description: Cloud Provider ID of the node
                    type: string
                required:
                - name
                - nodeGroupName
                - providerId
                type: object
              message:
                description: A human readable message indicating details about why
                  the CycleNodeStatus is in this condition
                type: string
              phase:
                description: Phase stores the current phase of the CycleNodeStatus
                type: string
              startedTimestamp:
                description: StartedTimestamp stores the timestamp that work on this
                  node began
                format: date-time
                type: string
              timeoutTimestamp:
                description: TimeoutTimestamp stores the timestamp of when this CNS
                  will timeout
                format: date-time
                type: string
            required:
            - currentNode
            - message
            - phase
            type: object
        type: object
    served: true
    storage: true
    subresources: {}
