Andy Bavier | f15d53a | 2018-03-07 17:34:30 -0700 | [diff] [blame] | 1 | --- |
Andy Bavier | f15d53a | 2018-03-07 17:34:30 -0700 | [diff] [blame] | 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 | |
| 16 | apiVersion: apps/v1beta2 |
| 17 | kind: Deployment |
| 18 | metadata: |
| 19 | name: {{ template "onos.fullname" . }} |
Gopinath Taget | fff8934 | 2018-04-16 12:12:17 -0700 | [diff] [blame] | 20 | namespace: {{ .Values.namespace }} |
Andy Bavier | f15d53a | 2018-03-07 17:34:30 -0700 | [diff] [blame] | 21 | labels: |
| 22 | app: {{ template "onos.name" . }} |
| 23 | chart: {{ template "onos.chart" . }} |
| 24 | release: {{ .Release.Name }} |
| 25 | heritage: {{ .Release.Service }} |
Scott Baker | 900343a | 2018-08-09 17:03:16 -0700 | [diff] [blame] | 26 | {{- if .Values.xos_service_label }} |
| 27 | xos_service: {{ .Values.xos_service_label }} |
| 28 | {{- end }} |
Andy Bavier | f15d53a | 2018-03-07 17:34:30 -0700 | [diff] [blame] | 29 | spec: |
| 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 Baker | 900343a | 2018-08-09 17:03:16 -0700 | [diff] [blame] | 40 | {{- if .Values.xos_service_label }} |
| 41 | xos_service: {{ .Values.xos_service_label }} |
| 42 | {{- end }} |
Andy Bavier | f15d53a | 2018-03-07 17:34:30 -0700 | [diff] [blame] | 43 | spec: |
Gopinath Taget | fff8934 | 2018-04-16 12:12:17 -0700 | [diff] [blame] | 44 | serviceAccount: {{ .Values.serviceAccountName }} |
| 45 | serviceAccountName: {{ .Values.serviceAccountName }} |
Andy Bavier | f15d53a | 2018-03-07 17:34:30 -0700 | [diff] [blame] | 46 | containers: |
| 47 | - name: {{ .Chart.Name }} |
Zack Williams | 2749ae5 | 2018-09-28 09:43:43 -0700 | [diff] [blame] | 48 | image: "{{ .Values.global.registry }}{{ .Values.images.onos.repository }}:{{ tpl .Values.images.onos.tag . }}" |
| 49 | imagePullPolicy: {{ .Values.images.onos.pullPolicy }} |
Matteo Scandolo | c859a7b | 2018-09-10 10:13:45 -0700 | [diff] [blame] | 50 | command: ["./bin/onos-service", "server", "debug"] |
Gopinath Taget | fff8934 | 2018-04-16 12:12:17 -0700 | [diff] [blame] | 51 | env: |
| 52 | {{ toYaml .Values.onos_env | indent 12 }} |
Andy Bavier | f15d53a | 2018-03-07 17:34:30 -0700 | [diff] [blame] | 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 }} |
Matteo Scandolo | c859a7b | 2018-09-10 10:13:45 -0700 | [diff] [blame] | 64 | - name: debugger |
| 65 | containerPort: {{ .Values.services.debugger.port }} |
Andy Bavier | f15d53a | 2018-03-07 17:34:30 -0700 | [diff] [blame] | 66 | resources: |
| 67 | {{ toYaml .Values.resources | indent 12 }} |
Andy Bavier | 67a6e7f | 2018-05-30 12:17:45 -0700 | [diff] [blame] | 68 | volumeMounts: |
| 69 | - name: node-key |
| 70 | mountPath: /root/vtn |
| 71 | readOnly: true |
Zack Williams | 7a506d2 | 2018-09-24 17:00:13 -0700 | [diff] [blame] | 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 }} |
Andy Bavier | 67a6e7f | 2018-05-30 12:17:45 -0700 | [diff] [blame] | 97 | volumes: |
| 98 | - name: node-key |
| 99 | secret: |
| 100 | secretName: node-key |
| 101 | defaultMode: 256 |
| 102 | optional: true |
Matteo Scandolo | 55ff150 | 2018-09-06 15:15:01 -0700 | [diff] [blame] | 103 | - name: onos-logs-cfg |
| 104 | configMap: |
| 105 | name: onos |
| 106 | items: |
| 107 | - key: logCfg |
| 108 | path: org.ops4j.pax.logging.cfg |
Zack Williams | 7a506d2 | 2018-09-24 17:00:13 -0700 | [diff] [blame] | 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 }} |
Andy Bavier | f15d53a | 2018-03-07 17:34:30 -0700 | [diff] [blame] | 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 }} |
Zack Williams | 7a506d2 | 2018-09-24 17:00:13 -0700 | [diff] [blame] | 131 | {{- if .Values.log_agent.enabled }} |
| 132 | {{- include "onos.log-agent-configmap" . }} |
| 133 | {{- end }} |