feat: add sidecar container to log app start / stop events

Ticket: ENG-1160
This commit is contained in:
Benjamin Chastanier
2022-04-21 17:55:12 +02:00
parent bb85c03724
commit d6f91e51d2
3 changed files with 77 additions and 2 deletions

View File

@@ -90,4 +90,29 @@ spec:
requests:
cpu: {{ total_cpus }}
memory: {{ total_ram_in_mib }}Mi
- name: {{ sanitized_name }}-sidecar
image: busybox
command: ["/bin/sh", "-c", "while true; do sleep 5; done"]
{%- if private_port %}
livenessProbe:
tcpSocket:
port: {{ private_port }}
initialDelaySeconds: {{ start_timeout_in_seconds }}
failureThreshold: 1
periodSeconds: 5
{%- endif %}
lifecycle:
postStart:
exec:
command:
- sh
- -c
- echo "-- APPLICATION STARTED --" >/proc/1/fd/1
preStop:
exec:
command:
- sh
- -c
- echo "-- APPLICATION SHUTDOWN --" >/proc/1/fd/1
{%- endif %}

View File

@@ -90,4 +90,29 @@ spec:
requests:
cpu: {{ total_cpus }}
memory: {{ total_ram_in_mib }}Mi
- name: {{ sanitized_name }}-sidecar
image: busybox
command: ["/bin/sh", "-c", "while true; do sleep 5; done"]
{%- if private_port %}
livenessProbe:
tcpSocket:
port: {{ private_port }}
initialDelaySeconds: {{ start_timeout_in_seconds }}
failureThreshold: 1
periodSeconds: 5
{%- endif %}
lifecycle:
postStart:
exec:
command:
- sh
- -c
- echo "-- APPLICATION STARTED --" >/proc/1/fd/1
preStop:
exec:
command:
- sh
- -c
- echo "-- APPLICATION SHUTDOWN --" >/proc/1/fd/1
{%- endif %}

View File

@@ -64,7 +64,7 @@ spec:
name: {{ sanitized_name }}
key: {{ ev.key }}
{%- endfor %}
{%- if private_port %}
{%- if private_port %}
ports:
{%- for port in ports %}
- containerPort: {{ port.port }}
@@ -81,7 +81,7 @@ spec:
port: {{ private_port }}
initialDelaySeconds: {{ start_timeout_in_seconds }}
periodSeconds: 20
{%- endif %}
{%- endif %}
resources:
limits:
cpu: {{ cpu_burst }}
@@ -89,4 +89,29 @@ spec:
requests:
cpu: {{ total_cpus }}
memory: {{ total_ram_in_mib }}Mi
- name: {{ sanitized_name }}-sidecar
image: busybox
command: ["/bin/sh", "-c", "while true; do sleep 5; done"]
{%- if private_port %}
livenessProbe:
tcpSocket:
port: {{ private_port }}
initialDelaySeconds: {{ start_timeout_in_seconds }}
failureThreshold: 1
periodSeconds: 5
{%- endif %}
lifecycle:
postStart:
exec:
command:
- sh
- -c
- echo "-- APPLICATION STARTED --" >/proc/1/fd/1
preStop:
exec:
command:
- sh
- -c
- echo "-- APPLICATION SHUTDOWN --" >/proc/1/fd/1
{%- endif %}