Logo

Documentation

Deliverable and Delivery Custom Resources

Deliverable

Deliverable allows the operator to pass information about the configuration to be applied to the environment to the delivery.

---
apiVersion: carto.run/v1alpha1
kind: Deliverable
metadata: {}
spec:

  # Additional parameters. See:
  # https://cartographer.sh/docs/latest/architecture/#parameter-hierarchy
  # +optional
  params:
    - # Name of the parameter. Should match a blueprint or
      # template parameter name.
      name: <string>

      # Value of the parameter.
      value: <any>

  # ServiceAccountName refers to the Service account with
  # permissions to create resources submitted by the supply chain.
  # If not set, Cartographer will use serviceAccountName from
  # supply chain. 
  # If that is also not set, Cartographer will use the default
  # service account in the workload's namespace.
  # +optional
  serviceAccountName: <string>

  # The location of the source code for the workload. Specify one
  # of `spec.source` or `spec.image`
  # +optional
  source:

    # Source code location in a git repository.
    # +optional
    git:
      ref:
        branch: <string>
        commit: <string>
        tag: <string>
      url: <string>

    # OCI Image in a repository, containing the source code to be
    # used throughout the supply chain.
    # +optional
    image: <string>

    # Subpath inside the Git repository or Image to treat as the
    # root of the application. Defaults to the root if left empty.
    # +optional
    subPath: <string>

Notes:

  1. labels serve as a way of indirectly selecting ClusterDelivery

ref: pkg/apis/v1alpha1/deliverable.go

ClusterDelivery

A ClusterDelivery is a cluster-scoped resources that enables application operators to define a continuous delivery workflow. Delivery is analogous to SupplyChain, in that it specifies a list of resources that are created when requested by the developer. Early resources in the delivery are expected to configure the k8s environment (for example by deploying an application). Later resources validate the environment is healthy.

The SupplyChain resources ClusterSourceTemplates and ClusterTemplates are valid for delivery. Delivery additionally has the resource ClusterDeploymentTemplates. Delivery can cast the values from a ClusterSourceTemplate so that they may be consumed by a ClusterDeploymentTemplate.

ClusterDeliveries specify the type of configuration they accept through the spec.selector field. Deliverables with matching spec.selector then create a logical delivery. This makes the values in the Deliverable available to all of the resources in the ClusterDeliverys spec.resources.

---
apiVersion: carto.run/v1alpha1
kind: ClusterDelivery
metadata: {}
spec:

  # Additional parameters. See:
  # https://cartographer.sh/docs/latest/architecture/#parameter-hierarchy
  # +optional
  params:
    - # DefaultValue of the parameter. Causes the parameter to be
      # optional; If the Owner does not specify this parameter,
      # this value is used.
      # +optional
      default: <any>

      # Name of the parameter. Should match a template parameter
      # name.
      name: <string>

      # Value of the parameter. If specified, owner properties are
      # ignored.
      # +optional
      value: <any>

  # Resources that are responsible for deploying and validating
  # the deliverable
  resources:
    - # Configs is a list of references to other 'config'
      # resources in this list. A config resource has the kind
      # ClusterConfigTemplate 
      # In a template, configs can be consumed as:  
      # $(configs.<name>.config)$ 
      # If there is only one image, it can be consumed as:  
      # $(config)$
      # +optional
      configs:
        - name: <string>
          resource: <string>

      # Deployment is a reference to a 'deployment' resource. A
      # deployment resource has the kind ClusterDeploymentTemplate
      # In a template, the deployment can be consumed as:   
      # $(deployment.url)$ and $(deployment.revision)$
      # +optional
      deployment:
        resource: <string>

      # Name of the resource. Used as a reference for inputs, as
      # well as being the name presented in deliverable statuses
      # to identify this resource.
      name: <string>

      # Params are a list of parameters to provide to the template
      # in TemplateRef Template params do not have to be specified
      # here, unless you want to force a particular value, or add
      # a default value. 
      # Parameters are consumed in a template with the syntax:  
      # $(params.<name>)$
      # +optional
      params:
        - # DefaultValue of the parameter. Causes the parameter to
          # be optional; If the Owner does not specify this
          # parameter, this value is used.
          # +optional
          default: <any>

          # Name of the parameter. Should match a template
          # parameter name.
          name: <string>

          # Value of the parameter. If specified, owner properties
          # are ignored.
          # +optional
          value: <any>

      # Sources is a list of references to other 'source'
      # resources in this list. A source resource has the kind
      # ClusterSourceTemplate or ClusterDeploymentTemplate 
      # In a template, sources can be consumed as:   
      # $(sources.<name>.url)$ and $(sources.<name>.revision)$ 
      # If there is only one source, it can be consumed as:   
      # $(source.url)$ and $(source.revision)$
      # +optional
      sources:
        - name: <string>
          resource: <string>

      # TemplateRef identifies the template used to produce this
      # resource
      templateRef:

        # Kind of the template to apply
        kind: <[ClusterSourceTemplate|ClusterDeploymentTemplate|ClusterTemplate]>

        # Name of the template to apply
        name: <string>

  # Specifies the label key-value pairs used to select
  # deliverables See:
  # https://cartographer.sh/docs/v0.1.0/architecture/#selectors
  selector: {}

  # ServiceAccountName refers to the Service account with
  # permissions to create resources submitted by the supply chain.
  # If not set, Cartographer will use serviceAccountName from
  # supply chain. 
  # If that is also not set, Cartographer will use the default
  # service account in the workload's namespace.
  # +optional
  serviceAccountRef:

    # Name of the service account being referred to
    name: <string>

    # Namespace of the service account being referred to if
    # omitted, the Owner's namespace is used.
    # +optional
    namespace: <string>

ref: pkg/apis/v1alpha1/cluster_delivery.go