2024-05-25 13:47:23 +02:00
|
|
|
{% set_global cluster_vars = filter_by_prefix(prefix=["clusters", cluster]) %}
|
|
|
|
|
2024-02-03 19:13:55 +01:00
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
|
|
|
name: "{{ service }}"
|
|
|
|
spec:
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
app: "{{ service }}"
|
|
|
|
template:
|
|
|
|
spec:
|
|
|
|
containers:
|
|
|
|
- name: "{{ service }}"
|
2024-02-03 21:18:03 +01:00
|
|
|
command: [{{ service }}]
|
2024-02-03 21:15:01 +01:00
|
|
|
args: ["serve"]
|
2024-02-03 19:13:55 +01:00
|
|
|
image: "deployment:latest"
|
|
|
|
ports:
|
|
|
|
- containerPort: 3000
|
2024-02-03 19:34:09 +01:00
|
|
|
name: external-http
|
2024-02-03 19:13:55 +01:00
|
|
|
- containerPort: 3001
|
2024-02-03 19:34:09 +01:00
|
|
|
name: internal-http
|
2024-02-03 19:13:55 +01:00
|
|
|
- containerPort: 3002
|
2024-02-03 19:34:09 +01:00
|
|
|
name: internal-grpc
|
2024-05-25 13:47:23 +02:00
|
|
|
{% if cluster_vars.config or cluster_vars.secrets %}
|
|
|
|
env:
|
|
|
|
{% for secret in cluster_vars.secrets %}
|
|
|
|
- name: SECRET_USERNAME
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
name: my-secret
|
|
|
|
key: username
|
|
|
|
- name: SECRET_PASSWORD
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
name: my-secret
|
|
|
|
key: password
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|