Created
August 3, 2022 13:05
-
-
Save egubi/a34b4e84ab633842a1cccf49c7e7aef7 to your computer and use it in GitHub Desktop.
yttt
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
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" | |
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 | |
--- | |
ports: | |
- name: http | |
containerPort: 80 |
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 | |
--- | |
ports: | |
- name: https | |
containerPort: 443 |
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: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 |
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 | |
--- | |
deployment: | |
replicas: 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment