blob: e381db664f9c0903d428805b1bb47f71a621f720 [file] [log] [blame]
Scott Bakerc9d3d842021-09-17 11:32:53 -07001# SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
2#
3# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
4
5apiVersion: apps/v1
6kind: Deployment
7metadata:
8 name: {{ template "sdcore-adapter.fullname" . }}
9 namespace: {{ .Release.Namespace }}
10 labels:
11 name: {{ template "sdcore-adapter.fullname" . }}
12spec:
13 replicas: {{ .Values.replicaCount }}
14 selector:
15 matchLabels:
16 {{- include "sdcore-adapter.selectorLabels" . | nindent 6 }}
17 template:
18 metadata:
19 labels:
20 name: {{ template "sdcore-adapter.fullname" . }}
21 {{- include "sdcore-adapter.selectorLabels" . | nindent 8 }}
22 spec:
23 {{- with .Values.imagePullSecrets }}
24 imagePullSecrets:
25 {{- toYaml . | nindent 6 }}
26 {{- end }}
27 securityContext:
28 {{- toYaml .Values.podSecurityContext | nindent 8 }}
29 containers:
30 - name: {{ .Chart.Name }}
31 image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
32 imagePullPolicy: {{ .Values.image.pullPolicy }}
33 env:
34 - name: POD_NAMESPACE
35 valueFrom:
36 fieldRef:
37 fieldPath: metadata.namespace
38 - name: POD_NAME
39 valueFrom:
40 fieldRef:
41 fieldPath: metadata.name
42 - name: NODE_NAME
43 valueFrom:
44 fieldRef:
45 fieldPath: spec.nodeName
46 args:
47 - "/usr/local/bin/sdcore-adapter"
48 - "-bind_address=:{{ .Values.ports.gnmi.secure }}"
49 - "-key=/etc/sdcore-adapter/certs/tls.key"
50 - "-cert=/etc/sdcore-adapter/certs/tls.crt"
51 - "-ca=/etc/sdcore-adapter/certs/tls.cacert"
52 - "-alsologtostderr"
53 - "-hostCheckDisabled"
54 - "-model_version={{ .Values.model.version }}"
55 {{ if .Values.initialConfig }}
56 - "-config={{ .Values.initialConfig }}"
57 {{ end }}
58 {{ if .Values.output }}
59 - "-output={{ .Values.output }}"
60 {{ end }}
61 {{ if .Values.spgwEndpoint }}
62 - "-spgw_endpoint={{ .Values.spgwEndpoint }}"
63 {{ end }}
64 ports:
65 {{- range $key, $port := .Values.ports.gnmi }}
66 - name: gnmi{{ $key }}
67 containerPort: {{ $port }}
68 {{- end}}
69 readinessProbe:
70 tcpSocket:
71 port: {{ .Values.ports.gnmi.secure }}
72 initialDelaySeconds: 5
73 periodSeconds: 10
74 livenessProbe:
75 tcpSocket:
76 port: {{ .Values.ports.gnmi.secure }}
77 initialDelaySeconds: 15
78 periodSeconds: 20
79 volumeMounts:
80 - name: targetconfig
81 mountPath: /etc/sdcore-adapter/configs
82 readOnly: true
83 - name: secret
84 mountPath: /etc/sdcore-adapter/certs
85 readOnly: true
86 - name: logconfig
87 mountPath: /etc/onos/config
88 readOnly: true
89 - name: {{ .Chart.Name }}-exporter
90 image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
91 imagePullPolicy: {{ .Values.image.pullPolicy }}
92 env:
93 - name: POD_NAMESPACE
94 valueFrom:
95 fieldRef:
96 fieldPath: metadata.namespace
97 - name: POD_NAME
98 valueFrom:
99 fieldRef:
100 fieldPath: metadata.name
101 - name: NODE_NAME
102 valueFrom:
103 fieldRef:
104 fieldPath: spec.nodeName
105 args:
106 - "/usr/local/bin/sdcore-exporter"
107 ports:
108 - name: metrics
109 containerPort: 2112
110 readinessProbe:
111 httpGet:
112 path: /metrics
113 port: 2112
114 initialDelaySeconds: 5
115 periodSeconds: 10
116 livenessProbe:
117 httpGet:
118 path: /metrics
119 port: 2112
120 initialDelaySeconds: 15
121 periodSeconds: 20
122 volumes:
123 - name: logconfig
124 configMap:
125 name: {{ template "sdcore-adapter.fullname" . }}-logconfig
126 - name: targetconfig
127 configMap:
128 name: {{ template "sdcore-adapter.fullname" . }}-targetconfig
129 - name: secret
130 secret:
131 secretName: {{ template "sdcore-adapter.fullname" . }}-secret