Skip to content

Instantly share code, notes, and snippets.

View cari-lynn's full-sized avatar

Cari cari-lynn

  • Portland, OR
  • 04:32 (UTC -08:00)
View GitHub Profile
@cari-lynn
cari-lynn / config.yml
Last active May 8, 2020 21:24
Appending a yaml string using an overlay
#@ load("@ytt:data", "data")
---
#! Input
apiVersion: v1
kind: Secret
metadata:
name: secret
stringData:
longYaml: |
---
@cari-lynn
cari-lynn / config.yml
Created May 8, 2020 21:43
Append to a string as yaml
#@ load("@ytt:data", "data")
---
#! Input
apiVersion: v1
kind: Secret
metadata:
name: secret
stringData:
longYaml: |
---
test gist
#@ load("@ytt:data", "data")
data: #@ data.values.keys
domains: #@ data.values.names
foo: #@ data.values.foo
#@ load("@ytt:data", "data")
#@ foo = "baz"
1: #@ data.values.foo
2: #@ getattr(data.values, foo)
#@ load("@ytt:data", "data")
#@ load("@ytt:template", "template")
#@ def dep_yaml(deployment):
#@ key = "deploy:{}".format(deployment.name)
#@ return {key: {"script": deployment.script}}
#@ end
#@ for deployment in data.values.deployments:
_: #@ template.replace(dep_yaml(deployment))
@cari-lynn
cari-lynn / config.yml
Last active July 6, 2020 22:14
Overlay defaults
#@ load("@ytt:overlay", "overlay")
#@ def left():
key1: value1
key2: value2
#@ end
#@ def right1():
#@overlay/match missing_ok=True
name: type1
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: example-ingress1
annotations: ~
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: example-ingress1
annotations: ~
#@ load ("@ytt:data", "data")
#@ load("@ytt:struct", "struct")
#@ services = struct.decode(data.values.services)
#@ for service in services:
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: #@ service