Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(charts): move CRDs to a subchart #284

Merged
merged 9 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions .github/workflows/chart-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,36 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v1
uses: azure/setup-helm@v4
with:
version: v3.4.0
version: v3.14.3

- uses: actions/setup-python@v2
- uses: actions/setup-python@v5
with:
python-version: 3.7
python-version: '3.10'
check-latest: true

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.0.1
uses: helm/chart-testing-action@v2.6.1

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --config ct.yaml)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
echo "changed=true" >> $GITHUB_OUTPUT
fi

- name: Run chart-testing (lint)
run: ct lint --config ct.yaml

- name: Create kind cluster
uses: helm/kind-action@v1.2.0
uses: helm/kind-action@v1.9.0
if: steps.list-changed.outputs.changed == 'true'
with:
config: buildscripts/kind_config.yaml
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release-charts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -22,12 +22,12 @@ jobs:
git config user.email "[email protected]"

- name: Install Helm
uses: azure/setup-helm@v1
uses: azure/setup-helm@v4
with:
version: v3.4.0
version: v3.14.3

- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.2.0
uses: helm/chart-releaser-action@v1.6.0
env:
CR_TOKEN: "${{ secrets.CR_TOKEN }}"
with:
Expand Down
1 change: 1 addition & 0 deletions changelogs/unreleased/258-evgkrsk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Change lvm-controller's Kind from StatefulSet to Deployment (#196)
7 changes: 5 additions & 2 deletions deploy/helm/charts/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v2
name: lvm-localpv
description: CSI Driver for dynamic provisioning of LVM Persistent Local Volumes.
version: 1.4.0
appVersion: 1.4.0
version: 1.5.0
appVersion: 1.5.0
icon: https://raw.githubusercontent.com/cncf/artwork/master/projects/openebs/icon/color/openebs-icon-color.png
home: https://openebs.io/
keywords:
Expand All @@ -14,6 +14,9 @@ keywords:
- storage
sources:
- https://github.com/openebs/lvm-localpv
dependencies:
- name: crds
version: "1.5.0"
maintainers:
- name: prateekpandey14
email: [email protected]
Expand Down
28 changes: 15 additions & 13 deletions deploy/helm/charts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ $ helm install [RELEASE_NAME] openebs-lvmlocalpv/lvm-localpv --namespace [NAMESP


**Note:** If moving from the operator to helm
- Make sure the namespace provided in the helm install command is same as `LVM_NAMESPACE` (by default it is `openebs`) env in the controller statefulset.
- Before installing, clean up the stale statefulset and daemonset from `kube-system` namespace using the below commands
- Make sure the namespace provided in the helm install command is same as `LVM_NAMESPACE` (by default it is `openebs`) env in the controller deployment.
- Before installing, clean up the stale deployment and daemonset from `kube-system` namespace using the below commands
```sh
kubectl delete sts openebs-lvm-controller -n kube-system
kubectl delete deployment openebs-lvm-controller -n kube-system
kubectl delete ds openebs-lvm-node -n kube-system
```

Expand Down Expand Up @@ -96,7 +96,8 @@ helm install openebs-lvmlocalpv openebs-lvmlocalpv/lvm-localpv --namespace opene

| Parameter | Description | Default |
|-----------------------------------------------------|----------------------------------------------------------------------------------|-----------------------------------------|
| `imagePullSecrets` | Provides image pull secrect | `""` |
| `crds.csi.volumeSnapshots.enabled` | Enable/Disable installation of VolumeSnapshot-related CRDs | `true` |
| `imagePullSecrets` | Provides image pull secret | `""` |
| `lvmPlugin.image.registry` | Registry for openebs-lvm-plugin image | `""` |
| `lvmPlugin.image.repository` | Image repository for openebs-lvm-plugin | `openebs/lvm-driver` |
| `lvmPlugin.image.pullPolicy` | Image pull policy for openebs-lvm-plugin | `IfNotPresent` |
Expand Down Expand Up @@ -133,15 +134,16 @@ helm install openebs-lvmlocalpv openebs-lvmlocalpv/lvm-localpv --namespace opene
| `lvmController.provisioner.image.repository` | Image repository for csi-provisioner | `sig-storage/csi-provisioner` |
| `lvmController.provisioner.image.pullPolicy` | Image pull policy for csi-provisioner | `IfNotPresent` |
| `lvmController.provisioner.image.tag` | Image tag for csi-provisioner | `v3.5.0` |
| `lvmController.updateStrategy.type` | Update strategy for lvm localpv controller statefulset | `RollingUpdate` |
| `lvmController.annotations` | Annotations for lvm localpv controller statefulset metadata | `""` |
| `lvmController.podAnnotations` | Annotations for lvm localpv controller statefulset's pods metadata | `""` |
| `lvmController.resources` | Resource and request and limit for lvm localpv controller statefulset containers | `""` |
| `lvmController.labels` | Labels for lvm localpv controller statefulset metadata | `""` |
| `lvmController.podLabels` | Appends labels to the lvm localpv controller statefulset pods | `""` |
| `lvmController.nodeSelector` | Nodeselector for lvm localpv controller statefulset pods | `""` |
| `lvmController.tolerations` | lvm localpv controller statefulset's pod toleration values | `""` |
| `lvmController.securityContext` | Seurity context for lvm localpv controller statefulset container | `""` |
| `lvmController.updateStrategy.type` | Update strategy for lvm localpv controller deployment | `RollingUpdate` |
| `lvmController.annotations` | Annotations for lvm localpv controller deployment metadata | `""` |
| `lvmController.podAnnotations` | Annotations for lvm localpv controller deployment's pods metadata | `""` |
| `lvmController.resources` | Resource and request and limit for lvm localpv controller deployment containers | `""` |
| `lvmController.labels` | Labels for lvm localpv controller deployment metadata | `""` |
| `lvmController.podLabels` | Appends labels to the lvm localpv controller deployment pods | `""` |
| `lvmController.nodeSelector` | Nodeselector for lvm localpv controller deployment pods | `""` |
| `lvmController.tolerations` | lvm localpv controller deployment's pod toleration values | `""` |
| `lvmController.topologySpreadConstraints` | lvm localpv controller deployment's pod topologySpreadConstraints values | `""` |
| `lvmController.securityContext` | Security context for lvm localpv controller deployment container | `""` |
| `rbac.pspEnabled` | Enable PodSecurityPolicy | `false` |
| `serviceAccount.lvmNode.create` | Create a service account for lvmnode or not | `true` |
| `serviceAccount.lvmNode.name` | Name for the lvmnode service account | `openebs-lvm-node-sa` |
Expand Down
23 changes: 23 additions & 0 deletions deploy/helm/charts/charts/crds/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
4 changes: 4 additions & 0 deletions deploy/helm/charts/charts/crds/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v2
name: crds
version: 1.5.0
description: A Helm chart that collects CustomResourceDefinitions (CRDs) from lvm-localpv.
17 changes: 17 additions & 0 deletions deploy/helm/charts/charts/crds/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{/*
This returns a "1" if the CRD is absent in the cluster
Usage:
{{- if (include "crdIsAbsent" (list <crd-name>)) -}}
# CRD Yaml
{{- end -}}
*/}}
{{- define "crdIsAbsent" -}}
{{- $crdName := index . 0 -}}
{{- $crd := lookup "apiextensions.k8s.io/v1" "CustomResourceDefinition" "" $crdName -}}
{{- $output := "1" -}}
{{- if $crd -}}
{{- $output = "" -}}
{{- end -}}

