Skip to content

Commit

Permalink
fix(api): updates to handle session timeout, remove LastAccess code
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Skazinski <joseph.skazinski@seagate.com>
  • Loading branch information
jskazinski committed Jul 7, 2021
2 parents 687ea54 + d6699ee commit 14f2066
Show file tree
Hide file tree
Showing 23 changed files with 109 additions and 277 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ test/.env
_legacy

# binaries
seagate-csi-node
seagate-csi-controller
seagate-exos-x-csi-node
seagate-exos-x-csi-controller

# generated documentation
/helm/*/README.md
14 changes: 7 additions & 7 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ build and push:
- docker login -u "$DOCKER_HUB_USER" -p "$DOCKER_HUB_PASSWORD"
script:
- VERSION="$CI_COMMIT_TAG" make push
- docker tag "seagate/seagate-csi:$CI_COMMIT_TAG" seagate/seagate-csi
- docker push seagate/seagate-csi
- docker tag "seagate/seagate-exos-x-csi:$CI_COMMIT_TAG" seagate/seagate-exos-x-csi
- docker push seagate/seagate-exos-x-csi
only:
- tags

Expand All @@ -44,21 +44,21 @@ push helm chart:
- git config --global user.name "Monkeynator"
script:
- git clone --single-branch --branch master git@github.com:seagate/helm-charts.git
- rm -rf ./helm-charts/charts/seagate-csi
- rm -rf ./helm-charts/charts/seagate-exos-x-csi
- cp ./LICENSE ./helm/csi-charts/
- cp -R ./helm/csi-charts ./helm-charts/charts/seagate-csi
- cd ./helm-charts/charts/seagate-csi
- cp -R ./helm/csi-charts ./helm-charts/charts/seagate-exos-x-csi
- cd ./helm-charts/charts/seagate-exos-x-csi
- >
sed -i
-e "s/version: 0\.0\.0-DIRTY/version: ${CI_COMMIT_TAG:1}/g"
-e "s/appVersion: 0\.0\.0-DIRTY/appVersion: $CI_COMMIT_TAG/g"
-e "s/image: seagate\/seagate-csi:0\.0\.0-DIRTY/image: seagate\/seagate-csi:$CI_COMMIT_TAG/g"
-e "s/image: seagate\/seagate-exos-x-csi:0\.0\.0-DIRTY/image: seagate\/seagate-exos-x-csi:$CI_COMMIT_TAG/g"
./Chart.yaml
- helm-docs
- rm ./README.md.gotmpl
- git add --all
- >
git commit -m "bump(seagate-csi): bump chart version to $CI_COMMIT_TAG"
git commit -m "bump(seagate-exos-x-csi): bump chart version to $CI_COMMIT_TAG"
- git push --set-upstream origin master
only:
- tags
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ RUN apt update \
&& apt install -y dosfstools e2fsprogs xfsprogs jfsutils libisns0 open-iscsi kmod multipath-tools \
&& rm -rf /var/lib/apt/lists/*

COPY --from=build /seagate-csi-* /usr/local/bin/
COPY --from=build /seagate-exos-x-csi-* /usr/local/bin/

CMD [ "/usr/local/bin/seagate-csi-controller" ]
CMD [ "/usr/local/bin/seagate-exos-x-csi-controller" ]

ARG version
ARG vcs_ref
Expand Down
12 changes: 6 additions & 6 deletions Dockerfile.local
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ ARG version

RUN echo "package common\nconst Version = \"${version}\"" > ./pkg/common/version.go

COPY seagate-csi-controller /
COPY seagate-csi-node /
COPY seagate-exos-x-csi-controller /
COPY seagate-exos-x-csi-node /
RUN ls -l /

###########################################
Expand All @@ -29,12 +29,12 @@ RUN apt update \
&& apt install -y dosfstools e2fsprogs xfsprogs jfsutils libisns0 open-iscsi kmod multipath-tools \
&& rm -rf /var/lib/apt/lists/*

COPY /seagate-csi-controller /usr/local/bin/
COPY /seagate-csi-node /usr/local/bin/
COPY /seagate-exos-x-csi-controller /usr/local/bin/
COPY /seagate-exos-x-csi-node /usr/local/bin/
RUN ls -l /usr/local/bin/
RUN ls -l /usr/local/bin/seagate-csi-controller
RUN ls -l /usr/local/bin/seagate-exos-x-csi-controller

CMD [ "/usr/local/bin/seagate-csi-controller" ]
CMD [ "/usr/local/bin/seagate-exos-x-csi-controller" ]

ARG version
ARG vcs_ref
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,15 @@ This CSI driver is an open-source project under the Apache 2.0 [license](./LICEN

`iscsid` and `multipathd` must be installed on every node. Check the installation method appropriate for your Linux distribution.
#### Ubuntu installation procedure
- Remove any containers that were running a prior CSI Driver version.
- Install required packages:
```
sudo apt update && sudo apt install open-iscsi scsitools multipath-tools
sudo apt update && sudo apt install open-iscsi scsitools multipath-tools -y
```
- Determine if any packages are required for your filesystem (ext3/ext4/xfs) choice and view current support:
```
cat /proc/filesystems
```
- Install packages for the required filesystem (ext3/ext4/xfs)
- Update /etc/multipath.conf with the following lines:
```
defaults {
Expand Down
2 changes: 1 addition & 1 deletion docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ kubeletPath: /opt/rke/var/lib/kubelet

It's a known fact that when `multipathd` segfaults, it can produce wrong mappings of device paths. When such a multipathed device is mounted, it can result in a corruption of the filesystem. Some checks were added to ensure that the different paths are consistent and lead to the same volume in the appliance.

If you still get this issue, please check that the candidate for the package `multipath-tools` on your host is on the same version as in the container. You can do so by running `apt-cache policy multipath-tools` on your host as well as in the container `multipathd` from one of the pod `seagate-csi-node-server-xxxxx`.
If you still get this issue, please check that the candidate for the package `multipath-tools` on your host is on the same version as in the container. You can do so by running `apt-cache policy multipath-tools` on your host as well as in the container `multipathd` from one of the pod `seagate-exos-x-csi-node-server-xxxxx`.

## When expanding a volume, I get the error "missing API credentials"

Expand Down
2 changes: 1 addition & 1 deletion example/secret-example1.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: Secret
metadata:
name: seagate-csi-secrets
name: seagate-exos-x-csi-secrets
namespace: default
type: Opaque
data:
Expand Down
6 changes: 3 additions & 3 deletions example/snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@ spec:
apiVersion: snapshot.storage.k8s.io/v1beta1
kind: VolumeSnapshotClass
metadata:
name: snapshot-class-seagate-csi
name: snapshot-class-seagate-exos-x-csi
driver: systems.csi.seagate.io
deletionPolicy: Delete
parameters:
csi.storage.k8s.io/snapshotter-secret-name: snapshotter-secrets
csi.storage.k8s.io/snapshotter-secret-namespace: seagate-csi-system
csi.storage.k8s.io/snapshotter-secret-namespace: seagate-exos-x-csi-system
---
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshot
metadata:
name: test-snapshot
spec:
volumeSnapshotClassName: snapshot-class-seagate-csi
volumeSnapshotClassName: snapshot-class-seagate-exos-x-csi
source:
persistentVolumeClaimName: claim
6 changes: 3 additions & 3 deletions example/storage-class.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ metadata:
name: gallium-storage # Choose the name that fits the best with your StorageClass.
parameters:
# Secrets name and namespace, they can be the same for provisioner, controller-publish and controller-expand sections.
csi.storage.k8s.io/provisioner-secret-name: seagate-csi-secrets
csi.storage.k8s.io/provisioner-secret-name: seagate-exos-x-csi-secrets
csi.storage.k8s.io/provisioner-secret-namespace: default
csi.storage.k8s.io/controller-publish-secret-name: seagate-csi-secrets
csi.storage.k8s.io/controller-publish-secret-name: seagate-exos-x-csi-secrets
csi.storage.k8s.io/controller-publish-secret-namespace: default
csi.storage.k8s.io/controller-expand-secret-name: seagate-csi-secrets
csi.storage.k8s.io/controller-expand-secret-name: seagate-exos-x-csi-secrets
csi.storage.k8s.io/controller-expand-secret-namespace: default
fsType: ext4 # Desired filesystem
iqn: iqn.2015-11.com.hpe:storage.msa2040.163639c929 # Gallium 10.235.212.197 Appliance IQN
Expand Down
6 changes: 3 additions & 3 deletions example/storageclass-example1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ metadata:
name: systems-storageclass # Choose the name that fits the best with your StorageClass.
parameters:
# Secrets name and namespace, they can be the same for provisioner, controller-publish and controller-expand sections.
csi.storage.k8s.io/provisioner-secret-name: seagate-csi-secrets
csi.storage.k8s.io/provisioner-secret-name: seagate-exos-x-csi-secrets
csi.storage.k8s.io/provisioner-secret-namespace: default
csi.storage.k8s.io/controller-publish-secret-name: seagate-csi-secrets
csi.storage.k8s.io/controller-publish-secret-name: seagate-exos-x-csi-secrets
csi.storage.k8s.io/controller-publish-secret-namespace: default
csi.storage.k8s.io/controller-expand-secret-name: seagate-csi-secrets
csi.storage.k8s.io/controller-expand-secret-name: seagate-exos-x-csi-secrets
csi.storage.k8s.io/controller-expand-secret-namespace: default
fsType: ext4 # Desired filesystem
iqn: <iqn> # Example Appliance IQN
Expand Down
2 changes: 1 addition & 1 deletion example/testpod-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ fi
#
# 2) Create secrets for the CSI Driver
#
secret=seagate-csi-secrets
secret=seagate-exos-x-csi-secrets

banner "2) kubectl create -f secret-$system.yaml"
runCommand "kubectl create -f secret-$system.yaml"
Expand Down
43 changes: 28 additions & 15 deletions example/testpod-stop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ echo "[] testpod-stop"

banner "Delete Resources"

runCommand "kubectl delete deployment seagate-csi-controller-server"
runCommand "kubectl delete daemonsets seagate-csi-node-server"
runCommand "kubectl delete deployment seagate-exos-x-csi-controller-server"
runCommand "kubectl delete daemonsets seagate-exos-x-csi-node-server"
runCommand "kubectl delete serviceaccounts csi-provisioner"
runCommand "kubectl delete configmaps init-node"
runCommand "kubectl delete clusterrole external-provisioner-runner-systems"
Expand All @@ -16,20 +16,33 @@ runCommand "kubectl delete role external-provisioner-cfg-systems"
runCommand "kubectl delete rolebinding csi-provisioner-role-cfg-systems"

runCommand "helm uninstall test-release"
runCommand "kubectl delete pods test-pod --grace-period=0 --force"
runCommand "kubectl delete secrets seagate-csi-secrets"
runCommand "kubectl delete pvc systems-pvc"
runCommand "kubectl delete secrets seagate-exos-x-csi-secrets"
runCommand "kubectl delete sc systems-storageclass"
runCommand "kubectl delete pods --all"

pv=$(kubectl get pv | grep pv | awk '{print $1}')
if [ ! -z "$pv" ]; then
kubectl patch pv $pv -p '{"metadata": {"finalizers": null}}'
runCommand "kubectl delete pv $pv --grace-period=0 --force"
fi

pvc=$(kubectl get pv | grep pvc | awk '{print $1}')
if [ ! -z "$pvc" ]; then
kubectl patch pv $pvc -p '{"metadata": {"finalizers": null}}'
runCommand "kubectl delete pv $pvc --grace-period=0 --force"
fi

pod=$(kubectl get pod | grep seagate-exos-x-csi-controller | awk '{print $1}')
if [ ! -z "$pod" ]; then
runCommand "kubectl delete pod $pod --grace-period=0 --force"
fi

pod=$(kubectl get pod | grep seagate-exos-x-csi-node | awk '{print $1}')
if [ ! -z "$pod" ]; then
runCommand "kubectl delete pod $pod --grace-period=0 --force"
fi

runCommand "kubectl delete pod test-pod --grace-period=0 --force"

banner "Check Resources"

runCommand "kubectl get configmaps"
runCommand "kubectl get serviceaccounts"
runCommand "kubectl get daemonsets"
runCommand "kubectl get deployments"
runCommand "kubectl get pvc"
runCommand "kubectl get pvc"
runCommand "kubectl get sc"
runCommand "kubectl get secrets"
runCommand "kubectl get pods"
runCommand "kubectl get all"
Loading

0 comments on commit 14f2066

Please sign in to comment.