Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add README.md and CONTRIBUTING.md
  • Loading branch information
rainzm committed May 26, 2020
1 parent 2fd0ec9 commit 01cff42
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
31 changes: 31 additions & 0 deletions CONTRIBUTING.md
@@ -0,0 +1,31 @@
## 开发环境搭建

本项目是基于[kubebuilder](https://github.com/kubernetes-sigs/kubebuilder)构建的,所以在开发之前请安装`kubebuilder`相关工具。

## 代码简介

`main.go`: 服务的入口,主要用来初始化各个 controller 以及 controllerManager。

`api/v1/`: v1 版本的 api。

`config/`: 主要是 crd 以及 controller manager 相关的 Kubernetes manifests 文件。

`controllers/`: 各个 controller 的实现代码。

`pkg/options/`: 参数相关的代码。

`pkg/provider/`: 对 OneCloud 各个 Service 以及资源操作的逻辑代码。

`pkg/util/`: 工具代码。

## 创建一个新的 CRD 以及 controller

```shell
kubebuilder create api --group onecloud --version v1 --kind AnsiblePlaybook
```

更加详细的操作请参考[kubebuilder book](https://kubebuilder.io/)

## 生成代码

修改完代码之后,请执行`make manifests`以更新 manifests,执行`make generate`以更新自动生成的代码。
31 changes: 31 additions & 0 deletions README.md
@@ -0,0 +1,31 @@
## OneCloud Service Operator

This repo contains the OneCloud Service Operator for Kubernetes(OSO).

An operator in Kubernetes is the combination of one or more [custom resources](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) and [controllers](https://kubernetes.io/docs/reference/glossary/?fundamental=true#term-controller) managing said custom resources.

The OSO will allow containerized applications and Kubernetes users to create, update, delete and retrieve the status of objects in OneCloud services such as Server, Image, Network, Storage, etc. using the Kubernetes API, for example using Kubernetes manifests or `kubectl` plugins.

## Installation

```shell
# install all crds
make install

# build
make manager

# run locally
./manager --config xxx.conf

# build and push docker image
make image
```

## Contribution

See [Contribution](./CONTRIBUTING.md).

## License

Apache License 2.0. See [LICENSE](./LICENSE).

0 comments on commit 01cff42

Please sign in to comment.