{{- $output -}}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{{- if .Values.crd.volumeSnapshot }}
---
{{- if .Values.csi.volumeSnapshots.enabled -}}
{{- $crdName := "volumesnapshotclasses.snapshot.storage.k8s.io" -}}
{{- if (include "crdIsAbsent" (list $crdName)) -}}
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
api-approved.kubernetes.io: https://github.com/kubernetes-csi/external-snapshotter/pull/814
controller-gen.kubebuilder.io/version: v0.11.3
api-approved.kubernetes.io: "https://github.com/kubernetes-csi/external-snapshotter/pull/814"
creationTimestamp: null
name: volumesnapshotclasses.snapshot.storage.k8s.io
spec:
Expand Down Expand Up @@ -42,8 +43,8 @@ spec:
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
deletionPolicy:
description: deletionPolicy determines whether a VolumeSnapshotContent
Expand All @@ -63,8 +64,8 @@ spec:
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
parameters:
additionalProperties:
Expand All @@ -83,42 +84,56 @@ spec:
- jsonPath: .driver
name: Driver
type: string
- description: Determines whether a VolumeSnapshotContent created through the VolumeSnapshotClass should be deleted when its bound VolumeSnapshot is deleted.
- description: Determines whether a VolumeSnapshotContent created through the
VolumeSnapshotClass should be deleted when its bound VolumeSnapshot is deleted.
jsonPath: .deletionPolicy
name: DeletionPolicy
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
# This indicates the v1beta1 version of the custom resource is deprecated.
# API requests to this version receive a warning in the server response.
deprecated: true
# This overrides the default warning returned to clients making v1beta1 API requests.
deprecationWarning: "snapshot.storage.k8s.io/v1beta1 VolumeSnapshotClass is deprecated; use snapshot.storage.k8s.io/v1 VolumeSnapshotClass"
deprecationWarning: snapshot.storage.k8s.io/v1beta1 VolumeSnapshotClass is deprecated;
use snapshot.storage.k8s.io/v1 VolumeSnapshotClass
name: v1beta1
schema:
openAPIV3Schema:
description: VolumeSnapshotClass specifies parameters that a underlying storage system uses when creating a volume snapshot. A specific VolumeSnapshotClass is used by specifying its name in a VolumeSnapshot object. VolumeSnapshotClasses are non-namespaced
description: VolumeSnapshotClass specifies parameters that a underlying storage
system uses when creating a volume snapshot. A specific VolumeSnapshotClass
is used by specifying its name in a VolumeSnapshot object. VolumeSnapshotClasses
are non-namespaced
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
deletionPolicy:
description: deletionPolicy determines whether a VolumeSnapshotContent created through the VolumeSnapshotClass should be deleted when its bound VolumeSnapshot is deleted. Supported values are "Retain" and "Delete". "Retain" means that the VolumeSnapshotContent and its physical snapshot on underlying storage system are kept. "Delete" means that the VolumeSnapshotContent and its physical snapshot on underlying storage system are deleted. Required.
description: deletionPolicy determines whether a VolumeSnapshotContent
created through the VolumeSnapshotClass should be deleted when its bound
VolumeSnapshot is deleted. Supported values are "Retain" and "Delete".
"Retain" means that the VolumeSnapshotContent and its physical snapshot
on underlying storage system are kept. "Delete" means that the VolumeSnapshotContent
and its physical snapshot on underlying storage system are deleted.
Required.
enum:
- Delete
- Retain
type: string
driver:
description: driver is the name of the storage driver that handles this VolumeSnapshotClass. Required.
description: driver is the name of the storage driver that handles this
VolumeSnapshotClass. Required.
type: string
kind:
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
parameters:
additionalProperties:
type: string
description: parameters is a key-value map with storage driver specific parameters for creating snapshots. These values are opaque to Kubernetes.
description: parameters is a key-value map with storage driver specific
parameters for creating snapshots. These values are opaque to Kubernetes.
type: object
required:
- deletionPolicy
Expand All @@ -133,4 +148,5 @@ status:
plural: ""
conditions: []
storedVersions: []
{{- end }}
{{- end -}}
{{- end -}}
Loading