[VOL-2992] Expose pprof server when requested for openolt-adapter and rw-core

Change-Id: I740189d5a47957120907a1a8b33ae31b1f4ad00f
diff --git a/voltha-adapter-openolt/Chart.yaml b/voltha-adapter-openolt/Chart.yaml
index ec08fa2..86e972e 100644
--- a/voltha-adapter-openolt/Chart.yaml
+++ b/voltha-adapter-openolt/Chart.yaml
@@ -17,5 +17,5 @@
 description: A Helm chart for Voltha OpenOLT Adapter
 icon: https://guide.opencord.org/logos/cord.svg
 
-version: 2.4.1
+version: 2.4.2
 appVersion: 2.4.1
diff --git a/voltha-adapter-openolt/templates/adapters-openolt.yaml b/voltha-adapter-openolt/templates/adapters-openolt.yaml
index a62506d..6151c4b 100644
--- a/voltha-adapter-openolt/templates/adapters-openolt.yaml
+++ b/voltha-adapter-openolt/templates/adapters-openolt.yaml
@@ -13,6 +13,23 @@
 # limitations under the License.
 {{- $log_level := tpl .Values.adapter_open_olt.log_level . | upper }}
 
+{{- if .Values.profiler.enabled }}
+apiVersion: v1
+kind: Service
+metadata:
+  name: adapter-open-olt-profiler
+  serviceAccountName: {{ .Values.serviceaccount }}
+spec:
+  serviceAccountName: {{ .Values.serviceaccount }}
+  clusterIP: None
+  ports:
+    - name: profiler
+      port: 6060
+      targetPort: 6060
+  selector:
+    app: adapter-open-olt
+---
+{{- end }}
 apiVersion: apps/v1
 kind: Deployment
 metadata:
diff --git a/voltha-adapter-openolt/values.yaml b/voltha-adapter-openolt/values.yaml
index 7dab4bd..7c8fce3 100644
--- a/voltha-adapter-openolt/values.yaml
+++ b/voltha-adapter-openolt/values.yaml
@@ -36,6 +36,10 @@
     service: voltha-etcd-cluster-client.voltha.svc.cluster.local
     port: 2379
 
+# Expose the golang pprof webserver, if enabled
+profiler:
+  enabled: false
+
 # Define the recplica count for everything
 replicas:
   adapter_open_olt: 1
diff --git a/voltha/Chart.yaml b/voltha/Chart.yaml
index f5f5564..f47ccbc 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.4
+version: 2.4.5
 
 # app version applies to multiple components with potentially different
 # container image versions
diff --git a/voltha/templates/rw-core.yaml b/voltha/templates/rw-core.yaml
index b56a989..6127e23 100644
--- a/voltha/templates/rw-core.yaml
+++ b/voltha/templates/rw-core.yaml
@@ -42,6 +42,23 @@
   selector:
     app: rw-core
 ---
+{{- if .Values.profiler.enabled }}
+apiVersion: v1
+kind: Service
+metadata:
+  name: voltha-rw-core-profiler
+  serviceAccountName: {{ .Values.serviceaccount }}
+spec:
+  serviceAccountName: {{ .Values.serviceaccount }}
+  clusterIP: None
+  ports:
+    - name: profiler
+      port: 6060
+      targetPort: 6060
+  selector:
+    app: rw-core
+---
+{{- end }}
 apiVersion: apps/v1beta1
 kind: Deployment
 metadata:
@@ -137,4 +154,3 @@
               port: 8080
             initialDelaySeconds: 3
             periodSeconds: 3
-
diff --git a/voltha/values.yaml b/voltha/values.yaml
index d0d445f..4a84637 100644
--- a/voltha/values.yaml
+++ b/voltha/values.yaml
@@ -66,6 +66,10 @@
     - service: onos-openflow.default.svc.cluster.local
       port: 6653
 
+# Expose the golang pprof webserver, if enabled
+profiler:
+  enabled: false
+
 # Define the recplica count for everything
 replicas:
   # For R/W cores the templates translate the number of replicas