Kubernetes 1.10.

Make sure the prerequisites for StorageOS are satisfied before proceeding.

 

StorageOS can interface with Kubernetes using the native volume driver or the new CSI interface. For 1.10., we recommend the StorageOS Operator install using native drivers, unless you have a specific requirement.

Install StorageOS operator

Our cluster operator is a Kubernetes native application developed to deploy and configure StorageOS clusters, and assist with maintenance operations. We recommend its use for standard installations.

The StorageOS operator can be installed with Helm.

Install

helm repo add storageos https://charts.storageos.com
helm install storageos/storageoscluster-operator --namespace storageos-operator

The Helm chart can be found in the Charts public repository.

The StorageOS Cluster Operator source code can be found in the cluster-operator repository.

The helm server, tiller, needs privileges to be able to deploy the StorageOS Cluster Operator. You can add the service account to the cluster-admin role for simplicity or create a role that matches the cluster-operator requirements.

The operator is a Kubernetes controller that watches the StorageOSCluster CRD. Once the controller is ready, a StorageOS cluster definition can be created. The operator will deploy a StorageOS cluster based on the configuration specified in the cluster definition.

Create a Secret

Before deploying a StorageOS cluster, create a Secret to define the StorageOS API Username and Password in base64 encoding.

kubectl create -f - <<END
apiVersion: v1
kind: Secret
metadata:
  name: "storageos-api"
  namespace: "default"
  labels:
    app: "storageos"
type: "kubernetes.io/storageos"
data:
  # echo -n '<secret>' | base64
  apiUsername: c3RvcmFnZW9z
  apiPassword: c3RvcmFnZW9z
END

This example contains a default password, for production installations, use a unique, strong password.

Make sure that the encoding of the credentials doesn’t have special characters such as ‘\n’.

You can define a base64 value by echo -n "mystring" | base64.

Trigger a StorageOS installation

This is a Cluster Definition example.

kubectl create -f - <<END
apiVersion: "storageos.com/v1alpha1"
kind: "StorageOSCluster"
metadata:
  name: "example-storageos"
spec:
  secretRefName: "storageos-api" # Reference from the Secret created in the previous step
  secretRefNamespace: "default"  # Namespace of the Secret
  images:
    nodeContainer: "storageos/node:1.0.0" # StorageOS version
  resources:
    requests:
    memory: "512Mi"
END

spec parameters available on the Cluster Operator configuration page.

You can find more examples such as deployments with CSI or deployments referencing a external etcd kv store. store for StorageOS in the Cluster Operator examples page.

If this is your first installation you may wish to follow the StorageOS Volume guide for an example of how to mount a StorageOS volume in a Pod.

 

Custom Installations

There are a variety of flavours, versions and particularities in the container orchestrator scope. Because of this, StorageOS installation procedures aim to be flexible so they can fit different needs depending on the environment, preferences or requirements. The StorageOS cluster operator simplifies the installation by implementing automated install. You can review and adapt the StorageOS install in the following examples. Feel free to extend and modify the publicly available examples.

Installation with Native Drivers (default)

The following github repository hosts installation examples.

git clone https://github.com/storageos/deploy.git storageos
cd storageos/k8s/deploy-storageos

You can see various installation examples are available such as standard, CSI (Container StorageInterface) or etcd-as-svc. All of them have a deploy-storageos.sh that serves as a wrapper to trigger the manifest creation. Follow the according README.md for each one of them for more details. For advanced installations, it is recommended to use etcd-as-svc that will guide the user to deploy StorageOS using a etcd cluster deployed by the official Kubernetes etcd operator.

Helm installation

StorageOS can be installed with Helm. Helm adds versatility to the installation method. Default values can be overridden in the command line or you can edit the values.yaml of the Chart and pass it to the helm install command. These parameters allow the installation to be defined using Native Drivers or CSI. To see the full list of options, check the parameter table.

helm repo add storageos https://charts.storageos.com
helm repo update
# Set cluster.join to hostnames or ip addresses of at least one node
helm install storageos/storageos                               \ 
    --name=my-release                                          \
    --version=0.1.x                                            \
    --namespace=storageos                                      \
    --set cluster.join="node01\,node02\,node03"                \
    --set csi.enable=true # Set to false or remove line to use Native Drivers

The Helm Chart can be found in the StorageOS Charts repository

CSI Note

CSI allows you to set StorageOS features (storageos.com/* labels) on the StorageClass, but not on the PVC definition. If you need to set labels on PVCs or your environment does not support CSI, you may install StorageOS without CSI.