Kubernetes With Object Storage (EOS)
i) Create Object Storage and Kubernetes cluster through my account dashboard.
ii) Check the cluster nodes using kubectl config
.
iii) Configure/Install the dependencies of Datashim such as CRDs, SA, etc. using the following command:
kubectl create ns
kubectl apply -f https://raw.githubusercontent.com/datashim-io/datashim/master/release-tools/manifests/dlf.yaml
kubectl wait --for=condition=ready pods -l app.kubernetes.io/name=datashim -n dlf
kubectl label namespace default monitor-pods-datasets=enabled
iv) Create a new dataset using the below configuration:
cat <<EOF | kubectl apply -f -
apiVersion: datashim.io/v1alpha1
kind: Dataset
metadata:
name: example-dataset
spec:
local:
type: "COS"
accessKeyID: "{EOS_ACCESS_KEY_ID}"
secretAccessKey: "{EOS_SECRET_ACCESS_KEY}"
endpoint: "{EOS_URL}"
bucket: "{BUCKET_NAME}"
readonly: "true" #OPTIONAL, default is false
region: "" #OPTIONAL
EOF
Provide the credentials, URL, and Region such as Delhi/Mumbai
If everything works okay, you should see a PVC and a ConfigMap named example-dataset which you can mount in your pods. As an easier way to use the Dataset in your pod, you can instead label the pod as follows:
Once verified, you can create a new pod/deployment connected with EOS using the following YAML configuration:
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
name: nginx
labels:
dataset.0.id: "example-dataset"
dataset.0.useas: "mount"
spec:
containers:
- name: nginx
image: nginx
EOF
As a convention, the Dataset will be mounted in /mnt/datasets/example-dataset
.
We recommend using secrets to pass your Object Storage Service credentials to Datashim. For more information, click here.
Refer to the Datashim documentation for more details.