2024-05-25 23:43:19 +02:00
|
|
|
{%- set service_name = vars.cuddle_vars.service -%}
|
|
|
|
{%- set cluster_name = vars.cluster_vars.name -%}
|
|
|
|
{%- set cluster_namespace = vars.cluster_vars.namespace -%}
|
|
|
|
|
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
app: {{ service_name }}
|
|
|
|
cluster: {{ cluster_name }}
|
|
|
|
name: {{ service_name }}
|
|
|
|
namespace: {{ cluster_namespace }}
|
|
|
|
spec:
|
|
|
|
replicas: 3
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
app: {{ service_name }}
|
|
|
|
cluster: {{ cluster_name }}
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
app: {{ service_name }}
|
|
|
|
cluster: {{ cluster_name }}
|
|
|
|
spec:
|
|
|
|
containers:
|
|
|
|
- args:
|
|
|
|
- serve
|
|
|
|
command:
|
|
|
|
- {{ service_name }}
|
|
|
|
image: kasperhermansen/{{ service_name }}:{{ vars.user_vars.image_tag }}
|
|
|
|
name: {{ service_name }}
|
|
|
|
envFrom:
|
|
|
|
- configMapRef:
|
|
|
|
name: {{service_name}}-config
|
2024-05-26 23:26:21 +02:00
|
|
|
{%- if vars.cuddle_crdb.has_values %}
|
|
|
|
- configMapRef:
|
|
|
|
name: {{ vars.cuddle_crdb.file_name(service_name) }}
|
|
|
|
{%- endif %}
|
2024-05-26 23:15:06 +02:00
|
|
|
{%- if vars.vault_secret.has_values or vars.cuddle_crdb.has_values %}
|
|
|
|
env:
|
|
|
|
{%- if vars.vault_secret.has_values %}
|
|
|
|
{%- for secret in vars.vault_secret.secrets %}
|
|
|
|
- name: {{secret | upper | replace(".", "_") | replace("-", "_") }}
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
name: {{ vars.vault_secret.file_name(service_name) }}
|
|
|
|
key: {{ secret }}
|
|
|
|
{%- endfor %}
|
|
|
|
{%- endif %}
|
2024-05-26 23:26:21 +02:00
|
|
|
{#
|
2024-05-26 23:15:06 +02:00
|
|
|
{%- if vars.cuddle_crdb.has_values %}
|
|
|
|
- name: {{vars.cuddle_crdb.env }}
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
name: {{ vars.cuddle_crdb.file_name(service_name) }}
|
|
|
|
key: {{ vars.cuddle_crdb.env }}
|
|
|
|
{%- endif %}
|
2024-05-26 23:26:21 +02:00
|
|
|
#}
|
2024-05-26 23:15:06 +02:00
|
|
|
{%- endif %}
|
2024-05-25 23:43:19 +02:00
|
|
|
ports:
|
|
|
|
- containerPort: 3000
|
|
|
|
name: external-http
|
|
|
|
- containerPort: 3001
|
|
|
|
name: internal-http
|
2024-05-29 21:47:52 +02:00
|
|
|
- containerPort: 4000
|
|
|
|
name: external-grpc
|
|
|
|
- containerPort: 4001
|
2024-05-25 23:43:19 +02:00
|
|
|
name: internal-grpc
|