Skip to content

Commit

Permalink
certification automation, Helm chart formatting compatible with yq, a…
Browse files Browse the repository at this point in the history
…nd README updates
  • Loading branch information
seagate-chris authored and David-T-White committed Jun 1, 2023
1 parent 71c7426 commit 2b44525
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 30 deletions.
43 changes: 37 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ endif
ifdef VERSION
VERSION := $(VERSION)
else
VERSION := v1.5.9
VERSION := v1.6.3
endif
HELM_VERSION := $(subst v,,$(VERSION))
VERSION_FLAG = -X $(GITHUB_URL)/pkg/common.Version=$(VERSION)
Expand Down Expand Up @@ -103,6 +103,11 @@ push:
@echo "[] push"
docker push $(IMAGE)

pull:
@echo ""
@echo "[] pull"
docker pull $(IMAGE)

clean:
@echo ""
@echo "[] clean"
Expand All @@ -121,21 +126,47 @@ openshift:
docker build -f Dockerfile.redhat -t $(IMAGE) .
docker inspect $(IMAGE)

# Makefile.secrets should include the following lines:
#
# PYXIS_API_TOKEN=<pyxis-api-token>
# REGISTRY_KEY=<redhat-registry-key> (see )
#
# For more info, see the CSI Driver "Re-certifying" OneNote page, or
# https://connect.redhat.com/account/api-keys?extIdCarryOver=true&sc_cid=701f2000001OH7JAAW
# https://connect.redhat.com/projects/610494ea40182fa9651cdab0/setup-preflight
#
# Make sure this file does not get checked in to git! Note that for automation purposes you can
# just pass these variables in the environment instead of a file.
-include Makefile.secrets

PREFLIGHT=../openshift-preflight/preflight
PREFLIGHT_REGISTRY=localhost:5000
PREFLIGHT_IMAGE=$(PREFLIGHT_REGISTRY)/$(BIN):$(VERSION)
# PREFLIGHT_OPTIONS would typically include "--certification-project-id=xxx --pyxis-api-token=xxx"
PREFLIGHT_OPTIONS:=$(strip $(shell test ! -f .preflight_options || cat .preflight_options))
REDHAT_PROJECT_ID=610494ea40182fa9651cdab0
REDHAT_IMAGE_BASE=quay.io/redhat-isv-containers/$(REDHAT_PROJECT_ID)
REDHAT_IMAGE=$(REDHAT_IMAGE_BASE):$(VERSION)
REDHAT_IMAGE_LATEST=$(REDHAT_IMAGE_BASE):latest
PREFLIGHT_OPTIONS=
PREFLIGHT_SUBMIT=

preflight:
-docker run -d -p 5000:5000 --name registry registry:2 # make sure local registry is running
docker tag $(IMAGE) $(PREFLIGHT_IMAGE)
docker push $(PREFLIGHT_IMAGE)
$(PREFLIGHT) check container $(PREFLIGHT_SUBMIT) $(PREFLIGHT_OPTIONS) $(PREFLIGHT_IMAGE)
$(PREFLIGHT) check container $(PREFLIGHT_SUBMIT) $(PREFLIGHT_OPTIONS) $(PREFLIGHT_IMAGE) \
PFLT_DOCKERCONFIG=$(PFLT_DOCKERCONFIG)

preflight-submit: .preflight-auth.json
$(MAKE) preflight PREFLIGHT_SUBMIT="--submit" \
PREFLIGHT_OPTIONS="--pyxis-api-token=$(PYXIS_API_TOKEN) --certification-project-id=$(REDHAT_PROJECT_ID)" \
PREFLIGHT_IMAGE=$(REDHAT_IMAGE) PFLT_DOCKERCONFIG=.preflight-auth.json

tag-latest:
podman tag $(REDHAT_IMAGE) $(REDHAT_IMAGE_LATEST)
podman push $(REDHAT_IMAGE_LATEST)

preflight-submit: .preflight_options
$(MAKE) preflight PREFLIGHT_SUBMIT=--submit
.preflight-auth.json:
podman login -u redhat-isv-containers+610494ea40182fa9651cdab0-robot -p $(REGISTRY_KEY) --authfile "$@" quay.io

