blob: 2293c3bc1e6278e15195fca240dd5cafee63ba10 [file] [log] [blame]
Badhrinath987e1d82020-11-20 13:23:58 -06001{{/*
2# Copyright 2020-present Open Networking Foundation
3
4# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
5*/}}
6
7{{- if .Values.config.ausf.deploy }}
8{{ tuple "ausf" . | include "5g-control-plane.service_account" }}
9---
10apiVersion: apps/v1
11kind: StatefulSet
12metadata:
13 name: ausf
14 labels:
15{{ tuple "ausf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
16spec:
17 replicas: 1
18 serviceName: ausf-headless
19 selector:
20 matchLabels:
21{{ tuple "ausf" . | include "5g-control-plane.metadata_labels" | indent 6 }}
22 template:
23 metadata:
24 labels:
25{{ tuple "ausf" . | include "5g-control-plane.metadata_labels" | indent 8 }}
26 {{- with .Values.config.ausf.podAnnotations }}
27 annotations:
28 helm.sh/hook: pre-install
29 helm.sh/hook-weight: "5"
30 {{- toYaml . | nindent 8 }}
31 {{- end }}
32 spec:
33 {{- if .Values.nodeSelectors.enabled }}
34 nodeSelector:
35 {{ .Values.nodeSelectors.ausf.label }}: {{ .Values.nodeSelectors.ausf.value }}
36 {{- end }}
37 serviceAccountName: ausf
38 {{- if .Values.images.credentials }}
39 imagePullSecrets:
40 - name: {{ .Release.Name }}.registry
41 {{- end }}
42 initContainers:
43 - name: wait-nrf-module2
44 image: {{ .Values.images.tags.init | quote }}
45 imagePullPolicy: {{ .Values.images.pullPolicy }}
46 command: ['sh', '-c', 'until nslookup nrf; do echo waiting for nrf; sleep 4; done;']
47 {{- if .Values.config.coreDump.enabled }}
48{{ tuple "ausf" . | include "5g-control-plane.coredump_init" | indent 6 }}
49 {{- end }}
50 containers:
51 - name: ausf
52 image: {{ .Values.images.tags.ausf }}
53 imagePullPolicy: {{ .Values.images.pullPolicy }}
54 {{- if .Values.config.coreDump.enabled }}
55 securityContext:
56 runAsUser: 0
57 {{- end }}
58 stdin: true
59 tty: true
60 command: ["/opt/cp/scripts/ausf-run.sh"]
61 env:
62 - name: POD_IP
63 valueFrom:
64 fieldRef:
65 fieldPath: status.podIP
66 {{- if .Values.resources.enabled }}
67 resources:
68{{ toYaml .Values.resources.ausf | indent 10 }}
69 {{- end }}
70 volumeMounts:
71 - name: cp-script
72 mountPath: /opt/cp/scripts/ausf-run.sh
73 subPath: ausf-run.sh
74 - name: cp-config
75 mountPath: /free5gc/config
76 {{- if .Values.config.coreDump.enabled }}
77 - name: coredump
78 mountPath: /tmp/coredump
79 {{- end }}
80 volumes:
81 - name: cp-script
82 configMap:
83 name: ausf
84 defaultMode: 493
85 - name: cp-config
86 configMap:
87 name: ausf
88 defaultMode: 420
89 {{- if .Values.config.coreDump.enabled }}
90 - name: host-rootfs
91 hostPath:
92 path: /
93 - name: coredump
94 hostPath:
95 path: {{ .Values.config.coreDump.path }}
96 {{- end }}
97{{- end }}