Exposing log level in the helm-chart for single rw-core and openolt-adapter
Change-Id: I5027a1f2cee3246c695c5dab2c6823ab1294facd
diff --git a/voltha-adapter-openolt/Chart.yaml b/voltha-adapter-openolt/Chart.yaml
index 8b2e275..59cefde 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.1.8
+version: 2.1.9
appVersion: 2.2.3
diff --git a/voltha-adapter-openolt/templates/adapters-openolt.yaml b/voltha-adapter-openolt/templates/adapters-openolt.yaml
index 0ca0e10..f049cde 100644
--- a/voltha-adapter-openolt/templates/adapters-openolt.yaml
+++ b/voltha-adapter-openolt/templates/adapters-openolt.yaml
@@ -11,6 +11,23 @@
# 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 := 3 }}
+{{- $set_log_level := tpl .Values.adapter_open_olt.log_level . | upper }}
+{{- if eq $set_log_level "DEBUG" }}
+{{- $log_level = 0 }}
+{{- else if eq $set_log_level "INFO" }}
+{{- $log_level = 1 }}
+{{- else if eq $set_log_level "WARN" }}
+{{- $log_level = 2 }}
+{{- else if eq $set_log_level "ERROR" }}
+{{- $log_level = 3 }}
+{{- else if eq $set_log_level "PANIC" }}
+{{- $log_level = 4 }}
+{{- else if eq $set_log_level "FATAL" }}
+{{- $log_level = 5 }}
+{{- else }}
+{{- $log_level = 3 }}
+{{- end }}
apiVersion: apps/v1
kind: Deployment
@@ -71,6 +88,7 @@
- "--core_topic=rwcore"
- "--kv_store_host={{ .Values.services.etcd.service }}"
- "--kv_store_port={{ .Values.services.etcd.port }}"
+ - "-log_level={{ $log_level }}"
- "--probe_port=8080"
livenessProbe:
httpGet:
@@ -84,4 +102,3 @@
port: 8080
initialDelaySeconds: 10
periodSeconds: 5
-
diff --git a/voltha-adapter-openolt/values.yaml b/voltha-adapter-openolt/values.yaml
index a6bed81..ce972d3 100644
--- a/voltha-adapter-openolt/values.yaml
+++ b/voltha-adapter-openolt/values.yaml
@@ -15,6 +15,7 @@
---
# Default overrides
defaults:
+ log_level: "WARN"
image_registry: ""
image_tag: ~
image_org: "voltha/"
@@ -29,7 +30,7 @@
cluster:
service: voltha-kafka.voltha.svc.cluster.local
port: 9092
-
+
# Define connectivity to etcd
etcd:
service: voltha-etcd-cluster-client.voltha.svc.cluster.local
@@ -39,6 +40,9 @@
replicas:
adapter_open_olt: 1
+adapter_open_olt:
+ log_level: '{{ .Values.defaults.log_level }}'
+
images:
adapter_open_olt:
registry: '{{ .Values.defaults.image_registry }}'
diff --git a/voltha-adapter-openonu/Chart.yaml b/voltha-adapter-openonu/Chart.yaml
index c0b1e8b..57bc503 100644
--- a/voltha-adapter-openonu/Chart.yaml
+++ b/voltha-adapter-openonu/Chart.yaml
@@ -17,5 +17,5 @@
description: A Helm chart for Voltha OpenONU Adapter
icon: https://guide.opencord.org/logos/cord.svg
-version: 2.1.10
+version: 2.1.11
appVersion: 2.2.5
diff --git a/voltha-adapter-openonu/values.yaml b/voltha-adapter-openonu/values.yaml
index b1d02dc..eb4bbfe 100644
--- a/voltha-adapter-openonu/values.yaml
+++ b/voltha-adapter-openonu/values.yaml
@@ -15,6 +15,7 @@
---
# Default overrides
defaults:
+ log_level: "WARN"
image_registry: ""
image_tag: ~
image_org: "voltha/"
@@ -40,7 +41,7 @@
adapter_open_onu: 1
adapter_open_onu:
- log_level: INFO
+ log_level: '{{ .Values.defaults.log_level }}'
images:
adapter_open_onu:
diff --git a/voltha/Chart.yaml b/voltha/Chart.yaml
index 2e4b6d0..d5fca77 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.1.16
+version: 2.1.17
# appVersion is 2 because this chart contains multiple 2.x images that may have
# different individual image versions.
diff --git a/voltha/templates/rw-core-only-one.yaml b/voltha/templates/rw-core-only-one.yaml
index 3dcb518..5c0949c 100644
--- a/voltha/templates/rw-core-only-one.yaml
+++ b/voltha/templates/rw-core-only-one.yaml
@@ -12,6 +12,23 @@
# See the License for the specific language governing permissions and
# limitations under the License.
{{- if .Values.therecanbeonlyone }}
+{{- $set_log_level := tpl .Values.rw_core.log_level . | upper }}
+{{- $log_level := 3 }}
+{{- if eq $set_log_level "DEBUG" }}
+{{- $log_level = 0 }}
+{{- else if eq $set_log_level "INFO" }}
+{{- $log_level = 1 }}
+{{- else if eq $set_log_level "WARN" }}
+{{- $log_level = 2 }}
+{{- else if eq $set_log_level "ERROR" }}
+{{- $log_level = 3 }}
+{{- else if eq $set_log_level "PANIC" }}
+{{- $log_level = 4 }}
+{{- else if eq $set_log_level "FATAL" }}
+{{- $log_level = 5 }}
+{{- else }}
+{{- $log_level = 3 }}
+{{- end }}
---
apiVersion: v1
kind: Service
@@ -116,6 +133,7 @@
- "-core_timeout=9999"
- "-timeout_long_request=9999"
- "-timeout_request=9999"
+ - "-log_level={{ $log_level }}"
- "-probe_port=8080"
ports:
- containerPort: 50057
diff --git a/voltha/values.yaml b/voltha/values.yaml
index 86ef37e..8d288a7 100644
--- a/voltha/values.yaml
+++ b/voltha/values.yaml
@@ -22,7 +22,7 @@
# The following are the default values used for every container in the
# template.
defaults:
- log_level: "ERROR"
+ log_level: "WARN"
image_registry: ''
image_org: "voltha/"
image_tag: ~