Skip to content

Commit

Permalink
Merge pull request #113 from rajaSahil/Add-Service
Browse files Browse the repository at this point in the history
fix(helm): Pass listen-address flag through arguments and install service.
  • Loading branch information
Vishnu Attur authored Jul 1, 2021
2 parents 08c3b3b + 0cb1c74 commit 96cf642
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/chart-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion deploy/helm/charts/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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/
Expand Down
1 change: 1 addition & 0 deletions deploy/helm/charts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`|
Expand Down
18 changes: 18 additions & 0 deletions deploy/helm/charts/templates/lvm-node-service.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
7 changes: 7 additions & 0 deletions deploy/helm/charts/templates/lvm-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
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 @@ -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

Expand Down
18 changes: 18 additions & 0 deletions deploy/lvm-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -1368,6 +1369,8 @@ spec:
value: agent
- name: LVM_NAMESPACE
value: openebs
- name: METRICS_LISTEN_ADDRESS
value: :9500
volumeMounts:
- name: plugin-dir
mountPath: /plugin
Expand Down Expand Up @@ -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
18 changes: 18 additions & 0 deletions deploy/yamls/lvm-driver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -999,6 +1000,8 @@ spec:
value: agent
- name: LVM_NAMESPACE
value: openebs
- name: METRICS_LISTEN_ADDRESS
value: :9500
volumeMounts:
- name: plugin-dir
mountPath: /plugin
Expand Down Expand Up @@ -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

0 comments on commit 96cf642

Please sign in to comment.