Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 1 | {{- /* |
Jeremy Ronquillo | ec2d3e4 | 2020-06-05 11:33:39 -0700 | [diff] [blame] | 2 | |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 3 | # Copyright 2020-present Open Networking Foundation |
| 4 | # |
Jeremy Ronquillo | 6046ce3 | 2020-06-18 11:06:29 -0700 | [diff] [blame] | 5 | # SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0 |
Jeremy Ronquillo | ec2d3e4 | 2020-06-05 11:33:39 -0700 | [diff] [blame] | 6 | |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 7 | */ -}} |
| 8 | |
| 9 | {{/* |
| 10 | Renders a set of standardised labels. |
| 11 | */}} |
| 12 | {{- define "omec-user-plane.metadata_labels" -}} |
| 13 | {{- $application := index . 0 -}} |
| 14 | {{- $context := index . 1 -}} |
| 15 | release: {{ $context.Release.Name }} |
| 16 | app: {{ $application }} |
| 17 | {{- end -}} |
| 18 | |
| 19 | {{/* |
| 20 | Render 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 | {{/* |
| 31 | Render 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 Moon | 350a774 | 2021-09-08 13:53:55 -0700 | [diff] [blame] | 37 | image: {{ $context.Values.images.tags.tools | quote }} |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 38 | imagePullPolicy: {{ $context.Values.images.pullPolicy }} |
| 39 | securityContext: |
| 40 | privileged: true |
| 41 | runAsUser: 0 |
Hyunsun Moon | b0c8bcc | 2021-09-09 09:33:26 -0700 | [diff] [blame] | 42 | command: ["sh", "-xc"] |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 43 | 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 -}} |