Skip to content

Repository files navigation

Kubernetes operator for Bagua jobs

This repository implements a kubernetes operator for Bagua distributed training job which supports static and elastic workloads. See CRD definition.

Prerequisites

  • Kubernetes
  • kubectl

Installation

Run the operator locally

git clone https://github.com/BaguaSys/operator.git
cd operator
# install crd
kubectl apply -f config/crd/bases/bagua.kuaishou.com_baguas.yaml
go run ./main.go

Deploy the operator

Install Bagua on an existing Kubernetes cluster.

kubectl apply -f https://raw.githubusercontent.com/BaguaSys/operator/master/deploy/deployment.yaml

Enjoy! Bagua will create resources in namespace bagua.

Examples

You can get demos in config/samples, and run as follows,

  • static mode
kubectl apply -f config/samples/bagua_v1alpha1_bagua_static.yaml

Verify pods are running

kubectl get podsNAME READY STATUS RESTARTS AGEbagua-sample-static-master-0 1/1 Running 0 45sbagua-sample-static-worker-0 1/1 Running 0 45sbagua-sample-static-worker-1 1/1 Running 0 45s
  • elastic mode
kubectl apply -f config/samples/bagua_v1alpha1_bagua_elastic.yaml

Verify pods are running

kubectl get podsNAME READY STATUS RESTARTS AGEbagua-sample-elastic-etcd-0 1/1 Running 0 63sbagua-sample-elastic-worker-0 1/1 Running 0 63sbagua-sample-elastic-worker-1 1/1 Running 0 63sbagua-sample-elastic-worker-2 1/1 Running 0 63s

About

Kubernetes operator for Bagua distributed training job.

Resources

Stars

13 stars

Watchers

7 watching

Forks

Releases

Packages

Used by

Contributors

Languages