build-preflight:
(cd ..; git clone https://github.com/redhat-openshift-ecosystem/openshift-preflight.git)
Expand Down
44 changes: 35 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,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. The
example below shows steps for Ubuntu Server.
example below shows steps for Ubuntu Server but the process will be
very similar for other GNU/Linux distributions.

#### Ubuntu Installation procedure
- Remove any containers that were running an earlier version of the Seagate Exos X CSI Driver.
- Install required packages:

```
sudo apt update && sudo apt install open-iscsi scsitools multipath-tools -y
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:

Expand All @@ -66,22 +67,47 @@ example below shows steps for Ubuntu Server.
- Restart `multipathd`:

```
service multipath-tools restart
service multipath-tools restart
```

### Deploy the provisioner to your kubernetes cluster

The preferred installation approach is to use the provided `Helm Charts` under the helm folder.
These examples assume you have already installed the [helm]() command.

The easiest method for installing the driver is to use Helm to install
the helm package from
[Github](https://github.com/seagate/seagate-exos-x-csi/releases). On
the Releases page, right-click on the Helm Package and select "Copy
Link Address". Choose a namespace in which to run
the driver (in this example, _seagate_), and a name for the
application (_exos-x-csi_) and then paste the link the onto the end of
this command. For example:
```
helm install --create-namespace -n seagate exos-x-csi <url-of-helm-package>
```

Alternately, you can download and unpack the [helm
package](https://github.com/Seagate/seagate-exos-x-csi/releases/download/v1.6.3/seagate-exos-x-csi-1.6.3.tgz)
and extract it:
```
wget https://github.com/Seagate/seagate-exos-x-csi/releases/download/v1.6.3/seagate-exos-x-csi-1.6.3.tgz
tar xpzf seagate-exos-x-csi-1.6.3.tgz
helm install --create-namespace -n seagate exos-x-csi seagate-exos-x-csi
```
or clone the Github repository and install from the helm/csi-charts folder:

```
helm install seagate-csi -n seagate --create-namespace \
helm/csi-charts -f helm/csi-charts/values.yaml
git clone https://github.com/Seagate/seagate-exos-x-csi
cd seagate-exos-x-csi
helm install exos-x-csi -n seagate --create-namespace \
helm/csi-charts -f helm/csi-charts/values.yaml
```

#### To deploy the provisioner to OpenShift cluster, run the following commands prior to using Helm:
```
oc create -f scc/exos-x-csi-access-scc.yaml --as system:admin
oc adm policy add-scc-to-user exos-x-csi-access -z default -n NAMESPACE
oc adm policy add-scc-to-user exos-x-csi-access -z csi-provisioner -n NAMESPACE
oc create -f scc/exos-x-csi-access-scc.yaml --as system:admin
oc adm policy add-scc-to-user exos-x-csi-access -z default -n NAMESPACE
oc adm policy add-scc-to-user exos-x-csi-access -z csi-provisioner -n NAMESPACE
```

#### Configure your release
Expand Down
3 changes: 3 additions & 0 deletions helm/csi-charts/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ sources:
keywords:
- storage
- iscsi
- fc
- sas
- plugin
- csi
maintainers:
- name: Seagate
url: https://github.com/Seagate
email: [email protected]
- name: Joe Skazinski
email: [email protected]
annotations:
Expand Down
16 changes: 1 addition & 15 deletions helm/csi-charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@
kubeletPath: /var/lib/kubelet
# -- Wether psp admission controller has been enabled in the cluster or not
pspAdmissionControllerEnabled: false

image:
# -- Docker repository to use for nodes and controller
repository: ghcr.io/seagate/seagate-exos-x-csi
# -- Tag to use for nodes and controller
# @default -- Uses Chart.appVersion value by default if tag does not specify a new version.
tag: "v1.6.3"
tag: "v1.6.3"
# -- Default is set to IfNotPresent, to override use Always here to always pull the specified version
pullPolicy: Always

# -- Controller sidecar for provisioning
# AKA external-provisioner
csiProvisioner:
Expand All @@ -26,7 +24,6 @@ csiProvisioner:
timeout: 30s
# -- Extra arguments for csi-provisioner controller sidecar
extraArgs: [--feature-gates=Topology=true]

# -- Controller sidecar for attachment handling
csiAttacher:
image:
Expand All @@ -36,62 +33,51 @@ csiAttacher:
timeout: 30s
# -- Extra arguments for csi-attacher controller sidecar
extraArgs: []

# -- Controller sidecar for volume expansion
csiResizer:
image:
repository: registry.k8s.io/sig-storage/csi-resizer
tag: v1.3.0
# -- Extra arguments for csi-resizer controller sidecar
extraArgs: []

# -- Controller sidecar for snapshots handling
csiSnapshotter:
image:
repository: registry.k8s.io/sig-storage/csi-snapshotter
tag: v4.2.1
# -- Extra arguments for csi-snapshotter controller sidecar
extraArgs: []

# -- Node sidecar for plugin registration
csiNodeRegistrar:
image:
repository: registry.k8s.io/sig-storage/csi-node-driver-registrar
tag: v2.3.0
# -- Extra arguments for csi-node-registrar node sidecar
extraArgs: []

controller:
# -- Extra arguments for seagate-exos-x-csi-controller container
extraArgs: [-v=0]

node:
# -- Extra arguments for seagate-exos-x-csi-node containers
extraArgs: [-v=0]

multipathd:
# -- Extra arguments for multipathd containers
extraArgs: []

# -- Container that convert CSI liveness probe to kubernetes liveness/readiness probe
nodeLivenessProbe:
image:
repository: registry.k8s.io/sig-storage/livenessprobe
tag: v2.4.0
# -- Extra arguments for the node's liveness probe containers
extraArgs: []

nodeServer:
# -- Kubernetes nodeSelector field for seagate-exos-x-csi-node-server Pod
nodeSelector:
# -- Kubernetes nodeAffinity field for seagate-exos-x-csi-node-server Pod
nodeAffinity:

podMonitor:
# -- Set a Prometheus operator PodMonitor resource (true or false)
enabled: false

serviceMonitor:
# -- Set a Prometheus operator ServiceMonitor resource (true or false)
enabled: false

0 comments on commit 2b44525

Please sign in to comment.