David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 1 | # Copyright 2019-present Open Networking Foundation |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
David Bainbridge | e588707 | 2019-11-14 23:01:01 +0000 | [diff] [blame] | 14 | {{- if not .Values.therecanbeonlyone }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 15 | --- |
| 16 | apiVersion: v1 |
| 17 | kind: Service |
| 18 | metadata: |
| 19 | name: voltha-api |
| 20 | serviceAccountName: {{ .Values.serviceaccount }} |
| 21 | spec: |
| 22 | serviceAccountName: {{ .Values.serviceaccount }} |
| 23 | ports: |
| 24 | - name: grpc |
| 25 | port: 55555 |
| 26 | targetPort: 55555 |
| 27 | selector: |
| 28 | app: voltha-api-server |
| 29 | |
| 30 | --- |
| 31 | apiVersion: apps/v1beta1 |
| 32 | kind: Deployment |
| 33 | metadata: |
| 34 | name: voltha-api-server |
| 35 | serviceAccountName: {{ .Values.serviceaccount }} |
David Bainbridge | 534a73d | 2019-08-30 18:57:23 +0000 | [diff] [blame] | 36 | {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "api_deployment_labels") }} |
| 37 | labels: |
| 38 | {{- if hasKey .Values "extra_deployment_labels" }} |
| 39 | {{- range $key, $val := .Values.extra_deployment_labels }} |
| 40 | {{ $key }}: {{ $val | quote }} |
| 41 | {{- end }} |
| 42 | {{- end }} |
| 43 | {{- if hasKey .Values "api_deployment_labels" }} |
| 44 | {{- range $key, $val := .Values.api_deployment_labels }} |
| 45 | {{ $key }}: {{ $val | quote }} |
| 46 | {{- end }} |
| 47 | {{- end }} |
| 48 | {{- end }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 49 | spec: |
| 50 | replicas: {{ .Values.replicas.afrouter }} |
| 51 | template: |
| 52 | metadata: |
| 53 | labels: |
| 54 | app: voltha-api-server |
David Bainbridge | 1f88804 | 2019-06-24 18:02:01 +0000 | [diff] [blame] | 55 | app.kubernetes.io/name: "api-server" |
| 56 | app.kubernetes.io/version: {{ quote .Chart.AppVersion }} |
| 57 | app.kubernetes.io/component: "api" |
| 58 | app.kubernetes.io/part-of: "voltha" |
| 59 | app.kubernetes.io/managed-by: {{ quote .Release.Service }} |
| 60 | helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" |
David Bainbridge | 534a73d | 2019-08-30 18:57:23 +0000 | [diff] [blame] | 61 | {{- if hasKey .Values "extra_pod_labels" }} |
| 62 | {{- range $key, $val := .Values.extra_pod_labels }} |
| 63 | {{ $key }}: {{ $val | quote }} |
| 64 | {{- end }} |
| 65 | {{- end }} |
| 66 | {{- if hasKey .Values "api_pod_labels" }} |
| 67 | {{- range $key, $val := .Values.api_pod_labels }} |
| 68 | {{ $key }}: {{ $val | quote }} |
| 69 | {{- end }} |
| 70 | {{- end }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 71 | annotations: |
| 72 | cni: "calico" |
| 73 | spec: |
| 74 | serviceAccountName: {{ .Values.serviceaccount }} |
| 75 | containers: |
| 76 | - name: arouter |
David Bainbridge | 03706e6 | 2019-10-18 17:59:24 +0000 | [diff] [blame] | 77 | image: '{{ tpl .Values.images.afrouter.registry . }}{{ tpl .Values.images.afrouter.repository . }}:{{ tpl .Values.images.afrouter.tag . }}' |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 78 | imagePullPolicy: {{ tpl .Values.images.afrouter.pullPolicy . }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 79 | volumeMounts: |
| 80 | - name: config-volume |
| 81 | mountPath: /app/config |
| 82 | ports: |
| 83 | - containerPort: 55555 |
| 84 | env: |
| 85 | - name: POD_NAMESPACE |
| 86 | value: {{ .Release.Namespace }} |
| 87 | command: ["/app/afrouter"] |
divyadesai | 9882a39 | 2019-11-18 11:43:34 +0000 | [diff] [blame] | 88 | livenessProbe: |
| 89 | httpGet: |
| 90 | path: /healthz |
| 91 | port: 8080 |
| 92 | initialDelaySeconds: 10 |
| 93 | periodSeconds: 5 |
| 94 | readinessProbe: |
| 95 | httpGet: |
| 96 | path: /readz |
| 97 | port: 8080 |
| 98 | initialDelaySeconds: 10 |
| 99 | periodSeconds: 5 |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 100 | args: ["-config", "/app/config/arouter.voltha.json"] |
| 101 | - name: arouterd |
| 102 | env: |
| 103 | - name: POD_NAMESPACE |
| 104 | value: {{ .Release.Namespace }} |
A R Karthick | 0aced4f | 2019-09-05 20:08:36 +0000 | [diff] [blame] | 105 | - name: KAFKA_HOST |
| 106 | value: {{ .Values.services.kafka.cluster.service }} |
| 107 | - name: KAFKA_PORT |
| 108 | value: {{ quote .Values.services.kafka.cluster.port }} |
A R Karthick | c3b2df9 | 2019-09-30 23:22:38 +0000 | [diff] [blame] | 109 | - name: KAFKA_TOPIC |
| 110 | value: {{ quote .Values.api_server.kafka_topic }} |
David Bainbridge | 03706e6 | 2019-10-18 17:59:24 +0000 | [diff] [blame] | 111 | image: '{{ tpl .Values.images.afrouterd.registry . }}{{ tpl .Values.images.afrouterd.repository . }}:{{ tpl .Values.images.afrouterd.tag . }}' |
David Bainbridge | cd30e54 | 2019-05-31 20:52:56 +0000 | [diff] [blame] | 112 | imagePullPolicy: {{ tpl .Values.images.afrouterd.pullPolicy . }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 113 | command: ["/app/arouterd"] |
divyadesai | 9882a39 | 2019-11-18 11:43:34 +0000 | [diff] [blame] | 114 | livenessProbe: |
| 115 | httpGet: |
| 116 | path: /healthz |
| 117 | port: 8081 |
| 118 | initialDelaySeconds: 10 |
| 119 | periodSeconds: 5 |
| 120 | readinessProbe: |
| 121 | httpGet: |
| 122 | path: /readz |
| 123 | port: 8081 |
| 124 | initialDelaySeconds: 10 |
| 125 | periodSeconds: 5 |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 126 | restartPolicy: Always |
| 127 | volumes: |
| 128 | - name: config-volume |
| 129 | configMap: |
| 130 | name: afrouter-config |
David Bainbridge | e588707 | 2019-11-14 23:01:01 +0000 | [diff] [blame] | 131 | {{- end }} |