Skip to content

Commit

Permalink
revert!: disable device localpv (#172)
Browse files Browse the repository at this point in the history
* revert!: disable device localpv

Signed-off-by: Abhinandan Purkait <[email protected]>

* fix: google.golang.org/protobuf version

Signed-off-by: Abhinandan Purkait <[email protected]>

---------

Signed-off-by: Abhinandan Purkait <[email protected]>
  • Loading branch information
Abhinandan-Purkait committed Mar 21, 2024
1 parent 4123f5f commit 24fd7cd
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 944 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,11 @@ jobs:
run: |
sudo apt-get update && sudo apt-get install -y xfsprogs quota linux-modules-extra-`uname -r`
go install github.com/onsi/ginkgo/[email protected]
sudo fallocate -l 2.5GiB /mnt/disk.img
sed -e "/path-filter/{N;N;N;s|\"\"|\"$(sudo losetup -fP /mnt/disk.img --show)\"|}" -e '/path-filter/{N;N;N;N;s|/dev/loop,||}' -e '/openebs-provisioner-hostpath/{N;s/IfNotPresent/Never/}' deploy/kubectl/openebs-operator-lite.yaml | kubectl apply -f -
sed -e '/openebs-provisioner-hostpath/{N;s/IfNotPresent/Never/}' deploy/kubectl/openebs-operator-lite.yaml | kubectl apply -f -
- name: Integration test
run: |
make integration-test
make hostpath-integration-test
localpv-e2e:
# to ignore builds on release AND build only if the branch is develop
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/chart-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,5 @@ jobs:
uses: helm/[email protected]
if: steps.list-changed.outputs.changed == 'true'

- name: Add dependency chart repos
run: |
helm repo add openebs-ndm https://openebs.github.io/node-disk-manager
helm repo update
- name: Run chart-testing (install)
run: ct install --config ct.yaml
5 changes: 2 additions & 3 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,11 @@ jobs:
run: |
sudo apt-get update && sudo apt-get install -y xfsprogs quota linux-modules-extra-`uname -r`
go install github.com/onsi/ginkgo/[email protected]
sudo fallocate -l 2.5GiB /mnt/disk.img
sed -e "/path-filter/{N;N;N;s|\"\"|\"$(sudo losetup -fP /mnt/disk.img --show)\"|}" -e '/path-filter/{N;N;N;N;s|/dev/loop,||}' -e '/openebs-provisioner-hostpath/{N;s/IfNotPresent/Never/}' deploy/kubectl/openebs-operator-lite.yaml | kubectl apply -f -
sed -e '/openebs-provisioner-hostpath/{N;s/IfNotPresent/Never/}' deploy/kubectl/openebs-operator-lite.yaml | kubectl apply -f -
- name: Integration test
run: |
make integration-test
make hostpath-integration-test
localpv-e2e:
runs-on: ubuntu-latest
Expand Down
5 changes: 0 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,6 @@ testv: format
integration-test:
@cd tests && sudo -E env "PATH=${PATH}" ginkgo -v -failFast

# Requires KUBECONFIG env and Ginkgo binary
.PHONY: device-integration-test
device-integration-test:
@cd tests && sudo -E env "PATH=${PATH}" ginkgo -skip="TEST HOSTPATH.*" -v -failFast

# Requires KUBECONFIG env and Ginkgo binary
.PHONY: hostpath-integration-test
hostpath-integration-test:
Expand Down
26 changes: 7 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,33 +32,21 @@ Some of the targetted applications are:
## Overview

Kubernetes Local persistent volumes allows users to access local storage through the
standard PVC interface in a simple and portable way. The PV contains node
standard PVC interface in a simple and portable way. The PV contains node
affinity information that the system uses to schedule pods to the correct
nodes.

OpenEBS Dynamic Local PVs extends the capabilities provided by the Kubernetes Local PV
by making use of the OpenEBS Node Storage Disk Manager (NDM), the significant
differences include:
- Users need not pre-format and mount the devices in the node.
- Supports Dynamic Local PVs - where the devices can be used by CAS solutions
and also by applications. CAS solutions typically directly access a device.
OpenEBS Local PV ease the management of storage devices to be used between
CAS solutions (direct access) and applications (via PV), by making use of
BlockDeviceClaims supported by OpenEBS NDM.
nodes. Features:

- Supports using hostpath as well for provisioning a Local PV. In fact in some
cases, the Kubernetes nodes may have limited number of storage devices
attached to the node and hostpath based Local PVs offer efficient management
of the storage available on the node.

## Kubernetes Compatibility Matrix

| | Kubernetes <= 1.15 | Kubernetes 1.16 | Kubernetes 1.17 | Kubernetes 1.18 | Kubernetes 1.19 | Kubernetes 1.20 | Kubernetes 1.21 | Kubernetes 1.22 | Kubernetes 1.23 | Kubernetes 1.24 | Kubernetes 1.25 | Kubernetes 1.26 | Kubernetes 1.27 |
|----------|--------------------|-----------------|-----------------|-----------------|-----------------|-----------------|-----------------|-----------------|-----------------|-----------------|-----------------|-----------------|-----------------|
| `v3.3.x` ||||||||||||||
| `v3.4.x` ||||||||||||||
| `v3.5.x` ||||||||||||||
| `HEAD` ||||||||||||||

| | Kubernetes <= 1.18 | Kubernetes 1.19 | Kubernetes 1.20 | Kubernetes 1.21 | Kubernetes 1.22 | Kubernetes 1.23 | Kubernetes 1.24 | Kubernetes 1.25 | Kubernetes 1.26 | Kubernetes 1.27 |
|----------|--------------------|------------------|-----------------|-----------------|-----------------|-----------------|-----------------|-----------------|-----------------|-----------------|
| `v4.0.x` |||||||||||
| `HEAD` |||||||||||

## Install

Expand Down
2 changes: 1 addition & 1 deletion buildscripts/provisioner-localpv/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#See the License for the specific language governing permissions and
#limitations under the License.
#
FROM alpine:3.14.8
FROM alpine:3.14.10

RUN apk add --no-cache \
iproute2 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ COPY . .

RUN make provisioner-localpv

FROM alpine:3.14.8
FROM alpine:3.14.10

ARG DBUILD_DATE
ARG DBUILD_REPO_URL
Expand Down
1 change: 1 addition & 0 deletions changelogs/unreleased/v4.0.0/172-Abhinandan-Purkait
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
disable localpv device
19 changes: 2 additions & 17 deletions cmd/provisioner-localpv/app/provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,7 @@ func (p *Provisioner) Provision(ctx context.Context, opts pvController.Provision
}
sendEventOrIgnore(pvc.Name, name, size.String(), stgType, analytics.VolumeProvision)

// StorageType: Device
if stgType == "device" {
return p.ProvisionBlockDevice(ctx, opts, pvCASConfig)
}
// todo: Disable the localpv device provisioning for now. Revisit later to remove the code path.

// EXCEPTION: Block VolumeMode
if *opts.PVC.Spec.VolumeMode == v1.PersistentVolumeBlock && stgType != "device" {
Expand Down Expand Up @@ -184,19 +181,7 @@ func (p *Provisioner) Delete(ctx context.Context, pv *v1.PersistentVolume) (err
pvcName = pv.Spec.ClaimRef.Name
}
sendEventOrIgnore(pvcName, pv.Name, size.String(), pvType, analytics.VolumeDeprovision)
if pvType == "local-device" {
err := p.DeleteBlockDevice(ctx, pv)
if err != nil {
alertlog.Logger.Errorw("",
"eventcode", "local.pv.delete.failure",
"msg", "Failed to delete Local PV",
"rname", pv.Name,
"reason", "failed to delete block device",
"storagetype", pvType,
)
}
return err
}
// todo: Disable the localpv device deprovisioning for now. Revisit later to remove the code path.

err = p.DeleteHostPath(ctx, pv)
if err != nil {
Expand Down
4 changes: 0 additions & 4 deletions cmd/provisioner-localpv/app/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@ func StartProvisioner() (*cobra.Command, error) {
},
}

// Add flags to the cobra command's FlagSet
cmd.Flags().IntVar(&WaitForBDTimeoutCounts, "bd-time-out", 12,
"Specifies the no. of 5s intervals to wait for BDC to be associated with a BD")

return cmd, nil
}

Expand Down
8 changes: 0 additions & 8 deletions deploy/kubectl/hostpath-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ spec:
- name: openebs-provisioner-hostpath
imagePullPolicy: IfNotPresent
image: openebs/provisioner-localpv:ci
args:
- "--bd-time-out=$(BDC_BD_BIND_RETRIES)"
env:
# OPENEBS_IO_K8S_MASTER enables openebs provisioner to connect to K8s
# based on this address. This is ignored if empty.
Expand All @@ -90,12 +88,6 @@ spec:
# This is supported for openebs provisioner version 0.5.2 onwards
#- name: OPENEBS_IO_KUBE_CONFIG
# value: "/home/ubuntu/.kube/config"
# This sets the number of times the provisioner should try
# with a polling interval of 5 seconds, to get the Blockdevice
# Name from a BlockDeviceClaim, before the BlockDeviceClaim
# is deleted. E.g. 12 * 5 seconds = 60 seconds timeout
- name: BDC_BD_BIND_RETRIES
value: "12"
- name: NODE_NAME
valueFrom:
fieldRef:
Expand Down
Loading

0 comments on commit 24fd7cd

Please sign in to comment.