Logo

Documentation

Template Custom Resources

ClusterSourceTemplate

ClusterSourceTemplate indicates how the supply chain could instantiate an object responsible for providing source code.

The ClusterSourceTemplate requires definition of a urlPath and revisionPath. ClusterSourceTemplate will update its status to emit url and revision values, which are reflections of the values at the path on the created objects. The supply chain may make these values available to other resources.

---
apiVersion: carto.run/v1alpha1
kind: ClusterSourceTemplate
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 or Template does not specify this
      # parameter, this value is used.
      default: <any>

      # Name of a parameter the template accepts from the
      # Blueprint or Owner.
      name: <string>

  # RevisionPath is a path into the templated object's data that
  # contains a revision. The revision, along with the URL,
  # represents the output of the Template. RevisionPath is
  # specified in jsonpath format, eg: .status.artifact.revision
  revisionPath: <string>

  # Template defines a resource template for a Kubernetes Resource
  # or Custom Resource which is applied to the server each time
  # the blueprint is applied. Templates support simple value
  # interpolation using the $()$ marker format. For more
  # information, see:
  # https://cartographer.sh/docs/latest/templating/ You cannot
  # define both Template and Ytt at the same time.
  # +optional
  template: {}

  # URLPath is a path into the templated object's data that
  # contains a URL. The URL, along with the revision, represents
  # the output of the Template. URLPath is specified in jsonpath
  # format, eg: .status.artifact.url
  urlPath: <string>

  # Ytt defines a resource template written in `ytt` for a
  # Kubernetes Resource or Custom Resource which is applied to the
  # server each time the blueprint is applied. Templates support
  # simple value interpolation using the $()$ marker format. For
  # more information, see:
  # https://cartographer.sh/docs/latest/templating/ You cannot
  # define both Template and Ytt at the same time.
  # +optional
  ytt: <string>

ref: pkg/apis/v1alpha1/cluster_source_template.go

ClusterImageTemplate

ClusterImageTemplate instructs how the supply chain should instantiate an object responsible for supplying container images, for instance, one that takes source code, builds a container image out of it.

The ClusterImageTemplate requires definition of an imagePath. ClusterImageTemplate will update its status to emit an image value, which is a reflection of the value at the path on the created object. The supply chain may make this value available to other resources.

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

  # ImagePath is a path into the templated object's data that
  # contains a valid image digest. This might be a URL or in some
  # cases just a repository path and digest. The final spec for
  # this field may change as we implement RFC-0016
  # https://github.com/vmware-tanzu/cartographer/blob/main/rfc/rfc-0016-validate-template-outputs.md
  # ImagePath is specified in jsonpath format, eg:
  # .status.artifact.image_digest
  imagePath: <string>

  # 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 or Template does not specify this
      # parameter, this value is used.
      default: <any>

      # Name of a parameter the template accepts from the
      # Blueprint or Owner.
      name: <string>

  # Template defines a resource template for a Kubernetes Resource
  # or Custom Resource which is applied to the server each time
  # the blueprint is applied. Templates support simple value
  # interpolation using the $()$ marker format. For more
  # information, see:
  # https://cartographer.sh/docs/latest/templating/ You cannot
  # define both Template and Ytt at the same time.
  # +optional
  template: {}

  # Ytt defines a resource template written in `ytt` for a
  # Kubernetes Resource or Custom Resource which is applied to the
  # server each time the blueprint is applied. Templates support
  # simple value interpolation using the $()$ marker format. For
  # more information, see:
  # https://cartographer.sh/docs/latest/templating/ You cannot
  # define both Template and Ytt at the same time.
  # +optional
  ytt: <string>

ref: pkg/apis/v1alpha1/cluster_image_template.go

ClusterConfigTemplate

Instructs the supply chain how to instantiate a Kubernetes object that knows how to make Kubernetes configurations available to further resources in the chain.

The ClusterConfigTemplate requires definition of a configPath. ClusterConfigTemplate will update its status to emit a config value, which is a reflection of the value at the path on the created object. The supply chain may make this value available to other resources.

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

  # ConfigPath is a path into the templated object's data that
  # contains valid yaml. This is typically the information that
  # will configure the components of the deployable image.
  # ConfigPath is specified in jsonpath format, eg: .data
  configPath: <string>

  # 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 or Template does not specify this
      # parameter, this value is used.
      default: <any>

      # Name of a parameter the template accepts from the
      # Blueprint or Owner.
      name: <string>

  # Template defines a resource template for a Kubernetes Resource
  # or Custom Resource which is applied to the server each time
  # the blueprint is applied. Templates support simple value
  # interpolation using the $()$ marker format. For more
  # information, see:
  # https://cartographer.sh/docs/latest/templating/ You cannot
  # define both Template and Ytt at the same time.
  # +optional
  template: {}

  # Ytt defines a resource template written in `ytt` for a
  # Kubernetes Resource or Custom Resource which is applied to the
  # server each time the blueprint is applied. Templates support
  # simple value interpolation using the $()$ marker format. For
  # more information, see:
  # https://cartographer.sh/docs/latest/templating/ You cannot
  # define both Template and Ytt at the same time.
  # +optional
  ytt: <string>

ref: pkg/apis/v1alpha1/cluster_config_template.go

ClusterDeploymentTemplate

A ClusterDeploymentTemplate indicates how the delivery should configure the environment (namespace/cluster).

The ClusterDeploymentTemplate consumes configuration from the deployment values provided by the ClusterDelivery. The ClusterDeploymentTemplate outputs these same values. The ClusterDeploymentTemplate is able to consume additional configuration from the sources provided by the ClusterDelivery.

ClusterDeploymentTemplate must specify criteria to determine whether the templated object has successfully completed its role in configuring the environment. Once the criteria are met, the ClusterDeploymentTemplate will output the deployment values. The criteria may be specified in spec.observedMatches or in spec.observedCompletion.

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

  # ObservedCompletion describe the criteria for determining that
  # the templated object completed configuration of environment.
  # These criteria assert completion when metadata.Generation and
  # status.ObservedGeneration match, AND success or failure
  # criteria match. Cannot specify both ObservedMatches and
  # ObservedCompletion.
  # +optional
  observedCompletion:

    # FailedCondition, when matched, indicates that the input did
    # not deploy successfully.
    # +optional
    failed:

      # Key is a jsonPath expression pointing to the field to
      # inspect on the templated object, eg:
      # 'status.conditions[?(@.type=="Succeeded")].status'
      key: <string>

      # Value is the expected value that, when matching the key's
      # actual value, makes this condition true.
      value: <string>

    # SucceededCondition, when matched, indicates that the input
    # was successfully deployed.
    succeeded:

      # Key is a jsonPath expression pointing to the field to
      # inspect on the templated object, eg:
      # 'status.conditions[?(@.type=="Succeeded")].status'
      key: <string>

      # Value is the expected value that, when matching the key's
      # actual value, makes this condition true.
      value: <string>

  # ObservedMatches describe the criteria for determining that the
  # templated object completed configuration of environment. These
  # criteria assert completion when an output (usually a field in
  # .status) matches an input (usually a field in .spec) Cannot
  # specify both ObservedMatches and ObservedCompletion.
  # +optional
  observedMatches:
    - # Input is a jsonPath to a value that is fulfilled before
      # the templated object is reconciled. Usually a value in the
      # .spec of the object
      input: <string>

      # Output is a jsonPath to a value that is fulfilled after
      # the templated object is reconciled. Usually a value in the
      # .status of the object
      output: <string>

  # 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 or Template does not specify this
      # parameter, this value is used.
      default: <any>

      # Name of a parameter the template accepts from the
      # Blueprint or Owner.
      name: <string>

  # Template defines a resource template for a Kubernetes Resource
  # or Custom Resource which is applied to the server each time
  # the blueprint is applied. Templates support simple value
  # interpolation using the $()$ marker format. For more
  # information, see:
  # https://cartographer.sh/docs/latest/templating/ You cannot
  # define both Template and Ytt at the same time.
  # +optional
  template: {}

  # Ytt defines a resource template written in `ytt` for a
  # Kubernetes Resource or Custom Resource which is applied to the
  # server each time the blueprint is applied. Templates support
  # simple value interpolation using the $()$ marker format. For
  # more information, see:
  # https://cartographer.sh/docs/latest/templating/ You cannot
  # define both Template and Ytt at the same time.
  # +optional
  ytt: <string>

ref: pkg/apis/v1alpha1/cluster_deployment_template.go

ClusterTemplate

A ClusterTemplate instructs the supply chain to instantiate a Kubernetes object that has no outputs to be supplied to other objects in the chain, for instance, a resource that deploys a container image that has been built by other ancestor resources.

The ClusterTemplate does not emit values to the supply chain.

---
apiVersion: carto.run/v1alpha1
kind: ClusterTemplate
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 or Template does not specify this
      # parameter, this value is used.
      default: <any>

      # Name of a parameter the template accepts from the
      # Blueprint or Owner.
      name: <string>

  # Template defines a resource template for a Kubernetes Resource
  # or Custom Resource which is applied to the server each time
  # the blueprint is applied. Templates support simple value
  # interpolation using the $()$ marker format. For more
  # information, see:
  # https://cartographer.sh/docs/latest/templating/ You cannot
  # define both Template and Ytt at the same time.
  # +optional
  template: {}

  # Ytt defines a resource template written in `ytt` for a
  # Kubernetes Resource or Custom Resource which is applied to the
  # server each time the blueprint is applied. Templates support
  # simple value interpolation using the $()$ marker format. For
  # more information, see:
  # https://cartographer.sh/docs/latest/templating/ You cannot
  # define both Template and Ytt at the same time.
  # +optional
  ytt: <string>

ref: pkg/apis/v1alpha1/cluster_template.go