Monday, November 12, 2018

How to install MapR Data Fabric for Kubernetes(KDF) on Kubernetes Cluster

Goal:

This article explains the steps in details on how to install MapR Data Fabric for Kubernetes(KDF) on Kubernetes Cluster.

Env:

CentOS 7.4
4 Nodes(v1 to v4, and v1 will be the master node for Kubernetes Cluster):
  • xx.xx.xx.41 v1.poc.com v1
  • xx.xx.xx.42 v2.poc.com v2
  • xx.xx.xx.43 v3.poc.com v3
  • xx.xx.xx.44 v4.poc.com v4
Kubernetes v1.12.2
Docker 18.06.1-ce
MapR Data Fabric for Kubernetes(KDF) v1.0.2

Solution:

Before following below steps, please follow How to install a Kubernetes Cluster on CentOS 7 to install a Kubernetes Cluster firstly.
Below are several reference links to be read firstly as well:
  • Concept and Architecture of KDF:
https://mapr.com/docs/home/PersistentStorage/kdf_overview.html
  • KDF YAML file Download location:
https://package.mapr.com/tools/KubernetesDataFabric
  • KDF Installation Documentation:
https://mapr.com/docs/home/PersistentStorage/kdf_installation.html

1. Download the KDF YAML files

wget https://package.mapr.com/tools/KubernetesDataFabric/v1.0.2/kdf-namespace.yaml
wget https://package.mapr.com/tools/KubernetesDataFabric/v1.0.2/kdf-rbac.yaml
wget https://package.mapr.com/tools/KubernetesDataFabric/v1.0.2/kdf-plugin-centos.yaml
wget https://package.mapr.com/tools/KubernetesDataFabric/v1.0.2/kdf-provisioner.yaml

2. Create mapr-system namespace

kubectl create -f kdf-namespace.yaml

Confirm:
$ kubectl get namespace|grep -i mapr
mapr-system   Active   6h21m

3. Install RBAC file

kubectl create -f kdf-rbac.yaml
In this YAML file, it will complete below tasks in namespace "mapr-system":
  • Create a Service Account named "maprkdf".
  • Create a Cluster Role named "mapr:kdf" with several privileges.
  • Create a ClusterRoleBinding named "kdf" to assign Cluster Role "mapr:kdf" to Service Account "maprkdf".
Confirm:
$ kubectl get serviceaccount -n mapr-system |grep -i mapr
maprkdf        1         66s

$ kubectl get clusterroles |grep -i mapr
mapr:kdf                                                               4m45s

$ kubectl describe clusterrolebinding mapr:kdf
Name:         mapr:kdf
Labels:       <none>
Annotations:  <none>
Role:
  Kind:  ClusterRole
  Name:  mapr:kdf
Subjects:
  Kind            Name     Namespace
  ----            ----     ---------
  ServiceAccount  maprkdf  mapr-system

4. Create MapR KDF plugin

We need to modify the "kdf-plugin-centos.yaml" to change the IP:PORT of the kubernetes API server.
You can find the IP:PORT of the kubernetes API server by running below command:
$ kubectl config view|grep -i server
    server: https://xx.xx.xx.41:6443
Then change below part of the "kdf-plugin-centos.yaml":
          - name : KUBERNETES_SERVICE_LOCATION
            value: "changeme!:6443"
To:
          - name : KUBERNETES_SERVICE_LOCATION
            value: "xx.xx.xx.41:6443"
And then create the MapR KDF plugin:
kubectl create -f kdf-plugin-centos.yaml
In this YAML file, basically it creates a DaemonSet named "mapr-kdfplugin" running a container named "mapr-kdfplugin" on all nodes of the Kubernetes Cluster.
A DaemonSet ensures that all (or some) Nodes run a copy of a Pod.
Confirm:
$ kubectl get pods -n mapr-system -o wide
NAME                   READY   STATUS    RESTARTS   AGE   IP            NODE         NOMINATED NODE
mapr-kdfplugin-hbv4f   1/1     Running   0          93s   10.244.0.10   v1.poc.com   <none>
mapr-kdfplugin-hkwll   1/1     Running   0          93s   10.244.3.8    v4.poc.com   <none>
mapr-kdfplugin-lvg2z   1/1     Running   0          93s   10.244.1.6    v2.poc.com   <none>
mapr-kdfplugin-zkqbt   1/1     Running   0          93s   10.244.2.7    v3.poc.com   <none>

5. Create provisioner

kubectl create -f kdf-provisioner.yaml
In this YAML file, it creates a Deployment named "mapr-kdfprovisioner" in namespace "mapr-system".
This Deployment will run a container named "mapr-kdfprovisioner".
Confirm:
$ kubectl get pods -n mapr-system -o wide|grep -i provisioner
mapr-kdfprovisioner-c49954679-vgbjx   1/1     Running   0          70s     10.244.3.9    v4.poc.com   <none>

Then next steps are following documentation on how to use KDF:
https://mapr.com/docs/home/PersistentStorage/kdf_configuration.html

No comments:

Post a Comment