0

I have installed Kubernetes with Minikube on my Windows laptop. I have downloaded and installed Cassandra and MariaDB using helm charts. Right now I have 1 Cassandra pod with a dummy table

  Name   Age
  Johan  25 
  Eric   18

I have created a similar empty table in my MariaDB pod

  Name Age

My goal is now to copy the data from the Cassandra Table, and ingest it into the MariaDB table.

How is this done in Kubernetes? I read somewhere that LogStash is the way to go, or is there another way of simply moving data from one pod to another? Do I have to open up any ports or anything for this to work? I have tried to find information about this, but I have a hard time understanding what solution is most suitable for this.

Thank you for any suggestions/tips!

kkss
  • 55
  • 1
  • 8
  • 1
    This is not related to Kubernetes. You basically can mount any volume to the pod but the data migration part is not kubernetes related. Once you migrate the data, you can mount it to your pod using volumeMounts – Abhyudit Jain Jun 05 '19 at 13:02
  • In what way is it not related to Kubernetes? The data is supposed to be moved between two pods in a Kubernetes node? Or am I missing something? – kkss Jun 05 '19 at 13:09
  • A pod can't access other pod's storage if it's not using PVC. If you want to share volumes across pods, refer to this: https://stackoverflow.com/a/52564314/3743683 – Abhyudit Jain Jun 05 '19 at 13:14
  • I don't want them to access each others storages, but rather have a service read the table in one and write it into another, like a microservice. Is this not possible? – kkss Jun 05 '19 at 13:20
  • It is. You should state the question more clearly. For this, you should expose the pod. Look into services, but if it's just a pod, it is accessible from another pod using it's IP. – Abhyudit Jain Jun 05 '19 at 16:25

1 Answers1

0

What you need to do is, to make sure your Cassandra deployment is exposed with a headless Service, i.e.

apiVersion: v1
kind: Service
metadata:
  labels:
    app: cassandra
  name: cassandra
spec:
  clusterIP: None
  ports:
  - port: 9042
  selector:
    app: cassandra

so it is accessible for other services withing the cluster by follwoing DNS record

cassandra.default.svc.cluster.local

And then you just run another container in the same cluster with Cassandra's ODBC driver tool(Spark SQL(OS), Simba’s ODBC driver(Enterprise)) to connect and transform data to MySQL

A_Suh
  • 3,727
  • 6
  • 22