HPE Nimble Storage Tech Blog
cancel
Showing results for 
Search instead for 
Did you mean: 

Tech Preview: Bringing Nimble Storage to Kubernetes and OpenShift

mmattsson
No doubt there’s a ton of buzz around Kubernetes in the container space today. Kubernetes is a container platform introduced by Google inspired by their internal Borg system and one of the largest and active communities on GitHub. This powerful platform makes users and Enterprises gape in awe at the sheer scale, feature set and simplicity of orchestrating container workloads.
Adopting Kubernetes as an organization could be challenging without partnering with a Kubernetes solution provider that packages and supports Kubernetes. It may not be the latest upstream, it may not support all the latest capabilities but at least there’s somewhere to turn for support, upgrade paths and consulting. One of the most prominent distributions is Red Hat OpenShift Container Platform which is a revamp of their easy to use PaaS which is now built around Kubernetes since OpenShift version 3.
Nimble Storage has one of the feature richest Docker Volume plugins on the Docker Store, fully integrated into Docker Swarm which gives Docker users a premium experience when it comes to persistent storage and data services. What if we could bring all of that to Kubernetes and OpenShift? Kubernetes 1.4 introduced the Flexvolume plugin framework, an extremely lightweight “shim” to allow third-parties and users to provision storage to their containers however they want. We currently have a Flexvolume plugin in development that simply sits as a translation layer on top of the Nimble Storage Docker Volume plugin and provides the exact same features as the same.
Let’s walk through the simplest pod:
---
apiVersion: v1
kind: Pod
metadata:
  name: mywebserverpod
spec:
  containers:
  - name: webserver
    image: nginx
    volumeMounts:
    - name: html
      mountPath: /usr/share/nginx/html
  volumes:
  - name: html
    flexVolume:
      driver: hpe/nimble
      options:
        name: mydockervol
        description: "My web content"
        protectionTemplate: platinum
        pool: hybrid
        perfPolicy: "Windows File Server"
        sizeInGiB: "4000"
        limitMBPS: "250"
        limitIOPS: "750"‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
This pod manifest will deploy nginx with a persistent volume named “html”, inside the pod that volume maps to a Flexvolume. Kubernetes is aware about the “hpe/nimble” plugin as it’s initialized when the kubelet (Kubernetes node service) starts and will call the plugin with the described option map in the manifest. If there is a volume named “mydockervol” on the node already, it will be mounted in the pod, if not, it will be created on the fly according to the specification and mounted.

Advanced Data Services

One of my pet use cases is the ability to clone an entire application stack for development, testing and integration purposes. How well does this translate into Kubernetes and OpenShift? Let’s explore a full blown example.
Assume the follow manifest, it deploys a MySQL server and a webserver running WordPress - a very popular content management system, along with all the plumbing needed to deploy a production application stack:
---
apiVersion: v1
kind: Secret
metadata:
  name: mysql
data:
  password: WU9VUl9QQVNTV09SRA==
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: mysql
  labels:
    app: mysql
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mysql
  template:
    metadata:
      labels:
        app: mysql
    spec:
      containers:
        - image: mysql:5.6
          name: mysql
          env:
            - name: MYSQL_ROOT_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: mysql
                  key: password
          ports:
            - containerPort: 3306
              name: mysql
          volumeMounts:
            - name: mysql-persistent-storage
              mountPath: /var/lib/mysql
      volumes:
        - name: mysql-persistent-storage
          flexVolume:
            driver: hpe/nimble
            options:
              name: mysqlvolZ
              description: "This is my WordPress MySQL DB"
              size: "16"
---
apiVersion: v1
kind: Service
metadata:
  name: mysql
  labels:
    app: mysql
spec:
  type: ClusterIP
  ports:
    - port: 3306
  selector:
    app: mysql
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: wordpress
  labels:
    app: wordpress
spec:
  replicas: 1
  selector:
    matchLabels:
      app: wordpress
  template:
    metadata:
      labels:
        app: wordpress
    spec:
      containers:
        - image: wordpress
          name: wordpress
          env:
          - name: WORDPRESS_DB_HOST
            value: mysql:3306
          - name: WORDPRESS_DB_PASSWORD
            valueFrom:
              secretKeyRef:
                name: mysql
                key: password
          ports:
            - containerPort: 80
              name: wordpress
          volumeMounts:
            - name: wordpress-persistent-storage
              mountPath: /var/www/html
      volumes:
        - name: wordpress-persistent-storage
          flexVolume:
            driver: hpe/nimble
            options:
              name: wpvolZ
              description: "This is my WordPress assets"
              size: "1000"
              perfPolicy: "Windows File Server"
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: wordpress
  name: wordpress
spec:
  type: LoadBalancer
  ports:
    - port: 80
      targetPort: 80
      protocol: TCP
  selector:
    app: wordpress
---
apiVersion: v1
kind: Route
metadata:
  name: host-route
spec:
  host: tme-lnx1-rhel7-2.lab.nimblestorage.com
  to:
    kind: Service
    name: wordpress‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
On my OpenShift system, I have an empty project named “wordpress”, I’ll switch to that project and deploy the above manifest:
$ oc project wordpress
Now using project "wordpress" on server "https://tme-lnx1-rhel7-2.lab.nimblestorage.com:8443"..
$ oc create -f wordpress.yaml
secret "mysql" created
deployment "mysql" created
service "mysql" created
deployment "wordpress" created
service "wordpress" created
route "host-route" created
$‍‍‍‍‍‍‍‍‍‍
In a moment I will have a WordPress instance ready to be setup on the route I declared. Let’s assume I setup this instance, give it to my content management team and let it run for a while. At one point they might want to upgrade to the next version or do a major overhaul that involves risk in letting visitors see intermediary versions of the website while restructuring and testing. Having a sandbox to do that would be most helpful and non-disruptive.
You would simply switch to another project:
$ oc project clone
Now using project "clone" on server "https://tme-lnx1-rhel7-2.lab.nimblestorage.com:8443".
$ ‍‍‍
After that you’d simply alter the volume sections for each of the pods:
<snip>
      volumes:
        - name: mysql-persistent-storage
          flexVolume:
            driver: hpe/nimble
            options:
              name: mysqlvolZ-clone
              cloneOf: mysqlvolZ
<snip>
      volumes:
        - name: wordpress-persistent-storage
          flexVolume:
            driver: hpe/nimble
            options:
              name: wpvolZ-clone
              cloneOf: wpvolZ
<snip>
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
This will simply clone the volumes from the “wordpress” project into the “clone” project. In my example I also remove the route section and connect externally via the randomly assigned port:
$ oc create -f clone.yaml 
secret "mysql" created
deployment "mysql" created
service "mysql" created
deployment "wordpress" created
service "wordpress" created
$ oc get services -l app=wordpress
NAME        CLUSTER-IP       EXTERNAL-IP                     PORT(S)        AGE
wordpress   172.30.136.215   172.29.135.102,172.29.135.102   80:31919/TCP   14s
$
In this example I would connect to port 31919 to access the cloned instance.
This is a comprehensive suite of data services Nimble Storage and HPE is bringing to the Kubernetes community and Red Hat OpenShift Container Platform users. Please feel free to reach out if this is something you want to get your hands on early, we might invite you to a beta program. We expect to ship the Nimble Storage Flexvolume plugin for Kubernetes and OpenShift over the next few months.
0 Kudos
About the Author

mmattsson

Events
See posts for dates
See posts for locations
HPE at 2018 Technology Events
Learn about the technology events where Hewlett Packard Enterprise will have a presence in 2018.
Read more
See posts for dates
Online
HPE Webinars - 2018
Find out about this year's live broadcasts and on-demand webinars.
Read more
View all