curl -s "https://raw.githubusercontent.com/\
kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
kubectl create -f ./config/certmanager/cert-manager.yaml
This project is based on kubebuilder v3, since CRDs generated by kubebuilder v2 is not compatible in kubernetes v1.20.
kubebuilder init --domain opendilab.org --license apache2 --owner "The OpenDILab authors"
kubebuilder create api --group diengine --version v1alpha1 --kind DIJob
kubebuilder create api --group diengine --version v1alpha1 --kind AggregatorConfig
Make codes in dijob_types.go and aggregatorconfig_types.go with your requirements, and generate deepcopy functions.
make generate
Generate new CRD files with the following command.
make manifests
New CRD files will be generated in ./config/crd/bases
Referenced to controllers
Referenced to server
Run the following command in the project root directory.
# build images.
make docker-build
make docker-push
# deploy di-operator and server to cluster
make dev-deploy
Since the CustomResourceDefinitions are too long, you will probably find the following error:
The CustomResourceDefinition "dijobs.diengine.opendilab.org" is invalid: metadata.annotations: Too long: must have at most 262144 bytes
Then running the following command will solve the problem:
kustomize build config/crd | kubectl create -f -
di-operator
, di-webhook
and di-server
will be installed in di-system
namespace.
$ kubectl get pod -n di-system
NAME READY STATUS RESTARTS AGE
di-operator-57cc65d5c9-5vnvn 1/1 Running 0 59s
di-server-7b86ff8df4-jfgmp 1/1 Running 0 59s
di-webhook-45jgi23fhc-9yght 1/1 Running 0 59s
Install global components of DIJob defined in AggregatorConfig:
kubectl create -f config/samples/agconfig.yaml -n di-system
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。