David Bainbridge | 8595b3b | 2020-06-05 12:23:05 -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. |
| 14 | --- |
| 15 | apiVersion: apps/v1 |
| 16 | kind: Deployment |
| 17 | metadata: |
David Bainbridge | 2bdd430 | 2020-06-09 17:13:18 -0700 | [diff] [blame] | 18 | name: "{{ template "fullname" . }}-olt" |
David Bainbridge | 8595b3b | 2020-06-05 12:23:05 -0700 | [diff] [blame] | 19 | namespace: {{ .Release.Namespace }} |
| 20 | {{- if or (hasKey .Values "extra_deployment_labels") (hasKey .Values "simolt_deployment_labels") }} |
| 21 | labels: |
| 22 | {{- if hasKey .Values "extra_deployment_labels" }} |
| 23 | {{- range $key, $val := .Values.extra_deployment_labels }} |
| 24 | {{ $key }}: {{ $val | quote }} |
| 25 | {{- end }} |
| 26 | {{- end }} |
| 27 | {{- if hasKey .Values "simolt_deployment_labels" }} |
| 28 | {{- range $key, $val := .Values.simolt_deployment_labels }} |
| 29 | {{ $key }}: {{ $val | quote }} |
| 30 | {{- end }} |
| 31 | {{- end }} |
| 32 | {{- end }} |
| 33 | spec: |
| 34 | replicas: {{ .Values.replicas.adapter_simulated_olt }} |
| 35 | selector: |
| 36 | matchLabels: |
| 37 | app: adapter-simulated-olt |
| 38 | release: {{ .Release.Name }} |
| 39 | template: |
| 40 | metadata: |
| 41 | namespace: {{ .Release.Namespace }} |
| 42 | labels: |
| 43 | app: adapter-simulated-olt |
| 44 | release: {{ .Release.Name }} |
| 45 | app.kubernetes.io/name: "adapter-simulated-olt" |
| 46 | app.kubernetes.io/version: {{ quote .Chart.AppVersion }} |
| 47 | app.kubernetes.io/component: "adapter" |
| 48 | app.kubernetes.io/part-of: "voltha" |
| 49 | app.kubernetes.io/managed-by: {{ quote .Release.Service }} |
| 50 | helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" |
| 51 | {{- if hasKey .Values "extra_pod_labels" }} |
| 52 | {{- range $key, $val := .Values.extra_pod_labels }} |
| 53 | {{ $key }}: {{ $val | quote }} |
| 54 | {{- end }} |
| 55 | {{- end }} |
| 56 | {{- if hasKey .Values "simolt_pod_labels" }} |
| 57 | {{- range $key, $val := .Values.simolt_pod_labels }} |
| 58 | {{ $key }}: {{ $val | quote }} |
| 59 | {{- end }} |
| 60 | {{- end }} |
| 61 | spec: |
| 62 | {{- if .Values.securityContext.enabled }} |
| 63 | securityContext: |
| 64 | runAsUser: {{ .Values.securityContext.runAsUser }} |
| 65 | runAsGroup: {{ .Values.securityContext.runAsGroup }} |
| 66 | fsGroup: {{ .Values.securityContext.fsGroup }} |
| 67 | {{- end }} |
| 68 | containers: |
| 69 | - name: adapter-simulated-olt |
| 70 | image: '{{ tpl .Values.images.adapter_simulated_olt.registry . }}{{ tpl .Values.images.adapter_simulated_olt.repository . }}:{{ tpl .Values.images.adapter_simulated_olt.tag . }}' |
| 71 | imagePullPolicy: {{ tpl .Values.images.adapter_simulated_olt.pullPolicy . }} |
| 72 | args: |
| 73 | - "/app/simulated_olt" |
| 74 | - "-kafka_adapter_host={{ .Values.services.kafka.adapter.service }}" |
| 75 | - "-kafka_adapter_port={{ .Values.services.kafka.adapter.port }}" |
| 76 | - "-kafka_cluster_host={{ .Values.services.kafka.cluster.service }}" |
| 77 | - "-kafka_cluster_port={{ .Values.services.kafka.cluster.port }}" |
| 78 | - "-kv_store_host={{ .Values.services.etcd.service }}" |
| 79 | - "-kv_store_port={{ .Values.services.etcd.port }}" |
| 80 | - "-core_topic=rwcore" |
| 81 | - "-simulator_topic=simulated_olt" |
| 82 | - "-onu_number={{ .Values.onus_per_pon_port }}" |
| 83 | - "-probe_port=8080" |
| 84 | livenessProbe: |
| 85 | httpGet: |
| 86 | path: /healthz |
| 87 | port: 8080 |
| 88 | initialDelaySeconds: 10 |
| 89 | periodSeconds: 5 |
| 90 | readinessProbe: |
| 91 | httpGet: |
| 92 | path: /readz |
| 93 | port: 8080 |
| 94 | initialDelaySeconds: 10 |
| 95 | periodSeconds: 5 |