blob: f463c1d21029eb9c6ac66062d8232652a43cb12b [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 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 }}
Matteo Scandoloc859a7b2018-09-10 10:13:45 -070064 - name: debugger
65 containerPort: {{ .Values.services.debugger.port }}
Andy Bavierf15d53a2018-03-07 17:34:30 -070066 resources:
67{{ toYaml .Values.resources | indent 12 }}
Andy Bavier67a6e7f2018-05-30 12:17:45 -070068 volumeMounts:
69 - name: node-key
70 mountPath: /root/vtn
71 readOnly: true
Zack Williams7a506d22018-09-24 17:00:13 -070072 - 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 }}
Andy Bavier67a6e7f2018-05-30 12:17:45 -070097 volumes:
98 - name: node-key
99 secret:
100 secretName: node-key
101 defaultMode: 256
102 optional: true
Matteo Scandolo55ff1502018-09-06 15:15:01 -0700103 - name: onos-logs-cfg
104 configMap:
105 name: onos
106 items:
107 - key: logCfg
108 path: org.ops4j.pax.logging.cfg
Zack Williams7a506d22018-09-24 17:00:13 -0700109 - 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 }}
Andy Bavierf15d53a2018-03-07 17:34:30 -0700120 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 }}
Zack Williams7a506d22018-09-24 17:00:13 -0700131{{- if .Values.log_agent.enabled }}
132{{- include "onos.log-agent-configmap" . }}
133{{- end }}