VOL-1796 make the log level a chart parameter
Change-Id: Ia42e91ebe1028d0a3f1829dd07e5203784dec0e7
diff --git a/voltha/Chart.yaml b/voltha/Chart.yaml
index 530d835..59df64f 100644
--- a/voltha/Chart.yaml
+++ b/voltha/Chart.yaml
@@ -17,5 +17,5 @@
description: A Helm chart for Voltha based on K8S resources in Voltha project
icon: https://guide.opencord.org/logos/cord.svg
-version: 2.0.9
+version: 2.0.10
appVersion: 2.0.0
diff --git a/voltha/requirements.yaml b/voltha/requirements.yaml
index 2fded67..20832fd 100644
--- a/voltha/requirements.yaml
+++ b/voltha/requirements.yaml
@@ -20,5 +20,5 @@
condition: private_kafka_cluster
- name: voltha-etcd-cluster
repository: file://../voltha-etcd-cluster
- version: 2.0.1
+ version: 2.0.2
condition: private_etcd_cluster
diff --git a/voltha/templates/ro-core.yaml b/voltha/templates/ro-core.yaml
index ce4a6bd..7a60699 100644
--- a/voltha/templates/ro-core.yaml
+++ b/voltha/templates/ro-core.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.
+{{- $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: apps/v1
@@ -69,7 +86,7 @@
- "-grpc_port=50057"
- "-banner=true"
- "-ro_core_topic=rocore"
- - "-log_level=0"
+ - "-log_level={{ $log_level }}"
ports:
- containerPort: 50057
name: grpc-port
diff --git a/voltha/templates/rw-core.yaml b/voltha/templates/rw-core.yaml
index 28e5f22..beed9fd 100644
--- a/voltha/templates/rw-core.yaml
+++ b/voltha/templates/rw-core.yaml
@@ -21,6 +21,23 @@
{{- $core_timeout := tpl $root.Values.rw_core.core_timeout . }}
{{- $long_request_timeout := tpl $root.Values.rw_core.timeout_long_request . }}
{{- $request_timeout := tpl $root.Values.rw_core.timeout_request . }}
+{{- $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 }}
{{- range $i, $e := until $count }}
{{- $core_idx := add $i 1 }}
{{- $affinity_group := add1 (div $i 2) }}
@@ -99,7 +116,7 @@
- "-core_timeout={{ $core_timeout }}"
- "-timeout_long_request={{ $long_request_timeout }}"
- "-timeout_request={{ $request_timeout }}"
- - "-log_level=2"
+ - "-log_level={{ $log_level }}"
ports:
- containerPort: 50057
name: grpc-port
diff --git a/voltha/values.yaml b/voltha/values.yaml
index 6429af9..32de22e 100644
--- a/voltha/values.yaml
+++ b/voltha/values.yaml
@@ -19,6 +19,7 @@
# Default overrides
defaults:
+ log_level: "ERROR"
image_registry: ''
image_tag: '{{ .Chart.AppVersion }}'
image_org: "voltha/"
@@ -73,7 +74,11 @@
afrouter: 1
afrouterd: 1
+ro_core:
+ log_level: '{{ .Values.defaults.log_level }}'
+
rw_core:
+ log_level: '{{ .Values.defaults.log_level }}'
core_timeout: '{{ .Values.defaults.rw_core.timeout }}'
timeout_long_request: '{{ .Values.defaults.rw_core.timeout }}'
timeout_request: '{{ .Values.defaults.rw_core.timeout }}'