Skip to content

Instantly share code, notes, and snippets.

@voor
Created September 14, 2021 13:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save voor/fc6724f87ab0cd0c029f76184ee5290c to your computer and use it in GitHub Desktop.
Save voor/fc6724f87ab0cd0c029f76184ee5290c to your computer and use it in GitHub Desktop.
Simple gist that shows the flexibility of ytt and how it can achieve an intended outcome without impacting other commands.
#@data/values
#! Note that the file coming out of imgpkg would NOT contain the data/values, you would need to access it with the following CLI command:
#! ytt -f package-template.yaml --data-values-file current-version.yml
#! The data/values is just included here so it'll work properly on ytt playground.
---
apiVersion: imgpkg.carvel.dev/v1alpha1
bundle:
image: harbor.example.com/imgpkg/charts/secretgen-controller@sha256:e302989e79a3c4f17eb5d101ba1c773ea717cde49b5606ffc6424429d70fb8d0
tag: v0.5.0
kind: BundleLock
#@ load("@ytt:data", "data")
apiVersion: data.packaging.carvel.dev/v1alpha1
kind: Package
metadata:
name: #@ "secretgen-controller.example.com.{}".format(data.values.bundle.tag)
namespace: secretgen-controller
spec:
refName: secretgen-controller.example.com
version: #@ data.values.bundle.tag
releaseNotes: "relevant release notes..."
licenses:
- "UNKNOWN"
template:
spec:
fetch:
- imgpkgBundle:
image: #@ data.values.bundle.image
template:
- ytt:
paths:
- config/
- kbld:
paths:
- "-"
- .imgpkg/images.yml
deploy:
- kapp: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment