Last active
September 4, 2023 17:19
-
-
Save ThomasVitale/ab58531ecd916ec0c83908e7cf86a596 to your computer and use it in GitHub Desktop.
ytt yaml fragment snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#@data/values-schema | |
--- | |
service: | |
enabled: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#@ load("@ytt:data", "data") | |
#@ load("@ytt:yaml", "yaml") | |
#@ def service(): | |
--- | |
kind: Service | |
apiVersion: v1 | |
metadata: | |
name: echo-service | |
spec: | |
selector: | |
app: echo | |
ports: | |
- name: my-port | |
port: 8080 | |
#@ end | |
#@ if/end data.values.service.enabled: | |
--- | |
#@ service() | |
#!@ yaml.encode(service()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment