Skip to content

Commit

Permalink
Reduce log verbosity in CSI sidecars (#115)
Browse files Browse the repository at this point in the history
Closes: #275
  • Loading branch information
clintonk authored Aug 28, 2019
1 parent 1bb899b commit 8f37ea5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

**Fixes:**
- **Kubernetes:** Added fix to ensure Trident pods only run on amd64/linux nodes.
- **Kubernetes:** Reduced log verbosity in CSI sidecars.

**Enhancements:**

Expand Down
33 changes: 21 additions & 12 deletions cli/k8s_client/yaml_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,14 @@ spec:
func GetCSIDeploymentYAML(tridentImage, label string, debug bool, version *utils.Version) string {

var debugLine string
var logLevel string

if debug {
debugLine = "- -debug"
logLevel = "9"
} else {
debugLine = "#- -debug"
logLevel = "2"
}

var deploymentYAML string
Expand All @@ -299,6 +303,7 @@ func GetCSIDeploymentYAML(tridentImage, label string, debug bool, version *utils
deploymentYAML = strings.Replace(deploymentYAML, "{TRIDENT_IMAGE}", tridentImage, 1)
deploymentYAML = strings.Replace(deploymentYAML, "{DEBUG}", debugLine, 1)
deploymentYAML = strings.Replace(deploymentYAML, "{LABEL}", label, -1)
deploymentYAML = strings.Replace(deploymentYAML, "{LOG_LEVEL}", logLevel, -1)
return deploymentYAML
}

Expand Down Expand Up @@ -363,7 +368,7 @@ spec:
- name: csi-provisioner
image: quay.io/k8scsi/csi-provisioner:v1.0.1
args:
- "--v=9"
- "--v={LOG_LEVEL}"
- "--connection-timeout=24h"
- "--csi-address=$(ADDRESS)"
env:
Expand All @@ -375,7 +380,7 @@ spec:
- name: csi-attacher
image: quay.io/k8scsi/csi-attacher:v1.0.1
args:
- "--v=9"
- "--v={LOG_LEVEL}"
- "--connection-timeout=24h"
- "--timeout=60s"
- "--csi-address=$(ADDRESS)"
Expand All @@ -388,7 +393,7 @@ spec:
- name: csi-snapshotter
image: quay.io/k8scsi/csi-snapshotter:v1.0.1
args:
- "--v=9"
- "--v={LOG_LEVEL}"
- "--connection-timeout=24h"
- "--csi-address=$(ADDRESS)"
env:
Expand All @@ -400,7 +405,7 @@ spec:
- name: csi-cluster-driver-registrar
image: quay.io/k8scsi/csi-cluster-driver-registrar:v1.0.1
args:
- "--v=9"
- "--v={LOG_LEVEL}"
- "--connection-timeout=24h"
- "--csi-address=$(ADDRESS)"
env:
Expand Down Expand Up @@ -481,7 +486,7 @@ spec:
- name: csi-provisioner
image: quay.io/k8scsi/csi-provisioner:v1.2.1
args:
- "--v=9"
- "--v={LOG_LEVEL}"
- "--timeout=600s"
- "--csi-address=$(ADDRESS)"
env:
Expand All @@ -493,7 +498,7 @@ spec:
- name: csi-attacher
image: quay.io/k8scsi/csi-attacher:v1.1.1
args:
- "--v=9"
- "--v={LOG_LEVEL}"
- "--timeout=60s"
- "--csi-address=$(ADDRESS)"
env:
Expand All @@ -505,7 +510,7 @@ spec:
- name: csi-snapshotter
image: quay.io/k8scsi/csi-snapshotter:v1.2.1
args:
- "--v=9"
- "--v={LOG_LEVEL}"
- "--timeout=300s"
- "--csi-address=$(ADDRESS)"
env:
Expand Down Expand Up @@ -586,7 +591,7 @@ spec:
- name: csi-provisioner
image: quay.io/k8scsi/csi-provisioner:v1.3.0
args:
- "--v=9"
- "--v={LOG_LEVEL}"
- "--timeout=600s"
- "--csi-address=$(ADDRESS)"
env:
Expand All @@ -598,7 +603,7 @@ spec:
- name: csi-attacher
image: quay.io/k8scsi/csi-attacher:v1.2.0
args:
- "--v=9"
- "--v={LOG_LEVEL}"
- "--timeout=60s"
- "--retry-interval-start=10s"
- "--csi-address=$(ADDRESS)"
Expand All @@ -611,7 +616,7 @@ spec:
- name: csi-snapshotter
image: quay.io/k8scsi/csi-snapshotter:v1.2.1
args:
- "--v=9"
- "--v={LOG_LEVEL}"
- "--timeout=300s"
- "--csi-address=$(ADDRESS)"
env:
Expand All @@ -634,11 +639,14 @@ spec:
func GetCSIDaemonSetYAML(tridentImage, label string, debug bool, version *utils.Version) string {

var debugLine string
var logLevel string

if debug {
debugLine = "- -debug"
logLevel = "9"
} else {
debugLine = "#- -debug"
logLevel = "2"
}

var daemonSetYAML string
Expand All @@ -651,6 +659,7 @@ func GetCSIDaemonSetYAML(tridentImage, label string, debug bool, version *utils.
daemonSetYAML = strings.Replace(daemonSetYAML, "{TRIDENT_IMAGE}", tridentImage, 1)
daemonSetYAML = strings.Replace(daemonSetYAML, "{LABEL}", label, -1)
daemonSetYAML = strings.Replace(daemonSetYAML, "{DEBUG}", debugLine, 1)
daemonSetYAML = strings.Replace(daemonSetYAML, "{LOG_LEVEL}", logLevel, -1)
return daemonSetYAML
}

Expand Down Expand Up @@ -722,7 +731,7 @@ spec:
- name: driver-registrar
image: quay.io/k8scsi/csi-node-driver-registrar:v1.0.2
args:
- "--v=9"
- "--v={LOG_LEVEL}"
- "--connection-timeout=24h"
- "--csi-address=$(ADDRESS)"
- "--kubelet-registration-path=$(REGISTRATION_PATH)"
Expand Down Expand Up @@ -845,7 +854,7 @@ spec:
- name: driver-registrar
image: quay.io/k8scsi/csi-node-driver-registrar:v1.1.0
args:
- "--v=9"
- "--v={LOG_LEVEL}"
- "--csi-address=$(ADDRESS)"
- "--kubelet-registration-path=$(REGISTRATION_PATH)"
env:
Expand Down

0 comments on commit 8f37ea5

Please sign in to comment.