Support configuring multiple OF controllers in ofagents.
Take 2.
Change-Id: Id668dd2908ddfaf787125538d1144e10ccd9011a
diff --git a/voltha/Chart.yaml b/voltha/Chart.yaml
index 25d76db..fed0f67 100644
--- a/voltha/Chart.yaml
+++ b/voltha/Chart.yaml
@@ -17,7 +17,7 @@
description: A Helm chart for Voltha based on K8S resources in Voltha project
icon: https://guide.opencord.org/logos/cord.svg
-version: 2.4.2
+version: 2.4.3
# app version applies to multiple components with potentially different
# container image versions
diff --git a/voltha/templates/ofagent-go.yaml b/voltha/templates/ofagent-go.yaml
index 07c2b94..f8f2cc2 100644
--- a/voltha/templates/ofagent-go.yaml
+++ b/voltha/templates/ofagent-go.yaml
@@ -64,15 +64,15 @@
image: '{{ tpl .Values.images.ofagent_go.registry . }}{{ tpl .Values.images.ofagent_go.repository . }}:{{ tpl .Values.images.ofagent_go.tag . }}'
imagePullPolicy: {{ tpl .Values.images.ofagent_go.pullPolicy . }}
env:
- - name: CONTROLLER_SERVICE
- value: "{{ .Values.services.controller.service }}:{{ .Values.services.controller.port }}"
- name: COMPONENT_NAME
valueFrom:
fieldRef:
fieldPath: metadata.labels['app.kubernetes.io/name']
args:
- "/app/ofagent"
- - "--controller=$(CONTROLLER_SERVICE)"
+ {{- range .Values.services.controller }}
+ - "--controller={{ .service }}:{{ .port }}"
+ {{- end }}
- "--voltha=voltha-api.{{ .Release.Namespace }}.svc.cluster.local:55555"
- "--kv_store_host=voltha-etcd-cluster-client.{{ .Release.Namespace }}.svc.cluster.local"
- "--kv_store_port=2379"
diff --git a/voltha/templates/ofagent-py.yaml b/voltha/templates/ofagent-py.yaml
index 7996d80..711c4d6 100644
--- a/voltha/templates/ofagent-py.yaml
+++ b/voltha/templates/ofagent-py.yaml
@@ -63,13 +63,13 @@
- name: ofagent
image: '{{ tpl .Values.images.ofagent_py.registry . }}{{ tpl .Values.images.ofagent_py.repository . }}:{{ tpl .Values.images.ofagent_py.tag . }}'
imagePullPolicy: {{ tpl .Values.images.ofagent_py.pullPolicy . }}
- env:
- - name: CONTROLLER_SERVICE
- value: "{{ .Values.services.controller.service }}:{{ .Values.services.controller.port }}"
args:
- "/ofagent/ofagent/main.py"
- "-v"
- - "--controller=$(CONTROLLER_SERVICE)"
+ - "--controller"
+ {{- range .Values.services.controller }}
+ - "{{ .service }}:{{ .port }}"
+ {{- end }}
- "--grpc-endpoint=voltha-api.{{ .Release.Namespace }}.svc.cluster.local:55555"
- "--probe=:8080"
livenessProbe:
diff --git a/voltha/values.yaml b/voltha/values.yaml
index b979076..313d32d 100644
--- a/voltha/values.yaml
+++ b/voltha/values.yaml
@@ -61,10 +61,10 @@
service: voltha-etcd-cluster-client.voltha.svc.cluster.local
port: 2379
- # Define controller to which to connect
+ # Define the list of controllers to connect to
controller:
- service: onos-openflow.default.svc.cluster.local
- port: 6653
+ - service: onos-openflow.default.svc.cluster.local
+ port: 6653
# Define the recplica count for everything
replicas: