blob: aa7dfa4002620ca08ae32a49e551fce30ccde13c [file] [log] [blame]
Jeremy Ronquillo223db002020-06-05 10:28:22 -07001{{- /*
Jeremy Ronquilloec2d3e42020-06-05 11:33:39 -07002
Jeremy Ronquillo223db002020-06-05 10:28:22 -07003# Copyright 2020-present Open Networking Foundation
4#
Jeremy Ronquillo6046ce32020-06-18 11:06:29 -07005# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
Jeremy Ronquilloec2d3e42020-06-05 11:33:39 -07006
Jeremy Ronquillo223db002020-06-05 10:28:22 -07007*/ -}}
8
9{{/*
10Renders a set of standardised labels.
11*/}}
12{{- define "omec-user-plane.metadata_labels" -}}
13{{- $application := index . 0 -}}
14{{- $context := index . 1 -}}
15release: {{ $context.Release.Name }}
16app: {{ $application }}
17{{- end -}}
18
19{{/*
20Render the given template.
21*/}}
22{{- define "omec-user-plane.template" -}}
23{{- $name := index . 0 -}}
24{{- $context := index . 1 -}}
25{{- $last := base $context.Template.Name }}
26{{- $wtf := $context.Template.Name | replace $last $name -}}
27{{ include $wtf $context }}
28{{- end -}}
29
30{{/*
31Render init container for coredump.
32*/}}
33{{- define "omec-user-plane.coredump_init" -}}
34{{- $pod := index . 0 -}}
35{{- $context := index . 1 -}}
36- name: {{ $pod }}-coredump-init
Hyunsun Moon350a7742021-09-08 13:53:55 -070037 image: {{ $context.Values.images.tags.tools | quote }}
Jeremy Ronquillo223db002020-06-05 10:28:22 -070038 imagePullPolicy: {{ $context.Values.images.pullPolicy }}
39 securityContext:
40 privileged: true
41 runAsUser: 0
Hyunsun Moonb0c8bcc2021-09-09 09:33:26 -070042 command: ["sh", "-xc"]
Jeremy Ronquillo223db002020-06-05 10:28:22 -070043 args:
44 - echo '/tmp/coredump/core.%h.%e.%t' > /mnt/host-rootfs/proc/sys/kernel/core_pattern
45 volumeMounts:
46 - name: host-rootfs
47 mountPath: /mnt/host-rootfs
48{{- end -}}