Skip to content

Commit 76b21e4

Browse files
feat(helm): add openebs localpv helm charts (#14)
an initial version of the openebs local pv charts. Signed-off-by: prateekpandey14 <[email protected]>
1 parent 3dca1b5 commit 76b21e4

File tree

13 files changed

+675
-1
lines changed

13 files changed

+675
-1
lines changed

.github/workflows/chart-lint-test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,10 @@ jobs:
4848
uses: helm/[email protected]
4949
if: steps.list-changed.outputs.changed == 'true'
5050

51+
- name: Add dependency chart repos
52+
run: |
53+
helm repo add openebs-ndm https://openebs.github.io/node-disk-manager
54+
helm repo update
55+
5156
- name: Run chart-testing (install)
5257
run: ct install --config ct.yaml

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
name: release
1616

1717
on:
18-
create:
18+
push:
1919
tags:
2020
- 'v*'
2121

deploy/helm/charts/.helmignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

deploy/helm/charts/Chart.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
apiVersion: v2
2+
name: localpv-provisioner
3+
description: A Helm chart for openebs dynamic localpv provisioner
4+
type: application
5+
# This is the chart version. This version number should be incremented each time you make changes
6+
# to the chart and its templates, including the app version.
7+
version: 2.4.0
8+
# This is the version number of the application being deployed. This version number should be
9+
# incremented each time you make changes to the application.
10+
appVersion: 2.4.0
11+
icon: https://raw.githubusercontent.com/cncf/artwork/master/projects/openebs/icon/color/openebs-icon-color.png
12+
home: http://www.openebs.io/
13+
keywords:
14+
- storage
15+
- local
16+
- dynamic-localpv
17+
sources:
18+
- https://github.com/openebs/dynamic-localpv-provisioner
19+
20+
dependencies:
21+
- name: openebs-ndm
22+
version: "1.0.2"
23+
repository: "https://openebs.github.io/node-disk-manager"
24+
condition: openebsNDM.enabled
25+
26+
maintainers:
27+
- name: akhilerm
28+
29+
- name: kiranmova
30+
31+
- name: prateekpandey14
32+

deploy/helm/charts/README.md

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# OpenEBS LocalPV Provisioner
2+
3+
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
4+
![Chart Lint and Test](https://github.com/openebs/dynamic-localpv-provisioner/workflows/Chart%20Lint%20and%20Test/badge.svg)
5+
![Release Charts](https://github.com/openebs/dynamic-localpv-provisioner/workflows/Release%20Charts/badge.svg?branch=develop)
6+
7+
A Helm chart for openebs dynamic localpv provisioner. This chart bootstraps OpenEBS Dynamic LocalPV provisioner deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
8+
9+
10+
**Homepage:** <http://www.openebs.io/>
11+
12+
## Maintainers
13+
14+
| Name | Email | Url |
15+
| ---- | ------ | --- |
16+
| akhilerm | [email protected] | |
17+
| kiranmova | [email protected] | |
18+
| prateekpandey14 | [email protected] | |
19+
20+
21+
## Get Repo Info
22+
23+
```console
24+
helm repo add openebs-localpv https://openebs.github.io/dynamic-localpv-provisioner
25+
helm repo update
26+
```
27+
28+
_See [helm repo](https://helm.sh/docs/helm/helm_repo/) for command documentation._
29+
30+
## Install Chart
31+
32+
Please visit the [link](https://openebs.github.io/dynamic-localpv-provisioner/) for install instructions via helm3.
33+
34+
```console
35+
# Helm
36+
$ helm install [RELEASE_NAME] openebs-localpv/localpv-provisioner
37+
```
38+
39+
_See [configuration](#configuration) below._
40+
41+
_See [helm install](https://helm.sh/docs/helm/helm_install/) for command documentation._
42+
43+
## Dependencies
44+
45+
By default this chart installs additional, dependent charts:
46+
47+
| Repository | Name | Version |
48+
|------------|------|---------|
49+
| https://openebs.github.io/node-disk-manager | openebs-ndm | 1.0.2 |
50+
51+
52+
To disable the dependency during installation, set `openebsNDM.enabled` to `false`.
53+
54+
_See [helm dependency](https://helm.sh/docs/helm/helm_dependency/) for command documentation._
55+
56+
## Uninstall Chart
57+
58+
```console
59+
# Helm
60+
$ helm uninstall [RELEASE_NAME]
61+
```
62+
63+
This removes all the Kubernetes components associated with the chart and deletes the release.
64+
65+
_See [helm uninstall](https://helm.sh/docs/helm/helm_uninstall/) for command documentation._
66+
67+
## Upgrading Chart
68+
69+
```console
70+
# Helm
71+
$ helm upgrade [RELEASE_NAME] [CHART] --install
72+
```
73+
74+
75+
## Configuration
76+
77+
The following table lists the configurable parameters of the OpenEBS LocalPV Provisioner chart and their default values.
78+
79+
| Parameter | Description | Default |
80+
| ------------------------------------------- | --------------------------------------------- | ----------------------------------------- |
81+
| `release.version` | LocalPV Provisioner release version | `2.4.0` |
82+
| `analytics.enabled` | Enable sending stats to Google Analytics | `true` |
83+
| `analytics.pingInterval` | Duration(hours) between sending ping stat | `24h` |
84+
| `imagePullSecrets` | Provides image pull secrect | `""` |
85+
| `localpv.enabled` | Enable LocalPV Provisioner | `true` |
86+
| `localpv.image.registry` | Registry for LocalPV Provisioner image | `""` |
87+
| `localpv.image.repository` | Image repository for LocalPV Provisioner | `openebs/localpv-provisioner` |
88+
| `localpv.image.pullPolicy` | Image pull policy for LocalPV Provisioner | `IfNotPresent` |
89+
| `localpv.image.tag` | Image tag for LocalPV Provisioner | `2.4.0` |
90+
| `localpv.updateStrategy.type` | Update strategy for LocalPV Provisioner | `RollingUpdate` |
91+
| `localpv.annotations` | Annotations for LocalPV Provisioner metadata | `""` |
92+
| `localpv.podAnnotations` | Annotations for LocalPV Provisioner pods metadata | `""` |
93+
| `localpv.privileged` | Run LocalPV Provisioner with extra privileges | `true` |
94+
| `localpv.resources` | Resource and request and limit for containers | `""` |
95+
| `localpv.podLabels` | Appends labels to the pods | `""` |
96+
| `localpv.nodeSelector` | Nodeselector for LocalPV Provisioner pods | `""` |
97+
| `localpv.tolerations` | LocalPV Provisioner pod toleration values | `""` |
98+
| `localpv.securityContext` | Seurity context for container | `""` |
99+
| `localpv.healthCheck.initialDelaySeconds` | Delay before liveness probe is initiated | `30` |
100+
| `localpv.healthCheck.periodSeconds` | How often to perform the liveness probe | `60` |
101+
| `localpv.replicas` | No. of LocalPV Provisioner replica | `1` |
102+
| `localpv.enableLeaderElection` | Enable leader election | `true` |
103+
| `localpv.basePath` | BasePath for hostPath volumes on Nodes | `"/var/openebs/local"` |
104+
| `localpv.affinity` | LocalPV Provisioner pod affinity | `{}` |
105+
| `helperPod.image.registry` | Registry for helper image | `""` |
106+
| `helperPod.image.repository` | Image for helper pod | `"openebs/linux-utils"` |
107+
| `helperPod.image.pullPolicy` | Pull policy for helper pod | `"IfNotPresent"` |
108+
| `helperPod.image.tag` | Image tag for helper image | `2.4.0` |
109+
| `rbac.create` | Enable RBAC Resources | `true` |
110+
| `rbac.pspEnabled` | Create pod security policy resources | `false` |
111+
| `openebsNDM.enabled` | Install openebs NDM dependency | `true` |
112+
113+
114+
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.
115+
116+
Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,
117+
118+
```bash
119+
helm install <release-name> -f values.yaml --namespace openebs localpv-provisioner
120+
```
121+
122+
> **Tip**: You can use the default [values.yaml](values.yaml)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
The OpenEBS localPV Provisioner has been installed check its status by running:
2+
$ kubectl get pods -n {{ .Release.Namespace }}
3+
4+
Use `kubectl get bd -n {{ .Release.Namespace }} ` to see the list of
5+
blockdevices attached to the Kubernetes cluster nodes.
6+
7+
For more information, visit our Slack at https://openebs.io/community or view
8+
the documentation online at http://docs.openebs.io/.
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
{{/* vim: set filetype=mustache: */}}
2+
{{/*
3+
Expand the name of the chart.
4+
*/}}
5+
{{- define "localpv.name" -}}
6+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
7+
{{- end -}}
8+
9+
{{/*
10+
Create a default fully qualified localpv provisioner name.
11+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
12+
If release name contains chart name it will be used as a full name.
13+
*/}}
14+
{{- define "localpv.fullname" -}}
15+
{{- if .Values.fullnameOverride -}}
16+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
17+
{{- else -}}
18+
{{- $name := default .Chart.Name .Values.nameOverride -}}
19+
{{- if contains $name .Release.Name -}}
20+
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
21+
{{- else -}}
22+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
23+
{{- end -}}
24+
{{- end -}}
25+
{{- end -}}
26+
27+
{{/*
28+
Create chart name and version as used by the chart label.
29+
*/}}
30+
{{- define "localpv.chart" -}}
31+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
32+
{{- end -}}
33+
34+
35+
{{/*
36+
Meta labels
37+
*/}}
38+
{{- define "localpv.common.metaLabels" -}}
39+
chart: {{ template "localpv.chart" . }}
40+
heritage: {{ .Release.Service }}
41+
openebs.io/version: {{ .Values.release.version | quote }}
42+
{{- end -}}
43+
44+
{{/*
45+
Selector labels
46+
*/}}
47+
{{- define "localpv.selectorLabels" -}}
48+
app: {{ template "localpv.name" . }}
49+
release: {{ .Release.Name }}
50+
component: {{ .Values.localpv.name | quote }}
51+
{{- end -}}
52+
53+
{{/*
54+
Component labels
55+
*/}}
56+
{{- define "localpv.componentLabels" -}}
57+
openebs.io/component-name: openebs-{{ .Values.localpv.name }}
58+
{{- end -}}
59+
60+
{{/*
61+
Common labels
62+
*/}}
63+
{{- define "localpv.labels" -}}
64+
{{ include "localpv.common.metaLabels" . }}
65+
{{ include "localpv.selectorLabels" . }}
66+
{{ include "localpv.componentLabels" . }}
67+
{{- end -}}
68+
69+
70+
{{/*
71+
Create the name of the service account to use
72+
*/}}
73+
{{- define "localpv.serviceAccountName" -}}
74+
{{- if .Values.serviceAccount.create -}}
75+
{{ default (include "localpv.fullname" .) .Values.serviceAccount.name }}
76+
{{- else -}}
77+
{{ default "default" .Values.serviceAccount.name }}
78+
{{- end -}}
79+
{{- end -}}
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
{{- if .Values.localpv.enabled }}
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: {{ template "localpv.fullname" . }}
6+
{{- with .Values.localpv.annotations }}
7+
annotations: {{ toYaml . | nindent 4 }}
8+
{{- end }}
9+
labels:
10+
{{- include "localpv.labels" . | nindent 4 }}
11+
spec:
12+
replicas: {{ .Values.localpv.replicas }}
13+
strategy:
14+
type: "Recreate"
15+
rollingUpdate: null
16+
selector:
17+
matchLabels:
18+
{{- include "localpv.selectorLabels" . | nindent 6 }}
19+
template:
20+
metadata:
21+
{{- with .Values.localpv.podAnnotations }}
22+
annotations: {{ toYaml . | nindent 8 }}
23+
{{- end }}
24+
labels:
25+
{{- include "localpv.labels" . | nindent 8 }}
26+
{{- with .Values.localpv.podLabels }}
27+
{{ toYaml . | nindent 8 }}
28+
{{- end }}
29+
spec:
30+
{{- with .Values.imagePullSecrets }}
31+
imagePullSecrets:
32+
{{- toYaml . | nindent 8 }}
33+
{{- end }}
34+
serviceAccountName: {{ template "localpv.serviceAccountName" . }}
35+
securityContext:
36+
{{- toYaml .Values.podSecurityContext | nindent 8 }}
37+
containers:
38+
- name: {{ template "localpv.fullname" . }}
39+
image: "{{ .Values.localpv.image.registry }}{{ .Values.localpv.image.repository }}:{{ .Values.localpv.image.tag }}"
40+
imagePullPolicy: {{ .Values.localpv.image.pullPolicy }}
41+
resources:
42+
{{ toYaml .Values.localpv.resources | indent 10 }}
43+
env:
44+
# OPENEBS_IO_K8S_MASTER enables openebs provisioner to connect to K8s
45+
# based on this address. This is ignored if empty.
46+
# This is supported for openebs provisioner version 0.5.2 onwards
47+
#- name: OPENEBS_IO_K8S_MASTER
48+
# value: "http://10.128.0.12:8080"
49+
# OPENEBS_IO_KUBE_CONFIG enables openebs provisioner to connect to K8s
50+
# based on this config. This is ignored if empty.
51+
# This is supported for openebs provisioner version 0.5.2 onwards
52+
#- name: OPENEBS_IO_KUBE_CONFIG
53+
# value: "/home/ubuntu/.kube/config"
54+
# OPENEBS_NAMESPACE is the namespace that this provisioner will
55+
# lookup to find maya api service
56+
- name: OPENEBS_NAMESPACE
57+
valueFrom:
58+
fieldRef:
59+
fieldPath: metadata.namespace
60+
- name: NODE_NAME
61+
valueFrom:
62+
fieldRef:
63+
fieldPath: spec.nodeName
64+
# OPENEBS_SERVICE_ACCOUNT provides the service account of this pod as
65+
# environment variable
66+
- name: OPENEBS_SERVICE_ACCOUNT
67+
valueFrom:
68+
fieldRef:
69+
fieldPath: spec.serviceAccountName
70+
# OPENEBS_IO_BASE_PATH is the environment variable that provides the
71+
# default base path on the node where host-path PVs will be provisioned.
72+
- name: OPENEBS_IO_ENABLE_ANALYTICS
73+
value: "{{ .Values.analytics.enabled }}"
74+
- name: OPENEBS_IO_BASE_PATH
75+
value: "{{ .Values.localpv.basePath }}"
76+
- name: OPENEBS_IO_HELPER_IMAGE
77+
value: "{{ .Values.helperPod.image.registry }}{{ .Values.helperPod.image.repository }}:{{ .Values.localpv.image.tag }}"
78+
- name: OPENEBS_IO_INSTALLER_TYPE
79+
value: "charts-helm"
80+
# LEADER_ELECTION_ENABLED is used to enable/disable leader election. By default
81+
# leader election is enabled.
82+
- name: LEADER_ELECTION_ENABLED
83+
value: "{{ .Values.localpv.enableLeaderElection }}"
84+
# Process name used for matching is limited to the 15 characters
85+
# present in the pgrep output.
86+
# So fullname can't be used here with pgrep (>15 chars).A regular expression
87+
# that matches the entire command name has to specified.
88+
# Anchor `^` : matches any string that starts with `provisioner-loc`
89+
# `.*`: matches any string that has `provisioner-loc` followed by zero or more char
90+
livenessProbe:
91+
exec:
92+
command:
93+
- sh
94+
- -c
95+
- test `pgrep -c "^provisioner-loc.*"` = 1
96+
initialDelaySeconds: {{ .Values.localpv.healthCheck.initialDelaySeconds }}
97+
periodSeconds: {{ .Values.localpv.healthCheck.periodSeconds }}
98+
{{- if .Values.localpv.nodeSelector }}
99+
nodeSelector:
100+
{{ toYaml .Values.localpv.nodeSelector | indent 8 }}
101+
{{- end }}
102+
{{- if .Values.localpv.tolerations }}
103+
tolerations:
104+
{{ toYaml .Values.localpv.tolerations | indent 8 }}
105+
{{- end }}
106+
{{- if .Values.localpv.affinity }}
107+
affinity:
108+
{{ toYaml .Values.localpv.affinity | indent 8 }}
109+
{{- end }}
110+
{{- end }}

0 commit comments

Comments
 (0)