blob: 7c089e7fd498090d1dc4fca0ca81d383f50ddb53 [file] [log] [blame]
Doyoung Lee7102a812019-02-10 20:41:00 -08001---
2# 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 namespace: {{ .Values.namespace }}
21 labels:
22 app: {{ template "onos.name" . }}
23 chart: {{ template "onos.chart" . }}
24 release: {{ .Release.Name }}
25 heritage: {{ .Release.Service }}
26{{- if .Values.xos_service_label }}
27 xos_service: {{ .Values.xos_service_label }}
28{{- end }}
29spec:
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 }}
40{{- if .Values.xos_service_label }}
41 xos_service: {{ .Values.xos_service_label }}
42{{- end }}
43 spec:
44 serviceAccount: {{ .Values.serviceAccountName }}
45 serviceAccountName: {{ .Values.serviceAccountName }}
46 containers:
47 - name: {{ .Chart.Name }}
48 image: "{{ .Values.global.registry }}{{ .Values.images.onos.repository }}:{{ tpl .Values.images.onos.tag . }}"
49 imagePullPolicy: {{ .Values.images.onos.pullPolicy }}
Wei-Yu Chen07390f82019-02-12 16:46:54 -080050 command: ["./root/files/onos-1.7.0.cemturker/bin/onos-service", "server", "debug"]
Doyoung Lee7102a812019-02-10 20:41:00 -080051 env:
52{{ toYaml .Values.onos_env | indent 12 }}
53 ports:
54 - name: ovsdb
55 containerPort: {{ .Values.services.ovsdb.port }}
56 - name: openflow
57 containerPort: {{ .Values.services.openflow.port }}
58 - name: ssh
59 containerPort: {{ .Values.services.ssh.port }}
60 - name: ui
61 containerPort: {{ .Values.services.ui.port }}
62 - name: cluster
63 containerPort: {{ .Values.services.cluster.port }}
64 - name: debugger
65 containerPort: {{ .Values.services.debugger.port }}
66 resources:
67{{ toYaml .Values.resources | indent 12 }}
68 volumeMounts:
69 - name: node-key
70 mountPath: /root/vtn
71 readOnly: true
72 - name: onos-logs-cfg
73 mountPath: /root/onos/apache-karaf-3.0.8/etc/org.ops4j.pax.logging.cfg
74 subPath: org.ops4j.pax.logging.cfg
75 - name: onos-logs
76 mountPath: /root/onos/apache-karaf-3.0.8/data/log
77{{- if .Values.log_agent.enabled }}
78 - name: {{ .Chart.Name }}-log-agent
79 image: "{{ .Values.global.registry }}{{ .Values.images.log_agent.repository }}:{{ .Values.images.log_agent.tag }}"
80 imagePullPolicy: {{ .Values.images.log_agent.pullPolicy }}
81 args: [ "-c", "/conf/filebeat.yml", "-e" ]
82 env:
83 - name: POD_NAMESPACE
84 valueFrom:
85 fieldRef:
86 fieldPath: metadata.namespace
87 - name: NODE_NAME
88 valueFrom:
89 fieldRef:
90 fieldPath: spec.nodeName
91 volumeMounts:
92 - name: onos-logs
93 mountPath: /onos_logs
94 - name: log-agent-configmap-volume
95 mountPath: /conf
96{{- end }}
97 volumes:
98 - name: node-key
99 secret:
100 secretName: node-key
101 defaultMode: 256
102 optional: true
103 - name: onos-logs-cfg
104 configMap:
Wei-Yu Chen2d2b3162019-02-12 14:38:35 -0800105 name: onos-progran
Doyoung Lee7102a812019-02-10 20:41:00 -0800106 items:
107 - key: logCfg
108 path: org.ops4j.pax.logging.cfg
109 - name: onos-logs
110 emptyDir: {}
111{{- if .Values.log_agent.enabled }}
112 - name: log-agent-configmap-volume
113 configMap:
114 name: log-agent-configmap
115 items:
116 - key: config
117 path: filebeat.yml
118{{- end }}
119{{- with .Values.nodeSelector }}
120 nodeSelector:
121{{ toYaml . | indent 8 }}
122 {{- end }}
123 {{- with .Values.affinity }}
124 affinity:
125{{ toYaml . | indent 8 }}
126 {{- end }}
127 {{- with .Values.tolerations }}
128 tolerations:
129{{ toYaml . | indent 8 }}
130 {{- end }}
131{{- if .Values.log_agent.enabled }}
132{{- include "onos.log-agent-configmap" . }}
133{{- end }}
134