Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

storageos/operator

Repository files navigation

StorageOS Operator

The StorageOS Operator deploys and configures a StorageOS cluster on Kubernetes.

Go Report Card e2e test Build and test CodeQL Active PR's Welcome License

Setup/Development

  1. Build operator container image with make operator-image. Publish or copy the container image to an existing k8s cluster to make it available for use within the cluster.
  2. Generate install manifest file with make install-manifest. This will generate storageos-operator.yaml file.
  3. Install the operator with kubectl create -f storageos-operator.yaml.

The operator can also be run from outside the cluster with make run. Ensure the CRDs that the operator requires are installed in the cluster before running it using make install.

Install StorageOS cluster

  1. Ensure an etcd cluster is available to be used with StorageOS.
  2. Create a secret for the cluster, for example:
apiVersion: v1
kind: Secret
metadata:
  name: storageos-api
  namespace: storageos
  labels:
    app: storageos
data:
  # echo -n '<secret>' | base64
  username: c3RvcmFnZW9z
  password: c3RvcmFnZW9z
  1. Create a StorageOSCluster custom resource in the same namespace as the above secret and refer the secret in the spec:
apiVersion: storageos.com/v1
kind: StorageOSCluster
metadata:
  name: storageoscluster-sample
  namespace: storageos
spec:
  secretRefName: storageos-api
  storageClassName: storageos
  kvBackend:
    address: "<etcd-address>"

This will create a StorageOS cluster in storageos namespace with a StorageClass storageos that can be used to provision StorageOS volumes.

Testing

Run the unit tests with make test.

Run e2e tests with make e2e. e2e tests use kuttl. Install kuttl kubectl plugin before running the e2e tests.

Update api-manager manifests

Api-manager manifests are stored in the repo but updated manually. To update the manifests please follow the instructions below.

  • Edit API_MANAGER_VERSION in Makefile or pass it to make target.
  • Execute make api-manager command.
  • Enjoy new version.

Update portal-manager manifests

portal-manager manifests are stored in the repo but updated manually. To update the manifests please follow the instructions below.

  • Edit PORTAL_MANAGER_VERSION in Makefile or pass it to make target.
  • Execute make portal-manager command.
  • Enjoy new version.

Update node-manager manifests

node-manager manifests are stored in the repo but updated manually. To update the manifests please follow the instructions below.

  • Edit NODE_MANAGER_VERSION in Makefile or pass it to make target.
  • Execute make node-manager command.
  • Enjoy new version.