Skip to content

Instantly share code, notes, and snippets.

@cppforlife
Forked from tommituura/config.yaml
Last active February 18, 2020 15:30
Show Gist options
  • Save cppforlife/9632168312aa01463e45659ad277c031 to your computer and use it in GitHub Desktop.
Save cppforlife/9632168312aa01463e45659ad277c031 to your computer and use it in GitHub Desktop.
ytt templating, how to combine values from two yamls into third? NOT WORKING, HELP NEEDED.
#@ load("@ytt:data", "data")
metadata: #@ data.values.cluster_metadata
platform: #@ data.values.platform
#! this file defines possible values consumed by config.yml (it effectively acts as basic schema)
#! other data values are overlayed on top of this file.
#@data/values
---
platform:
vsphere:
username: ""
password: ""
pullSecret: ""
sshPubkey: ""
cluster_metadata:
name: ""
#! this file fills secret info
#@data/values
---
platform:
vsphere:
username: "username-value"
password: "password-value"
pullSecret: "pullSecret-value"
sshPubkey: "ssh-rsa pubkey value"
#! this fills in other generic non-secret info
#@data/values
---
cluster_metadata:
name: demo
requires to run ytt -f . or ytt -f config.yml -f default-values.yml -f demo-secrets.yml -f demo-values.yml to "order" data values properly
expected result:
```
metadata:
name: demo
platform:
vsphere:
username: username-value
password: password-value
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment