blob: fc6c014c7b8a967d3a5b3ec4b1959b56b35c6e56 [file] [log] [blame]
Andy Bavierf15d53a2018-03-07 17:34:30 -07001---
Andy Bavierf15d53a2018-03-07 17:34:30 -07002# Copyright 2018-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16apiVersion: apps/v1beta2
17kind: Deployment
18metadata:
19 name: {{ template "onos.fullname" . }}
20 labels:
21 app: {{ template "onos.name" . }}
22 chart: {{ template "onos.chart" . }}
23 release: {{ .Release.Name }}
24 heritage: {{ .Release.Service }}
Scott Baker900343a2018-08-09 17:03:16 -070025{{- if .Values.xos_service_label }}
26 xos_service: {{ .Values.xos_service_label }}
27{{- end }}
Andy Bavierf15d53a2018-03-07 17:34:30 -070028spec:
29 replicas: {{ .Values.replicaCount }}
30 selector:
31 matchLabels:
32 app: {{ template "onos.name" . }}
33 release: {{ .Release.Name }}
34 template:
35 metadata:
36 labels:
37 app: {{ template "onos.name" . }}
38 release: {{ .Release.Name }}
Scott Baker900343a2018-08-09 17:03:16 -070039{{- if .Values.xos_service_label }}
40 xos_service: {{ .Values.xos_service_label }}
41{{- end }}
Andy Bavierf15d53a2018-03-07 17:34:30 -070042 spec:
Gopinath Tagetfff89342018-04-16 12:12:17 -070043 serviceAccount: {{ .Values.serviceAccountName }}
44 serviceAccountName: {{ .Values.serviceAccountName }}
Andy Bavierf15d53a2018-03-07 17:34:30 -070045 containers:
46 - name: {{ .Chart.Name }}
Zack Williams2749ae52018-09-28 09:43:43 -070047 image: "{{ .Values.global.registry }}{{ .Values.images.onos.repository }}:{{ tpl .Values.images.onos.tag . }}"
48 imagePullPolicy: {{ .Values.images.onos.pullPolicy }}
Matteo Scandoloc859a7b2018-09-10 10:13:45 -070049 command: ["./bin/onos-service", "server", "debug"]
Gopinath Tagetfff89342018-04-16 12:12:17 -070050 env:
51{{ toYaml .Values.onos_env | indent 12 }}
Andy Bavierf15d53a2018-03-07 17:34:30 -070052 resources:
53{{ toYaml .Values.resources | indent 12 }}
Andy Bavier67a6e7f2018-05-30 12:17:45 -070054 volumeMounts:
55 - name: node-key
56 mountPath: /root/vtn
57 readOnly: true
Zack Williams7a506d22018-09-24 17:00:13 -070058 - name: onos-logs-cfg
59 mountPath: /root/onos/apache-karaf-3.0.8/etc/org.ops4j.pax.logging.cfg
60 subPath: org.ops4j.pax.logging.cfg
61 - name: onos-logs
62 mountPath: /root/onos/apache-karaf-3.0.8/data/log
63{{- if .Values.log_agent.enabled }}
64 - name: {{ .Chart.Name }}-log-agent
65 image: "{{ .Values.global.registry }}{{ .Values.images.log_agent.repository }}:{{ .Values.images.log_agent.tag }}"
66 imagePullPolicy: {{ .Values.images.log_agent.pullPolicy }}
67 args: [ "-c", "/conf/filebeat.yml", "-e" ]
68 env:
69 - name: POD_NAMESPACE
70 valueFrom:
71 fieldRef:
72 fieldPath: metadata.namespace
73 - name: NODE_NAME
74 valueFrom:
75 fieldRef:
76 fieldPath: spec.nodeName
77 volumeMounts:
78 - name: onos-logs
79 mountPath: /onos_logs
80 - name: log-agent-configmap-volume
81 mountPath: /conf
82{{- end }}
Andy Bavier67a6e7f2018-05-30 12:17:45 -070083 volumes:
84 - name: node-key
85 secret:
86 secretName: node-key
87 defaultMode: 256
88 optional: true
Matteo Scandolo55ff1502018-09-06 15:15:01 -070089 - name: onos-logs-cfg
90 configMap:
Hyunsun Moon90c60502019-10-19 14:46:41 -060091 name: {{ template "onos.fullname" . }}-onos
Matteo Scandolo55ff1502018-09-06 15:15:01 -070092 items:
93 - key: logCfg
94 path: org.ops4j.pax.logging.cfg
Zack Williams7a506d22018-09-24 17:00:13 -070095 - name: onos-logs
96 emptyDir: {}
97{{- if .Values.log_agent.enabled }}
98 - name: log-agent-configmap-volume
99 configMap:
Hyunsun Moon90c60502019-10-19 14:46:41 -0600100 name: {{ template "onos.fullname" . }}-log-agent-configmap
Zack Williams7a506d22018-09-24 17:00:13 -0700101 items:
102 - key: config
103 path: filebeat.yml
104{{- end }}
105{{- with .Values.nodeSelector }}
Andy Bavierf15d53a2018-03-07 17:34:30 -0700106 nodeSelector:
107{{ toYaml . | indent 8 }}
108 {{- end }}
109 {{- with .Values.affinity }}
110 affinity:
111{{ toYaml . | indent 8 }}
112 {{- end }}
113 {{- with .Values.tolerations }}
114 tolerations:
115{{ toYaml . | indent 8 }}
116 {{- end }}
Zack Williams7a506d22018-09-24 17:00:13 -0700117{{- if .Values.log_agent.enabled }}
118{{- include "onos.log-agent-configmap" . }}
119{{- end }}