Skip to content

Commit

Permalink
Make log verbosity configurable in helm installation (#397)
Browse files Browse the repository at this point in the history
Make log verbosity level configurable via chart values, rather than hard-coding --v values (several components are currently set at --v=5, the most verbose level, intended for trace-level logging).  For backwards compatibility the defaults are set to match the previous hard-coded values everywhere, but this can now be overridden via csiController.{attacher|provisioner|resizer|snapshotController}.logLevel for the controller (or csiController.logLevel to set the default for all four), csiNode.driverRegistrar.logLevel for the CSI node and cvcOperator.logLevel for the CVC operator.

Signed-off-by: Ian Roberts <[email protected]>
  • Loading branch information
ianroberts authored Nov 19, 2021
1 parent e8b68be commit 608147a
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion deploy/helm/charts/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: CStor-Operator helm chart for Kubernetes
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 3.0.1
version: 3.0.2
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: 3.0.0
Expand Down
8 changes: 8 additions & 0 deletions deploy/helm/charts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,26 +122,31 @@ helm install openebs-cstor openebs-cstor/cstor --namespace openebs --create-name
| csiController.attacher.image.registry | string | `"k8s.gcr.io/"` | CSI attacher image registry |
| csiController.attacher.image.repository | string | `"sig-storage/csi-attacher"` | CSI attacher image repo |
| csiController.attacher.image.tag | string | `"v3.1.0"` | CSI attacher image tag |
| csiController.attacher.logLevel | string | _unspecified_ | Override log level for CSI attacher container (1 = least verbose, 5 = most verbose) |
| csiController.attacher.name | string | `"csi-attacher"` | CSI attacher container name|
| csiController.componentName | string | `"openebs-cstor-csi-controller"` | CSI controller component name |
| csiController.logLevel | string | `"5"` | Default log level for all CSI controller containers (1 = least verbose, 5 = most verbose) unless overridden for a specific container |
| 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 | `"sig-storage/csi-provisioner"` | CSI provisioner image pull repository |
| csiController.provisioner.image.tag | string | `"v3.0.0"` | CSI provisioner image tag |
| csiController.provisioner.logLevel | string | _unspecified_ | Override log level for CSI provisioner container (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 | `"sig-storage/csi-resizer"` | CSI resizer image repository|
| csiController.resizer.image.tag | string | `"v1.2.0"` | CSI resizer image tag |
| csiController.resizer.logLevel | string | _unspecified_ | Override log level for CSI resizer container (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 |
| csiController.snapshotController.image.pullPolicy | string | `"IfNotPresent"` | CSI snapshot controller image pull policy |
| csiController.snapshotController.image.registry | string | `"k8s.gcr.io/"` | CSI snapshot controller image registry |
| csiController.snapshotController.image.repository | string | `"sig-storage/snapshot-controller"` | CSI snapshot controller image repository |
| csiController.snapshotController.image.tag | string | `"v3.0.3"` | CSI snapshot controller image tag |
| csiController.snapshotController.logLevel | string | _unspecified_ | Override log level for CSI snapshot controller container (1 = least verbose, 5 = most verbose) |
| csiController.snapshotController.name | string | `"snapshot-controller"` | CSI snapshot controller container name |
| csiController.snapshotter.image.pullPolicy | string | `"IfNotPresent"` | CSI snapshotter image pull policy |
| csiController.snapshotter.image.registry | string | `"k8s.gcr.io/"` | CSI snapshotter image pull registry |
Expand All @@ -155,9 +160,11 @@ helm install openebs-cstor openebs-cstor/cstor --namespace openebs --create-name
| csiNode.driverRegistrar.image.registry | string | `"k8s.gcr.io/"` | CSI Node driver registrar image registry |
| csiNode.driverRegistrar.image.repository | string | `"sig-storage/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.logLevel | string | _unspecified_ | Override log level for CSI node driver registrar container (1 = least verbose, 5 = most verbose) |
| csiNode.driverRegistrar.name | string | `"csi-node-driver-registrar"` | CSI Node driver registrar container name |
| csiNode.kubeletDir | string | `"/var/lib/kubelet/"` | Kubelet root dir |
| csiNode.labels | object | `{}` | CSI Node pod labels |
| csiNode.logLevel | string | `"5"` | Default log level for CSI node containers (1 = least verbose, 5 = most verbose) unless overriden for a specific container |
| csiNode.nodeSelector | object | `{}` | CSI Node pod nodeSelector |
| csiNode.podAnnotations | object | `{}` | CSI Node pod annotations |
| csiNode.resources | object | `{}` | CSI Node pod resources |
Expand Down Expand Up @@ -197,6 +204,7 @@ helm install openebs-cstor openebs-cstor/cstor --namespace openebs --create-name
| cvcOperator.image.registry | string | `nil` | CVC operator image registry |
| cvcOperator.image.repository | string | `"openebs/cvc-operator"` | CVC operator image repository |
| cvcOperator.image.tag | string | `"3.0.0"` | CVC operator image tag |
| cvcOperator.logLevel | string | `"2"` | Log level for CVC operator container (1 = least verbose, 5 = most verbose) |
| cvcOperator.nodeSelector | object | `{}` | CVC operator pod nodeSelector |
| cvcOperator.podAnnotations | object | `{}` | CVC operator pod annotations |
| cvcOperator.resources | object | `{}` |CVC operator pod resources |
Expand Down
8 changes: 4 additions & 4 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.resizer.logLevel | default .Values.csiController.logLevel }}"
- "--csi-address=$(ADDRESS)"
- "--leader-election"
env:
Expand All @@ -53,15 +53,15 @@ spec:
- name: {{ .Values.csiController.snapshotController.name }}
image: "{{ .Values.csiController.snapshotController.image.registry }}{{ .Values.csiController.snapshotController.image.repository }}:{{ .Values.csiController.snapshotController.image.tag }}"
args:
- "--v=5"
- "--v={{ .Values.csiController.snapshotController.logLevel | default .Values.csiController.logLevel }}"
- "--leader-election=false"
imagePullPolicy: {{ .Values.csiController.snapshotController.image.pullPolicy }}
- name: {{ .Values.csiController.provisioner.name }}
image: "{{ .Values.csiController.provisioner.image.registry }}{{ .Values.csiController.provisioner.image.repository }}:{{ .Values.csiController.provisioner.image.tag }}"
imagePullPolicy: {{ .Values.csiController.provisioner.image.pullPolicy }}
args:
- "--csi-address=$(ADDRESS)"
- "--v=5"
- "--v={{ .Values.csiController.provisioner.logLevel | default .Values.csiController.logLevel }}"
- "--feature-gates=Topology=true"
- "--extra-create-metadata=true"
- "--metrics-address=:22011"
Expand All @@ -81,7 +81,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.attacher.logLevel | default .Values.csiController.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.driverRegistrar.logLevel | default .Values.csiNode.logLevel }}"
- "--csi-address=$(ADDRESS)"
- "--kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)"
lifecycle:
Expand Down
2 changes: 1 addition & 1 deletion deploy/helm/charts/templates/cvc-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
imagePullPolicy: {{ .Values.cvcOperator.image.pullPolicy }}
image: "{{ .Values.cvcOperator.image.registry }}{{ .Values.cvcOperator.image.repository }}:{{ .Values.cvcOperator.image.tag }}"
args:
- "--v=2"
- "--v={{ .Values.cvcOperator.logLevel }}"
- "--leader-election=false"
- "--bind=$(OPENEBS_CVC_POD_IP)"
resources:
Expand Down
3 changes: 3 additions & 0 deletions deploy/helm/charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,15 @@ cvcOperator:
tolerations: []
resources: {}
securityContext: {}
logLevel: "2"

csiController:
priorityClass:
create: true
name: cstor-csi-controller-critical
value: 900000000
componentName: "openebs-cstor-csi-controller"
logLevel: "5"
resizer:
name: "csi-resizer"
image:
Expand Down Expand Up @@ -176,6 +178,7 @@ csiNode:
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: v2.3.0
logLevel: "5"
updateStrategy:
type: RollingUpdate
annotations: {}
Expand Down

0 comments on commit 608147a

Please sign in to comment.