| # Copyright 2019-present Open Networking Foundation |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| --- |
| apiVersion: v1 |
| kind: Service |
| metadata: |
| name: voltha-api |
| serviceAccountName: {{ .Values.serviceaccount }} |
| spec: |
| serviceAccountName: {{ .Values.serviceaccount }} |
| ports: |
| - name: grpc |
| port: 55555 |
| targetPort: 55555 |
| selector: |
| app: voltha-api-server |
| |
| --- |
| apiVersion: apps/v1beta1 |
| kind: Deployment |
| metadata: |
| name: voltha-api-server |
| serviceAccountName: {{ .Values.serviceaccount }} |
| {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "api_deployment_labels") }} |
| labels: |
| {{- if hasKey .Values "extra_deployment_labels" }} |
| {{- range $key, $val := .Values.extra_deployment_labels }} |
| {{ $key }}: {{ $val | quote }} |
| {{- end }} |
| {{- end }} |
| {{- if hasKey .Values "api_deployment_labels" }} |
| {{- range $key, $val := .Values.api_deployment_labels }} |
| {{ $key }}: {{ $val | quote }} |
| {{- end }} |
| {{- end }} |
| {{- end }} |
| spec: |
| replicas: {{ .Values.replicas.afrouter }} |
| template: |
| metadata: |
| labels: |
| app: voltha-api-server |
| app.kubernetes.io/name: "api-server" |
| app.kubernetes.io/version: {{ quote .Chart.AppVersion }} |
| app.kubernetes.io/component: "api" |
| app.kubernetes.io/part-of: "voltha" |
| app.kubernetes.io/managed-by: {{ quote .Release.Service }} |
| helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" |
| {{- if hasKey .Values "extra_pod_labels" }} |
| {{- range $key, $val := .Values.extra_pod_labels }} |
| {{ $key }}: {{ $val | quote }} |
| {{- end }} |
| {{- end }} |
| {{- if hasKey .Values "api_pod_labels" }} |
| {{- range $key, $val := .Values.api_pod_labels }} |
| {{ $key }}: {{ $val | quote }} |
| {{- end }} |
| {{- end }} |
| annotations: |
| cni: "calico" |
| spec: |
| serviceAccountName: {{ .Values.serviceaccount }} |
| containers: |
| - name: arouter |
| image: {{ tpl .Values.images.afrouter.registry . }}{{ tpl .Values.images.afrouter.repository . }}:{{ tpl ( tpl .Values.images.afrouter.tag . ) . }} |
| imagePullPolicy: {{ tpl .Values.images.afrouter.pullPolicy . }} |
| volumeMounts: |
| - name: config-volume |
| mountPath: /app/config |
| ports: |
| - containerPort: 55555 |
| env: |
| - name: POD_NAMESPACE |
| value: {{ .Release.Namespace }} |
| command: ["/app/afrouter"] |
| args: ["-config", "/app/config/arouter.voltha.json"] |
| - name: arouterd |
| env: |
| - name: POD_NAMESPACE |
| value: {{ .Release.Namespace }} |
| - name: KAFKA_HOST |
| value: {{ .Values.services.kafka.cluster.service }} |
| - name: KAFKA_PORT |
| value: {{ quote .Values.services.kafka.cluster.port }} |
| - name: KAFKA_TOPIC |
| value: {{ quote .Values.api_server.kafka_topic }} |
| image: {{ tpl .Values.images.afrouterd.registry . }}{{ tpl .Values.images.afrouterd.repository . }}:{{ tpl ( tpl .Values.images.afrouterd.tag . ) . }} |
| imagePullPolicy: {{ tpl .Values.images.afrouterd.pullPolicy . }} |
| command: ["/app/arouterd"] |
| restartPolicy: Always |
| volumes: |
| - name: config-volume |
| configMap: |
| name: afrouter-config |