blob: 7317537cade820932cfde042615f4a2bfe2c8ea8 [file] [log] [blame]
Ajay Lotan Thakur9ad7dfe2022-07-25 17:26:03 -06001{{/*
2# SPDX-FileCopyrightText: 2022-present Intel Corporation
3
4# SPDX-License-Identifier: Apache-2.0
5*/}}
6
7{{- if .Values.config.upfadapter.deploy }}
8{{ tuple "upfadapter" . | include "5g-control-plane.service_account" }}
9---
10apiVersion: apps/v1
11kind: Deployment
12metadata:
13 name: upf-adapter
14 labels:
15{{ tuple "upfadapter" . | include "5g-control-plane.metadata_labels" | indent 4 }}
16spec:
17 replicas: 1
18 #serviceName: upfadapter-headless
19 selector:
20 matchLabels:
21{{ tuple "upfadapter" . | include "5g-control-plane.metadata_labels" | indent 6 }}
22 template:
23 metadata:
24 labels:
25{{ tuple "upfadapter" . | include "5g-control-plane.metadata_labels" | indent 8 }}
26 {{- with .Values.config.upfadapter.podAnnotations }}
27 annotations:
28 {{- toYaml . | nindent 8 }}
29 {{- end }}
30 spec:
31 serviceAccountName: upfadapter
32 {{- if hasKey .Values.images "pullSecrets" }}
33 imagePullSecrets:
34{{ toYaml .Values.images.pullSecrets | indent 8 }}
35 {{- end }}
36 containers:
37 - name: upfadapter
38 image: {{ .Values.images.tags.upfadapter }}
39 imagePullPolicy: {{ .Values.images.pullPolicy }}
40 {{- if .Values.config.coreDump.enabled }}
41 securityContext:
42 runAsUser: 0
43 {{- end }}
44 stdin: true
45 tty: true
46 command: ["/free5gc/script/upf-adapter-run.sh"]
47 env:
48 - name: POD_IP
49 valueFrom:
50 fieldRef:
51 fieldPath: status.podIP
52 {{- if .Values.resources.enabled }}
53 resources:
54{{ toYaml .Values.resources.upfadapter | indent 10 }}
55 {{- end }}
56 volumeMounts:
57 - name: run-script
58 mountPath: /free5gc/script/upf-adapter-run.sh
59 subPath: upf-adapter-run.sh
60 - name: upfadapter-config
61 mountPath: /free5gc/config
62 {{- if .Values.config.coreDump.enabled }}
63 - name: coredump
64 mountPath: /tmp/coredump
65 {{- end }}
66 volumes:
67 - name: run-script
68 configMap:
69 name: upf-adapter
70 defaultMode: 493
71 - name: upfadapter-config
72 configMap:
73 name: upf-adapter
74 defaultMode: 493
75 {{- if .Values.config.coreDump.enabled }}
76 - name: host-rootfs
77 hostPath:
78 path: /
79 - name: coredump
80 hostPath:
81 path: {{ .Values.config.coreDump.path }}
82 {{- end }}
83{{- end }}