Skip to content

Commit

Permalink
Cherry-pick #182 and #183 to release/4.1 branch (#231)
Browse files Browse the repository at this point in the history
* Allow specifying additional labels to be applied to all helm chart resources

This is added as a top-level `labels` map within the values file.
If it is populated, these labels will be added to the storageclass.
It is also added to the 'localpv.labels' variable, already included
within every resource besides the storageclass.

Signed-off-by: Andrew Lavery <[email protected]>
Signed-off-by: Niladri Halder <[email protected]>

* Add pod priorityClassName

Signed-off-by: Bernard Gütermann <[email protected]>
Signed-off-by: Niladri Halder <[email protected]>

* refactor(chart): refactor implementation for adding extra labels to all chart resources

Signed-off-by: Niladri Halder <[email protected]>

* refactor(chart): refactor implementation for adding priorityClassName

Signed-off-by: Niladri Halder <[email protected]>

* fix(charts): use the correct slack channel link

Signed-off-by: Niladri Halder <[email protected]>

* chore(changelog): add changelog entries for PRs 182 & 183

Signed-off-by: Niladri Halder <[email protected]>

* ci: pin medyagh/setup-minikube runs to ubuntu-22.04 (#229)

Signed-off-by: Niladri Halder <[email protected]>

---------

Signed-off-by: Andrew Lavery <[email protected]>
Signed-off-by: Niladri Halder <[email protected]>
Signed-off-by: Bernard Gütermann <[email protected]>
Co-authored-by: Andrew Lavery <[email protected]>
Co-authored-by: Bernard Gütermann <[email protected]>
  • Loading branch information
3 people authored Jan 22, 2025
1 parent f66f290 commit 70dfaab
Show file tree
Hide file tree
Showing 16 changed files with 59 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_and_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
flags: unittests

integration-test:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs: ['lint', 'unit-test']
strategy:
matrix:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
flags: unittests

integration-test:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs: ['lint', 'unit-test']
strategy:
matrix:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
flags: unittests

integration-test:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs: ['lint', 'unit-test']
strategy:
matrix:
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
v4.1.3 / 2025-01-22
===================
* Add pod priorityClassName to prevent race condition due to pod eviction ([#182](https://github.com/openebs/dynamic-localpv-provisioner/pull/182),[@bernardgut](https://github.com/bernardgut))
* Allow specifying additional labels to be applied to all helm chart resources ([#183](https://github.com/openebs/dynamic-localpv-provisioner/pull/183),[@laverya](https://github.com/laverya))

v4.1.2 / 2024-11-28
===================
* Fix bug where analytics toggle env configuration doesn't disable analytics ([#211](https://github.com/openebs/dynamic-localpv-provisioner/pull/211),[@emosbaugh](https://github.com/emosbaugh))

v4.1.1 / 2024-09-13
===================
* Update analytics dependency to v0.3.0 ([#200](https://github.com/openebs/dynamic-localpv-provisioner/pull/200),[@niladrih](https://github.com/niladrih))

v4.1.0 / 2024-07-03
===================
* feat(provisioner): update analytics pkg ([#188](https://github.com/openebs/dynamic-localpv-provisioner/pull/188),[@niladrih](https://github.com/niladrih))
Expand Down
1 change: 1 addition & 0 deletions changelogs/released/v4.1.1/200-niladrih
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update analytics dependency to v0.3.0
1 change: 1 addition & 0 deletions changelogs/released/v4.1.2/211-emosbaugh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix bug where analytics toggle env configuration doesn't disable analytics
1 change: 1 addition & 0 deletions changelogs/released/v4.1.3/182-bernardgut
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add pod priorityClassName to prevent race condition due to pod eviction
1 change: 1 addition & 0 deletions changelogs/released/v4.1.3/183-laverya
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
allow specifying additional labels to be applied to all helm chart resources
2 changes: 2 additions & 0 deletions deploy/helm/charts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ helm install openebs-localpv openebs-localpv/localpv-provisioner --namespace ope
| ------------------------------------------- |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------|
| `analytics.enabled` | Enable sending stats to Google Analytics | `true` |
| `analytics.pingInterval` | Duration(hours) between sending ping stat | `24h` |
| `extraLabels` | Additional labels to add to all chart resources | `{}` |
| `helperPod.image.registry` | Registry for helper image | `""` |
| `helperPod.image.repository` | Image for helper pod | `"openebs/linux-utils"` |
| `helperPod.image.pullPolicy` | Pull policy for helper pod | `"IfNotPresent"` |
Expand Down Expand Up @@ -101,6 +102,7 @@ helm install openebs-localpv openebs-localpv/localpv-provisioner --namespace ope
| `localpv.replicas` | No. of LocalPV Provisioner replica | `1` |
| `localpv.enableLeaderElection` | Enable leader election | `true` |
| `localpv.affinity` | LocalPV Provisioner pod affinity | `{}` |
| `localpv.priorityClassName` | Sets priorityClassName in pod | `""` |
| `rbac.create` | Enable RBAC Resources | `true` |
| `rbac.pspEnabled` | Create pod security policy resources | `false` |

Expand Down
2 changes: 1 addition & 1 deletion deploy/helm/charts/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ blockdevices attached to the Kubernetes cluster nodes.
Get started with the Dynamic LocalPV Provisioner Quickstart guide at:
https://github.com/openebs/dynamic-localpv-provisioner/blob/develop/docs/quickstart.md

For more information, visit our Slack at https://openebs.io/community or view
For more information, visit our Slack at https://kubernetes.slack.com/messages/openebs or view
the OpenEBS documentation online at https://openebs.io/docs
1 change: 0 additions & 1 deletion deploy/helm/charts/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ Common labels
{{ include "localpv.componentLabels" . }}
{{- end -}}


{{/*
Create the name of the service account to use
*/}}
Expand Down
11 changes: 10 additions & 1 deletion deploy/helm/charts/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ metadata:
{{- end }}
labels:
{{- include "localpv.labels" . | nindent 4 }}
{{- if .Values.extraLabels -}}
{{- toYaml .Values.extraLabels | nindent 4 }}
{{- end }}
spec:
replicas: {{ .Values.localpv.replicas }}
strategy:
Expand All @@ -23,10 +26,16 @@ spec:
{{- end }}
labels:
{{- include "localpv.labels" . | nindent 8 }}
{{- if .Values.extraLabels -}}
{{- toYaml .Values.extraLabels | nindent 8 }}
{{- end }}
{{- with .Values.localpv.podLabels }}
{{ toYaml . | nindent 8 }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.localpv.priorityClassName }}
priorityClassName: {{ . }}
{{- end }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
Expand Down
3 changes: 3 additions & 0 deletions deploy/helm/charts/templates/hostpath-class.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ metadata:
{{- if .Values.hostpathClass.isDefaultClass }}
storageclass.kubernetes.io/is-default-class: "true"
{{- end }}
{{- if .Values.extraLabels }}
labels: {{- toYaml .Values.extraLabels | nindent 4 -}}
{{- end }}
provisioner: openebs.io/local
volumeBindingMode: WaitForFirstConsumer
reclaimPolicy: {{ .Values.hostpathClass.reclaimPolicy }}
Expand Down
3 changes: 3 additions & 0 deletions deploy/helm/charts/templates/psp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ metadata:
{{- end }}
labels:
{{- include "localpv.labels" . | nindent 4 }}
{{- if .Values.extraLabels -}}
{{- toYaml .Values.extraLabels | nindent 4 }}
{{- end }}
spec:
privileged: {{ .Values.localpv.privileged }}
allowPrivilegeEscalation: true
Expand Down
15 changes: 15 additions & 0 deletions deploy/helm/charts/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ metadata:
name: {{ include "localpv.serviceAccountName" . }}
labels:
{{- include "localpv.labels" . | nindent 4 }}
{{- if .Values.extraLabels -}}
{{- toYaml .Values.extraLabels | nindent 4 }}
{{- end }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand All @@ -21,6 +24,9 @@ metadata:
{{- end }}
labels:
{{- include "localpv.labels" . | nindent 4 }}
{{- if .Values.extraLabels -}}
{{- toYaml .Values.extraLabels | nindent 4 }}
{{- end }}
rules:
- apiGroups: ["*"]
resources: ["nodes"]
Expand Down Expand Up @@ -55,6 +61,9 @@ metadata:
{{- end }}
labels:
{{- include "localpv.labels" . | nindent 4 }}
{{- if .Values.extraLabels -}}
{{- toYaml .Values.extraLabels | nindent 4 }}
{{- end }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
Expand All @@ -74,6 +83,9 @@ metadata:
{{- end }}
labels:
{{- include "localpv.labels" . | nindent 4 }}
{{- if .Values.extraLabels -}}
{{- toYaml .Values.extraLabels | nindent 4 }}
{{- end }}
rules:
- apiGroups: ['policy']
resources: ['podsecuritypolicies']
Expand All @@ -90,6 +102,9 @@ metadata:
{{- end }}
labels:
{{- include "localpv.labels" . | nindent 4 }}
{{- if .Values.extraLabels -}}
{{- toYaml .Values.extraLabels | nindent 4 }}
{{- end }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
Expand Down
5 changes: 5 additions & 0 deletions deploy/helm/charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ localpv:
tolerations: []
affinity: {}
securityContext: {}
## Sets priorityClassName in pod
priorityClassName: ""

imagePullSecrets:
# - name: img-pull-secret
Expand Down Expand Up @@ -117,6 +119,9 @@ helperPod:
# Overrides the image tag whose default is the chart appVersion.
tag: 4.0.0

# Additional labels to add to all chart resources
extraLabels: {}

analytics:
enabled: true
# Specify in hours the duration after which a ping event needs to be sent.
Expand Down

0 comments on commit 70dfaab

Please sign in to comment.