Created
October 11, 2022 23:43
-
-
Save pivotaljohn/6c3252b4f4b192615ee71be798f5e23b to your computer and use it in GitHub Desktop.
Service template
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") | |
#@ for svc in data.values.services: | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: #@ svc.name | |
labels: | |
app.kubernetes.io/version: #@ data.values.version | |
app.kubernetes.io/name: #@ svc.name | |
spec: | |
ports: | |
- name: https | |
protocol: TCP | |
port: 443 | |
targetPort: 9377 | |
#@ if svc.allowHTTP: | |
- name: http | |
protocol: TCP | |
port: 80 | |
targetPort: 9376 | |
#@ end | |
#@ end |
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 | |
--- | |
version: 0.1.0 | |
services: | |
- name: frontend | |
allowHTTP: true | |
- name: backend | |
allowHTTP: false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment