mirror of
https://github.com/jpetazzo/container.training.git
synced 2026-07-28 01:01:12 +00:00
55 lines
1.1 KiB
YAML
55 lines
1.1 KiB
YAML
---
|
|
#@ load("@ytt:data", "data")
|
|
---
|
|
#@ def Deployment(component, repository=data.values.repository, tag=data.values.tag):
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
labels:
|
|
app: #@ component
|
|
container.training/generated-by: ytt
|
|
name: #@ component
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: #@ component
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: #@ component
|
|
spec:
|
|
containers:
|
|
- image: #@ repository + "/" + component + ":" + tag
|
|
name: #@ component
|
|
#@ end
|
|
---
|
|
#@ def Service(component, port=80, type="ClusterIP"):
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
labels:
|
|
app: #@ component
|
|
container.training/generated-by: ytt
|
|
name: #@ component
|
|
spec:
|
|
ports:
|
|
- port: #@ port
|
|
protocol: TCP
|
|
targetPort: #@ port
|
|
selector:
|
|
app: #@ component
|
|
type: #@ type
|
|
#@ end
|
|
---
|
|
--- #@ Deployment("hasher")
|
|
--- #@ Service("hasher")
|
|
--- #@ Deployment("redis", repository="library", tag="latest")
|
|
--- #@ Service("redis", port=6379)
|
|
--- #@ Deployment("rng")
|
|
--- #@ Service("rng")
|
|
--- #@ Deployment("webui")
|
|
--- #@ Service("webui", type="NodePort")
|
|
--- #@ Deployment("worker")
|
|
---
|