Every day, containerization is becoming a more integral part of IT planning and strategy. The container platform you choose should be able to manage various workloads. Docker Enterprise 2.1 Universal Control Plane (UCP) is one enterprise container platform providing multi-architecture orchestration across Kubernetes and Swarm workloads.
This blog discusses how to install, configure, and use Trident for Kubernetes on a UCP managed cluster.
What is Docker UCP?
Docker UCP extends Docker by enabling you to manage your cluster from a centralized location. The Docker UCP sits on top of the Docker Enterprise Engine in each node as shown below. Once deployed, administrators would interact with their cluster via UCP instead of each node's individual Docker engine.
Since the UCP supports both Kubernetes and Docker via a Web UI or CLI, administrators can use either a Kubernetes yaml files or Docker Compose files to deploy images from the centralized location. It also provides cluster wide monitoring of deployed containers, services, and pods. UCP runs a cluster wide scheduling service called ucp-agent on each node. Services are launched only on worker nodes and will not be scheduled on master nodes.
Now let us see how we can install and configure Trident on UCP managed nodes.
Before we start:
It is assumed the reader is familiar with Kubernetes concepts.
- Verify the UCP (Docker Enterprise 2.1[Ver: -18.09]) is setup and running.
- Confirm the Kubernetes CLI on the UCP managed nodes is setup and functional.
Installing Trident for Kubernetes on UCP managed nodes
Installing Trident for Kubernetes on UCP managed nodes is similar to installing Trident on Kubernetes. Refer to the documentation for instructions on how to install Trident for Kubernetes.
Please note that starting with Docker EE 2.1 UCP and Trident 19.01, it is no longer required to specify the --ucp-host and --ucp-bearer-token parameters for installing and uninstalling Trident. Deploy the “tridentctl install -n <namespace>” command to start the installation on the UCP managed nodes.
Setting up Trident for Kubernetes on UCP
Docker EE 2.1 deploys Kubernetes as part of a UCP installation. It helps administrators deploy, manage, and monitor Kubernetes workloads from the UCP dashboard. Administrators can also interact with the Kubernetes deployment through the Kubernetes command-line tool. Trident provisions volumes with UCP similar to Kubernetes.
Follow the below steps to configure and use Trident on UCP:
- Setup the appropriate backend using the “tridentctl create backend” command. Refer to the documentation for instructions on how to create backend for your Trident setup.
- Login to the UCP UI console using your UCP credentials.
- Set the context to the appropriate namespace on the UCP UI console.
- Create appropriate storage classes by following the steps below:
- Under the Kubernetes tab, click on create to create a storage class Kubernetes object.
- Select the appropriate the namespace and input the Storage Class yaml details. List trident as the provisioner. An example for storage class gold is shown below.
- Under the storage tab, verify that the storage class has been created. As per the above example, the storage class gold should be listed as seen below.
- Create the Persistent Volume Claim (PVC) based on the above created storage class from the UCP interface.
- Under the Kubernetes tab, click on “create” to create a Kubernetes PVC object.
- Select the appropriate the namespace and input the PVC yaml details. An example is shown below.
- Under the storage tab on the UCP dashboard, verify that the PersistentVolumeClaim has been created. As per the example, make sure that persistent volume claim pvc-nas is listed as shown below.
- Examine the Persistent Volume Claim using kubectl command line tool from the UCP nodes. Make sure that the status of the Persistent Volume Claim is “Bound” and a Persistent Volume is attached to the Persistent Volume Claim.
[root@scspa0583860001 ~]# kubectl describe pvc pvc-nas Name: pvc-nas Namespace: default StorageClass: gold Status: Bound Volume: default-pvc-nas-e055a Labels: <none> Annotations: pv.kubernetes.io/bind-completed=yes pv.kubernetes.io/bound-by-controller=yes volume.beta.kubernetes.io/storage-provisioner=netapp.io/trident Finalizers: [kubernetes.io/pvc-protection] Capacity: 3Gi Access Modes: RWO
- Now verify the Persistent Volume using kubectl command line tool from the UCP nodes and examine the “Source Path” which denotes the volume on the NetApp storage from which the persistent Volume is derived from and the “Source Server” which shows the NFS server from which is originating.
[root@scspa0583860001 ~]# kubectl describe pv default-pvc-nas-e055a Name: default-pvc-nas-e055a Labels: <none> Annotations: pv.kubernetes.io/provisioned-by=netapp.io/trident volume.beta.kubernetes.io/storage-class=gold Finalizers: [kubernetes.io/pv-protection] StorageClass: gold Status: Bound Claim: default/pvc-nas Reclaim Policy: Delete Access Modes: RWO Capacity: 3Gi Node Affinity: <none> Message: Source: Type: NFS (an NFS mount that lasts the lifetime of a pod) Server: 10.63.171.70 Path: /default_pvc_nas_e055a ReadOnly: false Events: <none>
As you can see the Persistent Volume Claim pvc-nas was created and bound to a 3Gb Persistent Volume default-pvc-nas-e055a which Trident provisioned on the NetApp storage.
Great, you have successfully installed and provisioned volume through Trident on Docker UCP !
We have examined how to install Trident for Kubernetes on Docker EE 2.1 Universal Control Plane and also how to configure and use Trident on UCP.
We know you will have more questions about things which concern you. We haven’t covered every possible scenario, and probably never will, so please reach out to us on our Slack team, GitHub issues, or open a support case. We’re happy to help!