
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    controller-gen.kubebuilder.io/version: v0.2.4
  name: appdeployments.core.oam.dev
spec:
  group: core.oam.dev
  names:
    categories:
    - oam
    kind: AppDeployment
    listKind: AppDeploymentList
    plural: appdeployments
    shortNames:
    - appdeploy
    singular: appdeployment
  scope: Namespaced
  versions:
  - name: v1beta1
    schema:
      openAPIV3Schema:
        description: AppDeployment is the Schema for the AppDeployment 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: AppDeploymentSpec defines how to describe an upgrade between different apps
            properties:
              appRevisions:
                description: AppRevision specifies  AppRevision resources to and the rules to apply to them.
                items:
                  description: AppRevision specifies an AppRevision resource to and the rules to apply to it.
                  properties:
                    placement:
                      description: Placement defines the cluster placement rules for an app revision.
                      items:
                        description: ClusterPlacement defines the cluster placement rules for an app revision.
                        properties:
                          clusterSelector:
                            description: ClusterSelector selects the cluster to  deploy apps to. If not specified, it indicates the host cluster per se.
                            properties:
                              labels:
                                additionalProperties:
                                  type: string
                                description: Labels defines the label selector to select the cluster.
                                type: object
                              name:
                                description: Name is the name of the cluster.
                                type: string
                            type: object
                          distribution:
                            description: Distribution defines the replica distribution of an AppRevision to a cluster.
                            properties:
                              replicas:
                                description: Replicas is the replica number.
                                type: integer
                            type: object
                        type: object
                      type: array
                    revisionName:
                      description: RevisionName is the name of the AppRevision.
                      type: string
                  type: object
                type: array
              traffic:
                description: Traffic defines the traffic rules to apply across revisions.
                properties:
                  gateways:
                    description: Gateways specifies the names of gateways that should apply these rules. Gateways in other namespaces may be referred to by `<gateway namespace>/<gateway name>`; specifying a gateway with no namespace qualifier is the same as specifying the AppDeployment's namespace.
                    items:
                      type: string
                    type: array
                  hosts:
                    description: Hosts are the destination hosts to which traffic is being sent. Could be a DNS name with wildcard prefix or an IP address.
                    items:
                      type: string
                    type: array
                  http:
                    description: HTTP defines the rules to match and split http traffoc across revisions.
                    items:
                      description: HTTPRule defines the rules to match and split http traffic across revisions.
                      properties:
                        match:
                          description: Match defines the conditions to be satisfied for the rule to be activated. All conditions inside a single match block have AND semantics, while the list of match blocks have OR semantics. The rule is matched if any one of the match blocks succeed.
                          items:
                            description: HTTPMatchRequest specifies a set of criterion to be met in order for the rule to be applied to the HTTP request. For example, the following restricts the rule to match only requests where the URL path starts with /ratings/v2/ and the request contains a custom `end-user` header with value `jason`.
                            properties:
                              uri:
                                description: URI defines how to match with an URI.
                                properties:
                                  prefix:
                                    type: string
                                type: object
                            type: object
                          type: array
                        weightedTargets:
                          description: WeightedTargets defines the revision targets to select and route traffic to.
                          items:
                            description: WeightedTarget defines the revision target to select and route traffic to.
                            properties:
                              componentName:
                                description: ComponentName is the name of the component. Note that it is the original component name in the Application. No need to append revision.
                                type: string
                              port:
                                description: Port is the port to route traffic towards.
                                type: integer
                              revisionName:
                                description: RevisionName is the name of the app revision.
                                type: string
                              weight:
                                description: Weight defines the proportion of traffic to be forwarded to the service version. (0-100). Sum of weights across destinations SHOULD BE == 100. If there is only one destination in a rule, the weight value is assumed to be 100.
                                type: integer
                            type: object
                          type: array
                      type: object
                    type: array
                type: object
            type: object
          status:
            description: AppDeploymentStatus defines the observed state of AppDeployment
            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
              phase:
                description: Phase shows the phase that the AppDeployment is undergoing. If Phase is Rolling, no update should be made to the spec.
                type: string
              placement:
                description: Placement shows the cluster placement results of the app revisions.
                items:
                  description: PlacementStatus shows the cluster placement results of an app revision.
                  properties:
                    clusters:
                      description: Clusters shows cluster placement results.
                      items:
                        description: ClusterPlacementStatus shows the placement results of a cluster.
                        properties:
                          clusterName:
                            description: ClusterName indicates the name of the cluster to deploy apps to. If empty, it indicates the host cluster per se.
                            type: string
                          replicas:
                            description: Replicas indicates the replica number of an app revision to deploy to a cluster.
                            type: integer
                        type: object
                      type: array
                    revisionName:
                      description: RevisionName is the name of the AppRevision.
                      type: string
                  type: object
                type: array
            type: object
        type: object
    served: true
    storage: true
    subresources:
      status: {}
status:
  acceptedNames:
    kind: ""
    plural: ""
  conditions: []
  storedVersions: []
