Kubernetes File to run ClusterODM and NodeODM on k8 cluster

Hi everyone,

in the spirit of giving back I thought I would share my kubernetes yml file to load ClusterODM and a Number of NodeODM’s on a k8 cluster (I am using an easy8 Nvidia Bright Cluster)

Notes:

  • change to the external ip adddress of your k8 cluster
  • change the number of replicas for nodeodm to the number of nodes in your
    cluster (1 nodeodm per cluster node)
  • change to the NFS mount shared within your cluser (i.e. /cm/local on your Bright Cluster)
  • Use kubectl apply -f yourfile.yml
  • You should be able to connect to ClusterODM on :10000 and then add the NodeODM nodes.
  • Use kubectl get pods -o wide to get the IP address of each nodeodm instance to put into ClusterODM config using the port 3000 for each node.

apiVersion: apps/v1
kind: Deployment
metadata:
name: nodeodm-deployment
spec:
replicas:
selector:
matchLabels:
app: nodeodm
template:
metadata:
labels:
app: nodeodm
spec:
containers:
- name: nodeodm
image: opendronemap/nodeodm:gpu
ports:
- containerPort: 3000
volumeMounts:
- name: data-volume
mountPath:
volumes:
- name: data-volume
emptyDir: {}


apiVersion: apps/v1
kind: Deployment
metadata:
name: clusterodm-deployment
spec:
replicas: 1
selector:
matchLabels:
app: clusterodm
template:
metadata:
labels:
app: clusterodm
spec:
containers:
- name: clusterodm
image: opendronemap/clusterodm
ports:
- containerPort: 3000
- containerPort: 10000
- containerPort: 8080


apiVersion: v1
kind: Service
metadata:
name: nodeodm-service
spec:
type: NodePort
selector:
app: nodeodm
ports:
- protocol: TCP
port: 3000
targetPort: 3000
nodePort: 30000


apiVersion: v1
kind: Service
metadata:
name: clusterodm-service
spec:
type: LoadBalancer
externalIPs:
-
ports:
- name: port-3000
port: 3000
targetPort: 3000
- name: port-10000
port: 10000
targetPort: 10000
- name: port-8080
port: 8080
targetPort: 8080
selector:
app: clusterodm

4 Likes

Awesome. Would you be willing to add this to the repo, maybe with liner eyes directions in a section of the readme?

If you don’t have bandwidth for that, are you willing to release under a compatible license (GNU Affero GPL or other compatible).

This is a great contribution. Thank you!

1 Like

Happy to add to the repo and do a readme.md - where should I put it? ClusterODM?

1 Like

Yes! ClusterODM is the right place, maybe in a contrib subdirectory.

1 Like

OK will look to do this in the coming weeks when time permits.

2 Likes

OK have created a Contrib/kibernetes folder, added the yml file and written a README.md. I’m not a github guru but think I have done all the right steps to create a pull request…if not then please someone do let me know.

1 Like

Awesome. I guess the only change I might make is to lowercase the name of the contribs directory. Otherwise, I’ll merge tonight.

Thanks for doing this!

1 Like

My pleasure. Happy to give back.

1 Like

This looks amazing and I look forward to tinkering with it. I have had some success using ClusterODM on DigitalOcean spinning up new droplets as necessary with Docker Machine, but I would much rather spin up Kubernetes jobs and let the node autoscaler take care of the rest. Did you look into that approach yet?