Skip to content

Commit

Permalink
Make log verbosity configurable
Browse files Browse the repository at this point in the history
Make log verbosity level configurable via chart values, rather than hard-coding --v=5 (the most verbose level, intended for trace-level logging).  For backwards compatibility the defaults are still set to "5" everywhere, but this can now be overridden via csiController.{attacher|provisioner|resizer}.logLevel for the controller (or csiController.logLevel to set all three at once) and csiNode.driverRegistrar.logLevel for the CSI node.

Signed-off-by: Ian Roberts <[email protected]>
  • Loading branch information
ianroberts committed Oct 10, 2021
1 parent a007335 commit f22ec85
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
5 changes: 5 additions & 0 deletions deploy/helm/charts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ helm upgrade openebs-jiva openebs-jiva/jiva -n openebs \
| csiController.attacher.image.registry | string | `"k8s.gcr.io/"` | CSI attacher image registry |
| csiController.attacher.image.repository | string | `"k8scsi/csi-attacher"` | CSI attacher image repo |
| csiController.attacher.image.tag | string | `"v3.1.0"` | CSI attacher image tag |
| csiController.attacher.logLevel | string | `"5"` | CSI attacher container log level (1 = least verbose, 5 = most verbose)|
| csiController.attacher.name | string | `"csi-attacher"` | CSI attacher container name|
| csiController.componentName | string | `""` | CSI controller component name |
| csiController.driverRegistrar.image.pullPolicy | string | `"IfNotPresent"` | CSI driver registrar image pull policy |
Expand All @@ -125,17 +126,20 @@ helm upgrade openebs-jiva openebs-jiva/jiva -n openebs \
| csiController.livenessprobe.image.repository | string | `"k8scsi/livenessprobe"` | CSI livenessprobe image repo |
| csiController.livenessprobe.image.tag | string | `"v2.3.0"` | CSI livenessprobe image tag |
| csiController.livenessprobe.name | string | `"liveness-probe"` | CSI livenessprobe container name|
| csiController.logLevel | string | _unspecified_ | Log level for all CSI controller containers (1 = least verbose, 5 = most verbose) - overrides the per-container defaults |
| csiController.nodeSelector | object | `{}` | CSI controller pod node selector |
| csiController.podAnnotations | object | `{}` | CSI controller pod annotations |
| csiController.provisioner.image.pullPolicy | string | `"IfNotPresent"` | CSI provisioner image pull policy |
| csiController.provisioner.image.registry | string | `"k8s.gcr.io/"` | CSI provisioner image pull registry |
| csiController.provisioner.image.repository | string | `"k8scsi/csi-provisioner"` | CSI provisioner image pull repository |
| csiController.provisioner.image.tag | string | `"v3.0.0"` | CSI provisioner image tag |
| csiController.provisioner.logLevel | string | `"5"` | CSI provisioner container log level (1 = least verbose, 5 = most verbose)|
| csiController.provisioner.name | string | `"csi-provisioner"` | CSI provisioner container name |
| csiController.resizer.image.pullPolicy | string | `"IfNotPresent"` | CSI resizer image pull policy |
| csiController.resizer.image.registry | string | `"k8s.gcr.io/"` | CSI resizer image registry |
| csiController.resizer.image.repository | string | `"k8scsi/csi-resizer"` | CSI resizer image repository|
| csiController.resizer.image.tag | string | `"v1.2.0"` | CSI resizer image tag |
| csiController.resizer.logLevel | string | `"5"` | CSI resizer container log level (1 = least verbose, 5 = most verbose)|
| csiController.resizer.name | string | `"csi-resizer"` | CSI resizer container name |
| csiController.resources | object | `{}` | CSI controller container resources |
| csiController.securityContext | object | `{}` | CSI controller security context |
Expand All @@ -147,6 +151,7 @@ helm upgrade openebs-jiva openebs-jiva/jiva -n openebs \
| csiNode.driverRegistrar.image.repository | string | `"k8scsi/csi-node-driver-registrar"` | CSI Node driver registrar image repository |
| csiNode.driverRegistrar.image.tag | string | `"v2.3.0"` | CSI Node driver registrar image tag|
| csiNode.driverRegistrar.name | string | `"csi-node-driver-registrar"` | CSI Node driver registrar container name |
| csiNode.driverRegistrar.logLevel | string | `"5"` | CSI node driver registrat container log level (1 = least verbose, 5 = most verbose)|
| csiNode.kubeletDir | string | `"/var/lib/kubelet/"` | Kubelet root dir |
| csiNode.labels | object | `{}` | CSI Node pod labels |
| csiNode.nodeSelector | object | `{}` | CSI Node pod nodeSelector |
Expand Down
6 changes: 3 additions & 3 deletions deploy/helm/charts/templates/csi-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
resources:
{{ toYaml .Values.csiController.resources | indent 12 }}
args:
- "--v=5"
- "--v={{ .Values.csiController.logLevel | default .Values.csiController.resizer.logLevel }}"
- "--csi-address=$(ADDRESS)"
- "--leader-election"
env:
Expand All @@ -44,7 +44,7 @@ spec:
imagePullPolicy: {{ .Values.csiController.provisioner.image.pullPolicy }}
args:
- "--csi-address=$(ADDRESS)"
- "--v=5"
- "--v={{ .Values.csiController.logLevel | default .Values.csiController.provisioner.logLevel }}"
- "--feature-gates=Topology=true"
- "--extra-create-metadata=true"
- "--metrics-address=:22011"
Expand All @@ -64,7 +64,7 @@ spec:
image: "{{ .Values.csiController.attacher.image.registry }}{{ .Values.csiController.attacher.image.repository }}:{{ .Values.csiController.attacher.image.tag }}"
imagePullPolicy: {{ .Values.csiController.attacher.image.pullPolicy }}
args:
- "--v=5"
- "--v={{ .Values.csiController.logLevel | default .Values.csiController.attacher.logLevel }}"
- "--csi-address=$(ADDRESS)"
env:
- name: ADDRESS
Expand Down
2 changes: 1 addition & 1 deletion deploy/helm/charts/templates/csi-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
resources:
{{ toYaml .Values.csiNode.resources | indent 12 }}
args:
- "--v=5"
- "--v={{ .Values.csiNode.logLevel | default .Values.csiNode.driverRegistrar.logLevel }}"
- "--csi-address=$(ADDRESS)"
- "--kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)"
lifecycle:
Expand Down
4 changes: 4 additions & 0 deletions deploy/helm/charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ csiController:
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: v3.1.0
logLevel: "5"
livenessprobe:
name: "liveness-probe"
image:
Expand All @@ -90,6 +91,7 @@ csiController:
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: v3.0.0
logLevel: "5"
resizer:
name: "csi-resizer"
image:
Expand All @@ -100,6 +102,7 @@ csiController:
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: v1.2.0
logLevel: "5"
annotations: {}
podAnnotations: {}
podLabels: {}
Expand Down Expand Up @@ -134,6 +137,7 @@ csiNode:
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: v2.3.0
logLevel: "5"
livenessprobe:
name: "liveness-probe"
image:
Expand Down

0 comments on commit f22ec85

Please sign in to comment.