
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    controller-gen.kubebuilder.io/version: v0.6.2
  name: containerizedworkloads.core.oam.dev
spec:
  group: core.oam.dev
  names:
    categories:
    - oam
    kind: ContainerizedWorkload
    listKind: ContainerizedWorkloadList
    plural: containerizedworkloads
    singular: containerizedworkload
  scope: Namespaced
  versions:
  - name: v1alpha2
    schema:
      openAPIV3Schema:
        description: A ContainerizedWorkload is a workload that runs OCI containers.
        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: A ContainerizedWorkloadSpec defines the desired state of
              a ContainerizedWorkload.
            properties:
              arch:
                description: CPUArchitecture required by this workload.
                enum:
                - i386
                - amd64
                - arm
                - arm64
                type: string
              containers:
                description: Containers of which this workload consists.
                items:
                  description: A Container represents an Open Containers Initiative
                    (OCI) container.
                  properties:
                    args:
                      description: Arguments to be passed to the command run by this
                        container.
                      items:
                        type: string
                      type: array
                    command:
                      description: Command to be run by this container.
                      items:
                        type: string
                      type: array
                    config:
                      description: ConfigFiles that should be written within this
                        container.
                      items:
                        description: A ContainerConfigFile specifies a configuration
                          file that should be written within a container.
                        properties:
                          fromSecret:
                            description: FromSecret is a secret key reference which
                              can be used to assign a value to be written to the configuration
                              file at the given path in the container.
                            properties:
                              key:
                                description: The key to select.
                                type: string
                              name:
                                description: The name of the secret.
                                type: string
                            required:
                            - key
                            - name
                            type: object
                          path:
                            description: Path within the container at which the configuration
                              file should be written.
                            type: string
                          value:
                            description: Value that should be written to the configuration
                              file.
                            type: string
                        required:
                        - path
                        type: object
                      type: array
                    env:
                      description: Environment variables that should be set within
                        this container.
                      items:
                        description: A ContainerEnvVar specifies an environment variable
                          that should be set within a container.
                        properties:
                          fromSecret:
                            description: FromSecret is a secret key reference which
                              can be used to assign a value to the environment variable.
                            properties:
                              key:
                                description: The key to select.
                                type: string
                              name:
                                description: The name of the secret.
                                type: string
                            required:
                            - key
                            - name
                            type: object
                          name:
                            description: Name of the environment variable. Must be
                              composed of valid Unicode letter and number characters,
                              as well as _ and -.
                            pattern: ^[-_a-zA-Z0-9]+$
                            type: string
                          value:
                            description: Value of the environment variable.
                            type: string
                        required:
                        - name
                        type: object
                      type: array
                    image:
                      description: Image this container should run. Must be a path-like
                        or URI-like representation of an OCI image. May be prefixed
                        with a registry address and should be suffixed with a tag.
                      type: string
                    imagePullSecret:
                      description: ImagePullSecret specifies the name of a Secret
                        from which the credentials required to pull this container's
                        image can be loaded.
                      type: string
                    livenessProbe:
                      description: A LivenessProbe assesses whether this container
                        is alive. Containers that fail liveness probes will be restarted.
                      properties:
                        exec:
                          description: Exec probes a container's health by executing
                            a command.
                          properties:
                            command:
                              description: Command to be run by this probe.
                              items:
                                type: string
                              type: array
                          required:
                          - command
                          type: object
                        failureThreshold:
                          description: FailureThreshold specifies how many consecutive
                            probes must fail in order for the container to be considered
                            healthy.
                          format: int32
                          type: integer
                        httpGet:
                          description: HTTPGet probes a container's health by sending
                            an HTTP GET request.
                          properties:
                            httpHeaders:
                              description: HTTPHeaders to send with the GET request.
                              items:
                                description: A HTTPHeader to be passed when probing
                                  a container.
                                properties:
                                  name:
                                    description: Name of this HTTP header. Must be
                                      unique per probe.
                                    type: string
                                  value:
                                    description: Value of this HTTP header.
                                    type: string
                                required:
                                - name
                                - value
                                type: object
                              type: array
                            path:
                              description: Path to probe, e.g. '/healthz'.
                              type: string
                            port:
                              description: Port to probe.
                              format: int32
                              type: integer
                          required:
                          - path
                          - port
                          type: object
                        initialDelaySeconds:
                          description: InitialDelaySeconds after a container starts
                            before the first probe.
                          format: int32
                          type: integer
                        periodSeconds:
                          description: PeriodSeconds between probes.
                          format: int32
                          type: integer
                        successThreshold:
                          description: SuccessThreshold specifies how many consecutive
                            probes must success in order for the container to be considered
                            healthy.
                          format: int32
                          type: integer
                        tcpSocket:
                          description: TCPSocketProbe probes a container's health
                            by connecting to a TCP socket.
                          properties:
                            port:
                              description: Port this probe should connect to.
                              format: int32
                              type: integer
                          required:
                          - port
                          type: object
                        timeoutSeconds:
                          description: TimeoutSeconds after which the probe times
                            out.
                          format: int32
                          type: integer
                      type: object
                    name:
                      description: Name of this container. Must be unique within its
                        workload.
                      type: string
                    ports:
                      description: Ports exposed by this container.
                      items:
                        description: A ContainerPort specifies a port that is exposed
                          by a container.
                        properties:
                          containerPort:
                            description: Port number. Must be unique within its container.
                            format: int32
                            type: integer
                          name:
                            description: Name of this port. Must be unique within
                              its container. Must be lowercase alphabetical characters.
                            pattern: ^[a-z]+$
                            type: string
                          protocol:
                            description: Protocol used by the server listening on
                              this port.
                            enum:
                            - TCP
                            - UDP
                            type: string
                        required:
                        - containerPort
                        - name
                        type: object
                      type: array
                    readinessProbe:
                      description: A ReadinessProbe assesses whether this container
                        is ready to serve requests. Containers that fail readiness
                        probes will be withdrawn from service.
                      properties:
                        exec:
                          description: Exec probes a container's health by executing
                            a command.
                          properties:
                            command:
                              description: Command to be run by this probe.
                              items:
                                type: string
                              type: array
                          required:
                          - command
                          type: object
                        failureThreshold:
                          description: FailureThreshold specifies how many consecutive
                            probes must fail in order for the container to be considered
                            healthy.
                          format: int32
                          type: integer
                        httpGet:
                          description: HTTPGet probes a container's health by sending
                            an HTTP GET request.
                          properties:
                            httpHeaders:
                              description: HTTPHeaders to send with the GET request.
                              items:
                                description: A HTTPHeader to be passed when probing
                                  a container.
                                properties:
                                  name:
                                    description: Name of this HTTP header. Must be
                                      unique per probe.
                                    type: string
                                  value:
                                    description: Value of this HTTP header.
                                    type: string
                                required:
                                - name
                                - value
                                type: object
                              type: array
                            path:
                              description: Path to probe, e.g. '/healthz'.
                              type: string
                            port:
                              description: Port to probe.
                              format: int32
                              type: integer
                          required:
                          - path
                          - port
                          type: object
                        initialDelaySeconds:
                          description: InitialDelaySeconds after a container starts
                            before the first probe.
                          format: int32
                          type: integer
                        periodSeconds:
                          description: PeriodSeconds between probes.
                          format: int32
                          type: integer
                        successThreshold:
                          description: SuccessThreshold specifies how many consecutive
                            probes must success in order for the container to be considered
                            healthy.
                          format: int32
                          type: integer
                        tcpSocket:
                          description: TCPSocketProbe probes a container's health
                            by connecting to a TCP socket.
                          properties:
                            port:
                              description: Port this probe should connect to.
                              format: int32
                              type: integer
                          required:
                          - port
                          type: object
                        timeoutSeconds:
                          description: TimeoutSeconds after which the probe times
                            out.
                          format: int32
                          type: integer
                      type: object
                    resources:
                      description: Resources required by this container
                      properties:
                        cpu:
                          description: CPU required by this container.
                          properties:
                            required:
                              anyOf:
                              - type: integer
                              - type: string
                              description: Required CPU count. 1.0 represents one
                                CPU core.
                              pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
                              x-kubernetes-int-or-string: true
                          required:
                          - required
                          type: object
                        extended:
                          description: Extended resources required by this container.
                          items:
                            description: ExtendedResource required by a container.
                            properties:
                              name:
                                description: Name of the external resource. Resource
                                  names are specified in kind.group/version format,
                                  e.g. motionsensor.ext.example.com/v1.
                                type: string
                              required:
                                anyOf:
                                - type: integer
                                - type: string
                                description: Required extended resource(s), e.g. 8
                                  or "very-cool-widget"
                                x-kubernetes-int-or-string: true
                            required:
                            - name
                            - required
                            type: object
                          type: array
                        gpu:
                          description: GPU required by this container.
                          properties:
                            required:
                              anyOf:
                              - type: integer
                              - type: string
                              description: Required GPU count.
                              pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
                              x-kubernetes-int-or-string: true
                          required:
                          - required
                          type: object
                        memory:
                          description: Memory required by this container.
                          properties:
                            required:
                              anyOf:
                              - type: integer
                              - type: string
                              description: Required memory.
                              pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
                              x-kubernetes-int-or-string: true
                          required:
                          - required
                          type: object
                        volumes:
                          description: Volumes required by this container.
                          items:
                            description: VolumeResource required by a container.
                            properties:
                              accessMode:
                                description: AccessMode of this volume; RO (read only)
                                  or RW (read and write).
                                enum:
                                - RO
                                - RW
                                type: string
                              disk:
                                description: Disk requirements of this volume.
                                properties:
                                  ephemeral:
                                    description: Ephemeral specifies whether an external
                                      disk needs to be mounted.
                                    type: boolean
                                  required:
                                    anyOf:
                                    - type: integer
                                    - type: string
                                    description: Required disk space.
                                    pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
                                    x-kubernetes-int-or-string: true
                                required:
                                - required
                                type: object
                              mountPath:
                                description: MountPath at which this volume will be
                                  mounted within its container.
                                type: string
                              name:
                                description: Name of this volume. Must be unique within
                                  its container.
                                type: string
                              sharingPolicy:
                                description: SharingPolicy of this volume; Exclusive
                                  or Shared.
                                enum:
                                - Exclusive
                                - Shared
                                type: string
                            required:
                            - mountPath
                            - name
                            type: object
                          type: array
                      required:
                      - cpu
                      - memory
                      type: object
                  required:
                  - image
                  - name
                  type: object
                type: array
              osType:
                description: OperatingSystem required by this workload.
                enum:
                - linux
                - windows
                type: string
            required:
            - containers
            type: object
          status:
            description: A ContainerizedWorkloadStatus represents the observed state
              of a ContainerizedWorkload.
            properties:
              conditions:
                description: Conditions of the resource.
                items:
                  description: A Condition that may apply to a resource.
                  properties:
                    lastTransitionTime:
                      description: LastTransitionTime is the last time this condition
                        transitioned from one status to another.
                      format: date-time
                      type: string
                    message:
                      description: A Message containing details about this condition's
                        last transition from one status to another, if any.
                      type: string
                    reason:
                      description: A Reason for this condition's last transition from
                        one status to another.
                      type: string
                    status:
                      description: Status of this condition; is it currently True,
                        False, or Unknown?
                      type: string
                    type:
                      description: Type of this condition. At most one of each condition
                        type may apply to a resource at any point in time.
                      type: string
                  required:
                  - lastTransitionTime
                  - reason
                  - status
                  - type
                  type: object
                type: array
              resources:
                description: Resources managed by this containerised workload.
                items:
                  description: 'ObjectReference contains enough information to let
                    you inspect or modify the referred object. --- New uses of this
                    type are discouraged because of difficulty describing its usage
                    when embedded in APIs.  1. Ignored fields.  It includes many fields
                    which are not generally honored.  For instance, ResourceVersion
                    and FieldPath are both very rarely valid in actual usage.  2.
                    Invalid usage help.  It is impossible to add specific help for
                    individual usage.  In most embedded usages, there are particular     restrictions
                    like, "must refer only to types A and B" or "UID not honored"
                    or "name must be restricted".     Those cannot be well described
                    when embedded.  3. Inconsistent validation.  Because the usages
                    are different, the validation rules are different by usage, which
                    makes it hard for users to predict what will happen.  4. The fields
                    are both imprecise and overly precise.  Kind is not a precise
                    mapping to a URL. This can produce ambiguity     during interpretation
                    and require a REST mapping.  In most cases, the dependency is
                    on the group,resource tuple     and the version of the actual
                    struct is irrelevant.  5. We cannot easily change it.  Because
                    this type is embedded in many locations, updates to this type     will
                    affect numerous schemas.  Don''t make new APIs embed an underspecified
                    API type they do not control. Instead of using this type, create
                    a locally provided and used type that is well-focused on your
                    reference. For example, ServiceReferences for admission registration:
                    https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533
                    .'
                  properties:
                    apiVersion:
                      description: API version of the referent.
                      type: string
                    fieldPath:
                      description: 'If referring to a piece of an object instead of
                        an entire object, this string should contain a valid JSON/Go
                        field access statement, such as desiredState.manifest.containers[2].
                        For example, if the object reference is to a container within
                        a pod, this would take on a value like: "spec.containers{name}"
                        (where "name" refers to the name of the container that triggered
                        the event) or if no container name is specified "spec.containers[2]"
                        (container with index 2 in this pod). This syntax is chosen
                        only to have some well-defined way of referencing a part of
                        an object. TODO: this design is not final and this field is
                        subject to change in the future.'
                      type: string
                    kind:
                      description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
                      type: string
                    name:
                      description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
                      type: string
                    namespace:
                      description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
                      type: string
                    resourceVersion:
                      description: 'Specific resourceVersion to which this reference
                        is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
                      type: string
                    uid:
                      description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
                      type: string
                  type: object
                type: array
            type: object
        type: object
    served: true
    storage: true
    subresources:
      status: {}
status:
  acceptedNames:
    kind: ""
    plural: ""
  conditions: []
  storedVersions: []
