diff --git a/crates/cuddle-clusters/tests/with_actual_deployment/.cuddle/plan/templates/clusters/configmap.yaml.jinja2 b/crates/cuddle-clusters/tests/with_actual_deployment/.cuddle/plan/templates/clusters/configmap.yaml.jinja2 new file mode 100644 index 0000000..591956a --- /dev/null +++ b/crates/cuddle-clusters/tests/with_actual_deployment/.cuddle/plan/templates/clusters/configmap.yaml.jinja2 @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ vars.cuddle_vars.service }}-config +data: + {%- if (vars.cluster_vars.env | items | length) > 0 %} + environment: + {%- for (name, value) in vars.cluster_vars.env | dictsort %} + {{name | upper | replace(".", "_") | replace("-", "_") }}: {{value}} + {%- endfor %} + {%- endif %} diff --git a/crates/cuddle-clusters/tests/with_actual_deployment/.cuddle/plan/templates/clusters/deployment.yaml.jinja2 b/crates/cuddle-clusters/tests/with_actual_deployment/.cuddle/plan/templates/clusters/deployment.yaml.jinja2 new file mode 100644 index 0000000..a00e24c --- /dev/null +++ b/crates/cuddle-clusters/tests/with_actual_deployment/.cuddle/plan/templates/clusters/deployment.yaml.jinja2 @@ -0,0 +1,41 @@ +{%- 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 }}:main-1715336504 + name: {{ service_name }} + envFrom: + - configMapRef: + name: {{service_name}}-config + ports: + - containerPort: 3000 + name: external-http + - containerPort: 3001 + name: internal-http + - containerPort: 3002 + name: internal-grpc