[VOL-1615] Create VOLTHA 2.0 Helm Charts
Squashed version of David Bainbridge's patches at commit:
https://github.com/ciena/voltha-helm-charts/commit/120fb4b719e0492e6a0a24cc78d08b806e3698fa
Linted the README, fixed whitespace and incubator repo address
Change-Id: I7c5b1c3478450bbefbed09a75e9029e6371cae3a
diff --git a/voltha/templates/rw-core.yaml b/voltha/templates/rw-core.yaml
new file mode 100644
index 0000000..4dd0e06
--- /dev/null
+++ b/voltha/templates/rw-core.yaml
@@ -0,0 +1,95 @@
+# 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.
+
+{{- $root := . -}}
+{{- $count := mul .Values.replicas.rw_core 2 | int }}
+{{- $tag := tpl .Values.images.rw_core.tag . }}
+{{- range $i, $e := until $count }}
+{{- $core_idx := add $i 1 }}
+{{- $pair_idx := div $i 2 | int }}
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: rw-core{{ $core_idx }}
+ serviceAccountName: {{ $root.Values.serviceaccount }}
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ app: rw-core
+ template:
+ metadata:
+ labels:
+ app: rw-core
+ affinity-index: anti-affinity-{{ $pair_idx }}
+ annotations:
+ cni: "calico"
+ spec:
+ affinity:
+ podAntiAffinity:
+ requiredDuringSchedulingIgnoredDuringExecution:
+ - labelSelector:
+ matchExpressions:
+ - key: affinity-index
+ operator: In
+ values:
+ - anti-affinity-{{ $pair_idx }}
+ topologyKey: "kubernetes.io/hostname"
+ serviceAccountName: {{ $root.Values.serviceaccount }}
+ containers:
+ - name: voltha
+ image: {{ $root.Values.registry }}{{ $root.Values.images.rw_core.repository }}:{{ $tag }}
+ imagePullPolicy: {{ $root.Values.images.rw_core.pullPolicy }}
+ env:
+ - name: NAMESPACE
+ value: {{ quote $root.Release.Namespace }}
+ - name: POD_IP
+ valueFrom:
+ fieldRef:
+ fieldPath: status.podIP
+ - name: ETCD_SERVICE
+ value: {{ quote $root.Values.services.etcd.service }}
+ - name: ETCD_SERVICE_PORT
+ value: {{ quote $root.Values.services.etcd.port }}
+ - name: ADAPTER_KAFKA_SERVICE
+ value: {{ quote $root.Values.services.kafka.adapter.service }}
+ - name: ADAPTER_KAFKA_SERVICE_PORT
+ value: {{ quote $root.Values.services.kafka.adapter.port }}
+ - name: CLUSTER_KAFKA_SERVICE
+ value: {{ quote $root.Values.services.kafka.cluster.service }}
+ - name: CLUSTER_KAFKA_SERVICE_PORT
+ value: {{ quote $root.Values.services.kafka.cluster.port }}
+ args:
+ - "/app/rw_core"
+ - "-kv_store_type=etcd"
+ - "-kv_store_host=$(ETCD_SERVICE)"
+ - "-kv_store_port=$(ETCD_SERVICE_PORT)"
+ - "-grpc_host=$(POD_IP)"
+ - "-grpc_port=50057"
+ - "-banner=true"
+ - "-kafka_adapter_host=$(ADAPTER_KAFKA_SERVICE)"
+ - "-kafka_adapter_port=$(ADAPTER_KAFKA_SERVICE_PORT)"
+ - "-kafka_cluster_host=$(CLUSTER_KAFKA_SERVICE)"
+ - "-kafka_cluster_port=$(CLUSTER_KAFKA_SERVICE_PORT)"
+ - "-rw_core_topic=rwcore"
+ - "-kv_store_data_prefix=service/voltha"
+ - "-in_competing_mode=true"
+ - "-timeout_long_request=8000"
+ - "-timeout_request=6000"
+ - "-log_level=4"
+ ports:
+ - containerPort: 50057
+ name: grpc-port
+{{end}}