Rancher

Make sure the prerequisites for Ondat are satisfied before proceeding.

Ondat transparently supports Rancher deployments on CentOS, RHEL, Debian, Ubuntu or RancherOS (CSI is not supported on RancherOS) and can support other Linux distributions as detailed on the System Configuration page if the appropriate kernel modules are available.

 



Rancher Catalog Install

Ondat is a Certified application in the Rancher Catalog. You can install Ondat using the Rancher application install.

  1. Select the System project of your cluster

    install-1

  2. Select the Apps tab and click Launch install-2

  3. Search for Ondat and click on the App install-3

  4. Define the Ondat cluster installation

    A generic configuration for Ondat is preset using the default values in the form. The values in the form can be changed to customize the installation. To customize the installation further, set Install Ondat Cluster to false and use a yaml definition for the StorageOSCluster Custom Resource.

     

    The following options are exposed by the form to allow some simple customization of the Ondat installation.

    • Cluster Operator namespace : The Kubernetes namespace where the Ondat Cluster Operator controller and other resources will be created.
    • Container Images : By default images are pulled from DockerHub, you can specify the image URLs when using private registries.
    • Conditional bootstrap of Ondat : Controls the automatic deployment of Ondat after installing the Cluster Operator. If set to false, the Operator will be created, but the Custom Resource will not be applied to the cluster. Launch the operator and proceed to the section Custom Resource definition. For more information check the Operator documentation and CR examples.
    • Ondat namespace : The Kubernetes namespace where Ondat will be installed. Installing into the kube-system namespace will add Ondat to a priority class to ensure high priority resource allocation. Installing Ondat with the priority class prevents Ondat from being evicted during periods of resource contention.
    • Username/Password : Default Username and Password for the admin account to be created at Ondat bootstrap. A random password will be generated by leaving the field empty or clicking the Generate button.
    • Key-value store setup : Connection and configuration details for an external Etcd cluster. Ondat can use an external key-value store to hold configuration. Settings such as external etcd with TLS termination are available.
    • Node Selectors and Tolerations : Control placement of Ondat DaemonSet Pods. Ondat will only be installed on the selected nodes. Can be used in conjunction with tolerations.

     

    install-4 install-5

  5. Verify the cluster bootstrap has successfully completed

    install-6

 

Custom Resource definition

If Install Ondat Cluster was set to false, Ondat will not be bootstrapped automatically. After the Ondat Operator is installed, you can now create a Custom Resource that describes the Ondat cluster.

  1. Select the System Workloads and Import YAML install-7

  2. Create the Secret and CustomResource install-8

    This is an example.

    apiVersion: v1
    kind: Secret
    metadata:
      name: "storageos-api"
      namespace: "storageos-operator"
      labels:
        app: "storageos"
    type: "kubernetes.io/storageos"
    data:
      # echo -n '<secret>' | base64
      apiUsername: c3RvcmFnZW9z # Define your own user and password
      apiPassword: c3RvcmFnZW9z
    ---
    apiVersion: "storageos.com/v1"
    kind: StorageOSCluster
    metadata:
      name: "storageos"
    spec:
      k8sDistro: "rancher"
      namespace: "kube-system"
      secretRefName: "storageos-api" # Reference from the Secret created in the previous step
      secretRefNamespace: "storageos-operator"  # Namespace of the Secret
      csi:
        enable: true
        deploymentStrategy: "deployment"
      images:
        nodeContainer: "storageos/node:{{ site.latest_node_version }}" # Ondat version
    #  kvBackend:
    #    address: 'storageos-etcd-client.etcd:2379' # Example address, change for your etcd endpoint
    #    backend: 'etcd'
      sharedDir: '/var/lib/kubelet/plugins/kubernetes.io~storageos' # Needed when Kubelet runs as a container
      resources:
        requests:
          memory: "512Mi"
      nodeSelectorTerms:
        - matchExpressions:
          - key: "node-role.kubernetes.io/worker"
            operator: In
            values:
            - "true"
    

    Additional spec parameters are available on the [Cluster Operator configuration]({%link _docs/reference/cluster-operator/configuration.md %}) page.

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

Advanced installation

This installation procedure is available in case the default method does not meet your requirements. The following procedure requires more steps to complete in comparison to the default procedure and requires adjustment of more installation parameters.

Estimated time to complete the installation: 5-10 min

The Ondat Cluster Operator is a Kubernetes native application developed to deploy and configure Ondat clusters, and assist with maintenance operations. We recommend its use for standard installations.

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

 

Helm Note: If you want to use Helm to install Ondat, follow the Ondat Operator Helm Chart documentation.

Steps to install Ondat:

1. Install Ondat operator

Install the Ondat Cluster Operator using the following yaml manifest.

kubectl create -f https://github.com/storageos/cluster-operator/releases/download/1.5.4/storageos-operator.yaml

Verify the Cluster Operator Pod Status

[root@master03]# kubectl -n storageos-operator get pod
NAME                                         READY     STATUS    RESTARTS   AGE
storageoscluster-operator-68678798ff-f28zw   1/1       Running   0          3m

The READY 1/1 indicates that storageoscluster resources can be created.

2. Create a Secret

Before deploying a Ondat cluster, create a Secret defining the Ondat API Username and Password in base64 encoding. The API username and password are used to create the default Ondat admin account which can be used with the Ondat CLI and to login to the Ondat GUI. The account defined in the secret is also used by Kubernetes to authenticate against the Ondat API when installing with the native driver.

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

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

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

Make sure that the encoding of the credentials doesn’t have special characters such as ‘\n’. The echo -n ensures that a trailing new line is not appended to the string.

If you wish to change the default accounts details post-install please see Managing Users

3 Trigger a Ondat installation

This is a Cluster Definition example.

apiVersion: "storageos.com/v1"
kind: StorageOSCluster
metadata:
  name: "example-ondat"
  namespace: "storageos-operator"
spec:
  secretRefName: "storageos-api" # Reference from the Secret created in the previous step
  secretRefNamespace: "storageos-operator"  # Namespace of the Secret
  k8sDistro: "rancher"
  namespace: "kube-system"
  images:
    nodeContainer: "storageos/node:1.5.4" # Ondat version
  csi:
    enable: true
    deploymentStrategy: deployment
  resources:
    requests:
    memory: "512Mi"
#  nodeSelectorTerms:
#    - matchExpressions:
#      - key: "node-role.kubernetes.io/worker" # Compute node label will vary according to your installation
#        operator: In
#        values:
#        - "true"

Additional spec parameters are available on the Cluster Operator configuration page.

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

Verify Ondat Installation

[root@master03]# kubectl -n kube-system get pods -w
NAME                                    READY   STATUS    RESTARTS   AGE
storageos-csi-helper-5cf59b5b4-f5nwr    2/2     Running   0          3m
storageos-daemonset-75f6c               3/3     Running   0          3m
storageos-daemonset-czbqx               3/3     Running   0          3m
storageos-daemonset-zv4tq               3/3     Running   0          3m
storageos-scheduler-6d67b46f67-5c46j    1/1     Running   6          3m

The above command watches the Pods created by the Cluster Definition example. Note that pods typically take approximately 65 seconds to enter the Running Phase.

First Ondat volume

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