diff --git a/.github/workflows/chart-lint-test.yml b/.github/workflows/chart-lint-test.yml index 309a3d09..2823aa99 100644 --- a/.github/workflows/chart-lint-test.yml +++ b/.github/workflows/chart-lint-test.yml @@ -45,7 +45,7 @@ jobs: run: ct lint --config ct.yaml - name: Create kind cluster - uses: helm/kind-action@v1.1.0 + uses: helm/kind-action@v1.2.0 if: steps.list-changed.outputs.changed == 'true' with: config: buildscripts/kind_config.yaml diff --git a/deploy/helm/charts/Chart.yaml b/deploy/helm/charts/Chart.yaml index bc373f30..0366bd03 100644 --- a/deploy/helm/charts/Chart.yaml +++ b/deploy/helm/charts/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: lvm-localpv description: CSI Driver for dynamic provisioning of LVM Persistent Local Volumes. -version: 0.6.1 +version: 0.6.2 appVersion: 0.6.0 icon: https://raw.githubusercontent.com/cncf/artwork/master/projects/openebs/icon/color/openebs-icon-color.png home: http://www.openebs.io/ diff --git a/deploy/helm/charts/README.md b/deploy/helm/charts/README.md index 1664ff46..063e3772 100644 --- a/deploy/helm/charts/README.md +++ b/deploy/helm/charts/README.md @@ -79,6 +79,7 @@ The following table lists the configurable parameters of the OpenEBS LVM Localpv | `lvmPlugin.image.repository`| Image repository for openebs-lvm-plugin| `openebs/lvm-driver`| | `lvmPlugin.image.pullPolicy`| Image pull policy for openebs-lvm-plugin| `IfNotPresent`| | `lvmPlugin.image.tag`| Image tag for openebs-lvm-plugin| `0.6.0`| +| `lvmPlugin.metricsPort`| The TCP port number used for exposing lvm-metrics | `9500`| | `lvmNode.driverRegistrar.image.registry`| Registry for csi-node-driver-registrar image| `k8s.gcr.io/`| | `lvmNode.driverRegistrar.image.repository`| Image repository for csi-node-driver-registrar| `sig-storage/csi-node-driver-registrar`| | `lvmNode.driverRegistrar.image.pullPolicy`| Image pull policy for csi-node-driver-registrar| `IfNotPresent`| diff --git a/deploy/helm/charts/templates/lvm-node-service.yaml b/deploy/helm/charts/templates/lvm-node-service.yaml new file mode 100644 index 00000000..4825c259 --- /dev/null +++ b/deploy/helm/charts/templates/lvm-node-service.yaml @@ -0,0 +1,18 @@ +{{- if .Values.lvmPlugin.metricsPort }} +apiVersion: v1 +kind: Service +metadata: + name: {{ template "lvmlocalpv.fullname" . }}-node-service + labels: + {{- include "lvmlocalpv.lvmNode.labels" . | nindent 4 }} +spec: + clusterIP: None + ports: + - name: metrics + port: {{ .Values.lvmPlugin.metricsPort }} + targetPort: {{ .Values.lvmPlugin.metricsPort }} + selector: + {{- with .Values.lvmNode.podLabels }} + {{ toYaml . }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/deploy/helm/charts/templates/lvm-node.yaml b/deploy/helm/charts/templates/lvm-node.yaml index 703502c6..6d973c45 100644 --- a/deploy/helm/charts/templates/lvm-node.yaml +++ b/deploy/helm/charts/templates/lvm-node.yaml @@ -75,6 +75,9 @@ spec: - "--riops-per-gb=$(RIOPS_PER_GB)" - "--wiops-per-gb=$(WIOPS_PER_GB)" {{- end }} + {{- if .Values.lvmPlugin.metricsPort }} + - "--listen-address=$(METRICS_LISTEN_ADDRESS)" + {{- end }} env: - name: OPENEBS_NODE_ID valueFrom: @@ -96,6 +99,10 @@ spec: - name: WIOPS_PER_GB value: {{ .Values.lvmPlugin.ioLimits.writeIopsPerGB }} {{- end }} + {{- if .Values.lvmPlugin.metricsPort }} + - name: METRICS_LISTEN_ADDRESS + value: :{{ .Values.lvmPlugin.metricsPort }} + {{- end }} volumeMounts: - name: plugin-dir mountPath: /plugin diff --git a/deploy/helm/charts/values.yaml b/deploy/helm/charts/values.yaml index f0da40e2..de1bcb49 100644 --- a/deploy/helm/charts/values.yaml +++ b/deploy/helm/charts/values.yaml @@ -132,6 +132,9 @@ lvmPlugin: containerRuntime: containerd readIopsPerGB: "" writeIopsPerGB: "" + # The TCP port number used for exposing lvm-metrics. + # If not set, service will not be created to expose metrics endpoint to serviceMonitor and listen-address flag will not be set. + metricsPort: 9500 role: openebs-lvm diff --git a/deploy/lvm-operator.yaml b/deploy/lvm-operator.yaml index 1c598e7c..75fa5a11 100644 --- a/deploy/lvm-operator.yaml +++ b/deploy/lvm-operator.yaml @@ -1357,6 +1357,7 @@ spec: - "--nodeid=$(OPENEBS_NODE_ID)" - "--endpoint=$(OPENEBS_CSI_ENDPOINT)" - "--plugin=$(OPENEBS_NODE_DRIVER)" + - "--listen-address=$(METRICS_LISTEN_ADDRESS)" env: - name: OPENEBS_NODE_ID valueFrom: @@ -1368,6 +1369,8 @@ spec: value: agent - name: LVM_NAMESPACE value: openebs + - name: METRICS_LISTEN_ADDRESS + value: :9500 volumeMounts: - name: plugin-dir mountPath: /plugin @@ -1396,3 +1399,18 @@ spec: path: /var/lib/kubelet/ type: Directory --- + +apiVersion: v1 +kind: Service +metadata: + name: openebs-lvm-node-service + labels: + name: openebs-lvm-node +spec: + clusterIP: None + ports: + - name: metrics + port: 9500 + targetPort: 9500 + selector: + app: openebs-lvm-node diff --git a/deploy/yamls/lvm-driver.yaml b/deploy/yamls/lvm-driver.yaml index 0dc7f2d2..a70ef014 100644 --- a/deploy/yamls/lvm-driver.yaml +++ b/deploy/yamls/lvm-driver.yaml @@ -988,6 +988,7 @@ spec: - "--nodeid=$(OPENEBS_NODE_ID)" - "--endpoint=$(OPENEBS_CSI_ENDPOINT)" - "--plugin=$(OPENEBS_NODE_DRIVER)" + - "--listen-address=$(METRICS_LISTEN_ADDRESS)" env: - name: OPENEBS_NODE_ID valueFrom: @@ -999,6 +1000,8 @@ spec: value: agent - name: LVM_NAMESPACE value: openebs + - name: METRICS_LISTEN_ADDRESS + value: :9500 volumeMounts: - name: plugin-dir mountPath: /plugin @@ -1027,3 +1030,18 @@ spec: path: /var/lib/kubelet/ type: Directory --- + +apiVersion: v1 +kind: Service +metadata: + name: openebs-lvm-node-service + labels: + name: openebs-lvm-node +spec: + clusterIP: None + ports: + - name: metrics + port: 9500 + targetPort: 9500 + selector: + app: openebs-lvm-node