blob: 499a8215ec81e665fef2c1b03d785d3217b355d6 [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" . }}
Gopinath Tagetfff89342018-04-16 12:12:17 -070020 namespace: {{ .Values.namespace }}
Andy Bavierf15d53a2018-03-07 17:34:30 -070021 labels:
22 app: {{ template "onos.name" . }}
23 chart: {{ template "onos.chart" . }}
24 release: {{ .Release.Name }}
25 heritage: {{ .Release.Service }}
Scott Baker900343a2018-08-09 17:03:16 -070026{{- if .Values.xos_service_label }}
27 xos_service: {{ .Values.xos_service_label }}
28{{- end }}
Andy Bavierf15d53a2018-03-07 17:34:30 -070029spec:
30 replicas: {{ .Values.replicaCount }}
31 selector:
32 matchLabels:
33 app: {{ template "onos.name" . }}
34 release: {{ .Release.Name }}
35 template:
36 metadata:
37 labels:
38 app: {{ template "onos.name" . }}
39 release: {{ .Release.Name }}
Scott Baker900343a2018-08-09 17:03:16 -070040{{- if .Values.xos_service_label }}
41 xos_service: {{ .Values.xos_service_label }}
42{{- end }}
Andy Bavierf15d53a2018-03-07 17:34:30 -070043 spec:
Gopinath Tagetfff89342018-04-16 12:12:17 -070044 serviceAccount: {{ .Values.serviceAccountName }}
45 serviceAccountName: {{ .Values.serviceAccountName }}
Andy Bavierf15d53a2018-03-07 17:34:30 -070046 containers:
47 - name: {{ .Chart.Name }}
Zack Williams2749ae52018-09-28 09:43:43 -070048 image: "{{ .Values.global.registry }}{{ .Values.images.onos.repository }}:{{ tpl .Values.images.onos.tag . }}"
49 imagePullPolicy: {{ .Values.images.onos.pullPolicy }}
Matteo Scandoloc859a7b2018-09-10 10:13:45 -070050 command: ["./bin/onos-service", "server", "debug"]
Gopinath Tagetfff89342018-04-16 12:12:17 -070051 env:
52{{ toYaml .Values.onos_env | indent 12 }}
Andy Bavierf15d53a2018-03-07 17:34:30 -070053 resources:
54{{ toYaml .Values.resources | indent 12 }}
Andy Bavier67a6e7f2018-05-30 12:17:45 -070055 volumeMounts:
56 - name: node-key
57 mountPath: /root/vtn
58 readOnly: true
Zack Williams7a506d22018-09-24 17:00:13 -070059 - name: onos-logs-cfg
60 mountPath: /root/onos/apache-karaf-3.0.8/etc/org.ops4j.pax.logging.cfg
61 subPath: org.ops4j.pax.logging.cfg
62 - name: onos-logs
63 mountPath: /root/onos/apache-karaf-3.0.8/data/log
64{{- if .Values.log_agent.enabled }}
65 - name: {{ .Chart.Name }}-log-agent
66 image: "{{ .Values.global.registry }}{{ .Values.images.log_agent.repository }}:{{ .Values.images.log_agent.tag }}"
67 imagePullPolicy: {{ .Values.images.log_agent.pullPolicy }}
68 args: [ "-c", "/conf/filebeat.yml", "-e" ]
69 env:
70 - name: POD_NAMESPACE
71 valueFrom:
72 fieldRef:
73 fieldPath: metadata.namespace
74 - name: NODE_NAME
75 valueFrom:
76 fieldRef:
77 fieldPath: spec.nodeName
78 volumeMounts:
79 - name: onos-logs
80 mountPath: /onos_logs
81 - name: log-agent-configmap-volume
82 mountPath: /conf
83{{- end }}
Andy Bavier67a6e7f2018-05-30 12:17:45 -070084 volumes:
85 - name: node-key
86 secret:
87 secretName: node-key
88 defaultMode: 256
89 optional: true
Matteo Scandolo55ff1502018-09-06 15:15:01 -070090 - name: onos-logs-cfg
91 configMap:
Hyunsun Moon90c60502019-10-19 14:46:41 -060092 name: {{ template "onos.fullname" . }}-onos
Matteo Scandolo55ff1502018-09-06 15:15:01 -070093 items:
94 - key: logCfg
95 path: org.ops4j.pax.logging.cfg
Zack Williams7a506d22018-09-24 17:00:13 -070096 - name: onos-logs
97 emptyDir: {}
98{{- if .Values.log_agent.enabled }}
99 - name: log-agent-configmap-volume
100 configMap:
Hyunsun Moon90c60502019-10-19 14:46:41 -0600101 name: {{ template "onos.fullname" . }}-log-agent-configmap
Zack Williams7a506d22018-09-24 17:00:13 -0700102 items:
103 - key: config
104 path: filebeat.yml
105{{- end }}
106{{- with .Values.nodeSelector }}
Andy Bavierf15d53a2018-03-07 17:34:30 -0700107 nodeSelector:
108{{ toYaml . | indent 8 }}
109 {{- end }}
110 {{- with .Values.affinity }}
111 affinity:
112{{ toYaml . | indent 8 }}
113 {{- end }}
114 {{- with .Values.tolerations }}
115 tolerations:
116{{ toYaml . | indent 8 }}
117 {{- end }}
Zack Williams7a506d22018-09-24 17:00:13 -0700118{{- if .Values.log_agent.enabled }}
119{{- include "onos.log-agent-configmap" . }}
120{{- end }}