Skip to content

Instantly share code, notes, and snippets.

@egubi
Created August 3, 2022 13:05
Show Gist options
  • Save egubi/a34b4e84ab633842a1cccf49c7e7aef7 to your computer and use it in GitHub Desktop.
Save egubi/a34b4e84ab633842a1cccf49c7e7aef7 to your computer and use it in GitHub Desktop.
yttt
apiVersion: apps/v1
kind: Deployment
metadata:
name: node-hello
annotations:
type: "web"
spec:
replicas: 1
selector:
matchLabels:
app: web
template:
metadata:
labels:
app: web
spec:
containers:
- name: demo-container
image: gcr.io/google-samples/node-hello:1.0
env:
- name: DEMO_GREETING
value: "Hello from the environment"
- name: DEMO_FAREWELL
value: "Such a sweet sorrow"
#@data/values
---
ports:
- name: http
containerPort: 80
#@data/values
---
ports:
- name: https
containerPort: 443
#@ load ("@ytt:overlay", "overlay")
#@ load("@ytt:data", "data")
#@overlay/match by=overlay.subset({"kind":"Deployment", "metadata":{"annotations":{"type":"web"}}})
---
spec:
replicas: #@ data.values.deployment.replicas
template:
spec:
containers:
#@overlay/match by=overlay.subset({"name":"demo-container"})
-
#@overlay/match missing_ok=True
ports:
#@overlay/match missing_ok=True
#@ for/end port in data.values.ports:
- name: #@ port.name
#@overlay/match missing_ok=True
port: #@ port.containerPort
#@data/values
---
deployment:
replicas: 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment