Skip to content

Instantly share code, notes, and snippets.

@sclevine
Last active June 27, 2022 15:31
Show Gist options
  • Save sclevine/2ee1650b566f7562fbee5b6c6d346135 to your computer and use it in GitHub Desktop.
Save sclevine/2ee1650b566f7562fbee5b6c6d346135 to your computer and use it in GitHub Desktop.
blueprints
apiVersion: carto.run/v1alpha1
kind: ClusterBlueprint
metadata:
name: web-supplychain
spec:
outputTypeRef:
name: image
outputs:
- name: digest
valueResource: image-builder
# mutually exclusive - resources, template, ytt
resources:
- name: source-provider
blueprintRef:
name: source-template # also probably kind
- name: image-builder
blueprintRef:
options:
- name: kpack-template
selector:
matchParams:
- key: language
operator: In
values: ["java"]
- name: kaniko-template
selector:
matchParams:
- key: language
operator: In
values: ["c"]
inputs:
- resource: source-provider
---
apiVersion: carto.run/v1alpha1
kind: ClusterBlueprint
metadata:
name: kpack-template
spec:
outputTypeRef:
name: image
ownerType:
apiVersion: carto.run/v1alpha1
kind: Workload
outputs:
- name: digest
valuePath: .status.latestImage
template:
apiVersion: kpack.io/v1alpha2
kind: Image
metadata:
name: $(descriptor.metadata.name)$
spec:
tag: $(descriptor.metadata.name)$
source:
blob:
url: $(source.url)$
build:
env: $(descriptor.spec.build.env)$
---
apiVersion: carto.run/v1alpha1
kind: ClusterBlueprintType
metadata:
name: image
spec:
outputs:
- name: digest
schema:
type: string
---
apiVersion: carto.run/v1alpha1
kind: ClusterBlueprintSelector
metadata:
name: web-selector
spec:
blueprintRef:
name: web-supplychain
ownerType:
apiVersion: carto.run/v1alpha1
kind: Workload
selector:
matchLabels:
app.tanzu.vmware.com/workload-type: web
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment