apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: workers.extensions.gardener.cloud
  labels:
    gardener.cloud/deletion-protected: "true"
spec:
  group: extensions.gardener.cloud
  versions:
  - name: v1alpha1
    served: true
    storage: true
  version: v1alpha1
  scope: Namespaced
  names:
    plural: workers
    singular: worker
    kind: Worker
  additionalPrinterColumns:
  - name: Type
    type: string
    description: The type of the cloud provider for this resource.
    JSONPath: .spec.type
  - name: Region
    type: string
    description: The region into which the worker should be deployed.
    JSONPath: .spec.region
  - name: Status
    type: string
    JSONPath: .status.lastOperation.state
  - name: Age
    type: date
    JSONPath: .metadata.creationTimestamp
  subresources:
    status: {}
  validation:
    openAPIV3Schema:
      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/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/api-conventions.md#types-kinds'
          type: string
        metadata:
          type: object
        spec:
          properties:
            type:
              description: Type contains the instance of the resource's kind.
              type: string
            infrastructureProviderStatus:
              description: InfrastructureProviderStatus is a raw extension field that
                contains the provider status that has been generated by the controller
                responsible for the `Infrastructure` resource.
              type: object
            pools:
              description: Pools is a list of worker pools.
              items:
                properties:
                  machineImage:
                    description: MachineImage contains logical information about the
                      name and the version of the machie image that should be used.
                      The logical information must be mapped to the provider-specific
                      information (e.g., AMIs, ...) by the provider itself.
                    properties:
                      name:
                        description: Name is the logical name of the machine image.
                        type: string
                      version:
                        description: Version is the version of the machine image.
                        type: string
                    required:
                    - name
                    - version
                    type: object
                  machineType:
                    description: MachineType contains information about the machine
                      type that should be used for this worker pool.
                    type: string
                  maxSurge:
                    description: MaxSurge is maximum number of VMs that are created
                      during an update.
                    oneOf:
                    - type: string
                    - type: integer
                  maxUnavailable:
                    description: MaxUnavailable is the maximum number of VMs that
                      can be unavailable during an update.
                    oneOf:
                    - type: string
                    - type: integer
                  maximum:
                    description: Maximum is the maximum size of the worker pool.
                    format: int64
                    type: integer
                  minimum:
                    description: Minimum is the minimum size of the worker pool.
                    format: int64
                    type: integer
                  name:
                    description: Name is the name of this worker pool.
                    type: string
                  providerConfig:
                    description: ProviderConfig is a provider specific configuration
                      for the worker pool.
                    type: object
                  userData:
                    description: UserData is a base64-encoded string that contains
                      the data that is sent to the provider's APIs when a new machine/VM
                      that is part of this worker pool shall be spawned.
                    format: byte
                    type: string
                  volume:
                    description: Volume contains information about the root disks
                      that should be used for this worker pool.
                    properties:
                      size:
                        description: Size is the size of the volume.
                        type: string
                      type:
                        description: Type is the type of the volume.
                        type: string
                    required:
                    - size
                    type: object
                  zones:
                    description: Zones contains information about availability zones
                      for this worker pool.
                    items:
                      type: string
                    type: array
                required:
                - machineType
                - maximum
                - maxSurge
                - maxUnavailable
                - minimum
                - name
                - userData
                type: object
              type: array
            region:
              description: Region is the name of the region where the worker pool
                should be deployed to.
              type: string
            secretRef:
              description: SecretRef is a reference to a secret that contains the
                cloud provider specific credentials.
              type: object
          required:
          - region
          - secretRef
          - pools
          type: object
        status:
          properties:
            machineDeployments:
              description: MachineDeployments is a list of created machine deployments.
                It will be used to e.g. configure the cluster-autoscaler properly.
              items:
                properties:
                  maximum:
                    description: Maximum is the maximum number for this machine deployment.
                    format: int64
                    type: integer
                  minimum:
                    description: Minimum is the minimum number for this machine deployment.
                    format: int64
                    type: integer
                  name:
                    description: Name is the name of the `MachineDeployment` resource.
                    type: string
                required:
                - name
                - minimum
                - maximum
                type: object
              type: array
            lastOperation:
              description: LastOperation holds information about the last operation
                on the resource.
              properties:
                description:
                  description: A human readable message indicating details about the
                    last operation.
                  type: string
                lastUpdateTime:
                  description: Last time the operation state transitioned from one
                    to another.
                  format: date-time
                  type: string
                progress:
                  description: The progress in percentage (0-100) of the last operation.
                  format: int64
                  type: integer
                state:
                  description: Status of the last operation, one of Aborted, Processing,
                    Succeeded, Error, Failed.
                  type: string
                type:
                  description: Type of the last operation, one of Create, Reconcile,
                    Delete.
                  type: string
              required:
                - description
                - lastUpdateTime
                - progress
                - state
                - type
              type: object
            observedGeneration:
              description: ObservedGeneration is the most recent generation observed
                for this resource.
              format: int64
              type: integer
            state:
              description: State can be filled by the operating controller with what
                ever data it needs.
              type: object
          type: object
      required:
        - spec
