[VOL-2538] Logging - Implement dynamic log levels in ofagent

Change-Id: If63bc9005e1bcda3e7031a848b7417a4c218e7ce
diff --git a/voltha/Chart.yaml b/voltha/Chart.yaml
index 6415843..9111aab 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.2.6
+version: 2.2.7
 
 # 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 b92ad81..e9e7116 100644
--- a/voltha/templates/ofagent-go.yaml
+++ b/voltha/templates/ofagent-go.yaml
@@ -12,6 +12,7 @@
 # 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.
+{{- $log_level := tpl .Values.ofagent.log_level . | upper }}
 ---
 apiVersion: apps/v1beta1
 kind: Deployment
@@ -65,11 +66,19 @@
         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"
-        - "--loglevel={{- tpl .Values.ofagent.log_level . | upper }}"
         - "--controller=$(CONTROLLER_SERVICE)"
         - "--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"
+        - "--kv_store_type=etcd"
+        - "--kv_store_request_timeout=60"
+        - "--log_level={{ $log_level }}"
         - "--probe=:8080"
         livenessProbe:
           httpGet: