Skip to content

Commit 5a5db5d

Browse files
authored
Merge pull request #52 from Electronic-Waste/feat/readme
feat(doc): Add initial README file for Databend Operator
2 parents 2716e16 + d6b5e27 commit 5a5db5d

File tree

4 files changed

+40
-184
lines changed

4 files changed

+40
-184
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
git diff --cached --exit-code || (echo 'Please run "go mod tidy" to sync Go modules' && exit 1);
3131
- name: Check auto-generated assets
3232
run: |
33-
make generate && git add pkg config &&
33+
make generate && git add pkg manifests &&
3434
git diff --cached --exit-code || (echo 'Please run "make generate" to generate assets' && exit 1);
3535
- name: Verify gofmt
3636
run: |

Makefile

Lines changed: 2 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -90,62 +90,17 @@ build: manifests generate fmt vet ## Build manager binary.
9090
run: fmt vet ## Run a controller from your host.
9191
go run ./cmd/main.go
9292

93-
# If you wish to build the manager image targeting other platforms you can use the --platform flag.
94-
# (i.e. docker build --platform linux/arm64). However, you must enable docker buildKit for it.
95-
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
96-
.PHONY: docker-build
97-
docker-build: ## Build docker image with the manager.
98-
$(CONTAINER_TOOL) build -t ${IMG} .
99-
100-
.PHONY: docker-push
101-
docker-push: ## Push docker image with the manager.
102-
$(CONTAINER_TOOL) push ${IMG}
103-
104-
# PLATFORMS defines the target platforms for the manager image be built to provide support to multiple
105-
# architectures. (i.e. make docker-buildx IMG=myregistry/mypoperator:0.0.1). To use this option you need to:
106-
# - be able to use docker buildx. More info: https://docs.docker.com/build/buildx/
107-
# - have enabled BuildKit. More info: https://docs.docker.com/develop/develop-images/build_enhancements/
108-
# - be able to push the image to your registry (i.e. if you do not set a valid value via IMG=<myregistry/image:<tag>> then the export will fail)
109-
# To adequately provide solutions that are compatible with multiple platforms, you should consider using this option.
110-
PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
111-
.PHONY: docker-buildx
112-
docker-buildx: ## Build and push docker image for the manager for cross-platform support
113-
# copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile
114-
sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross
115-
- $(CONTAINER_TOOL) buildx create --name databend-operator-builder
116-
$(CONTAINER_TOOL) buildx use databend-operator-builder
117-
- $(CONTAINER_TOOL) buildx build --push --platform=$(PLATFORMS) --tag ${IMG} -f Dockerfile.cross .
118-
- $(CONTAINER_TOOL) buildx rm databend-operator-builder
119-
rm Dockerfile.cross
120-
121-
.PHONY: build-installer
122-
build-installer: manifests generate kustomize ## Generate a consolidated YAML with CRDs and deployment.
123-
mkdir -p dist
124-
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
125-
$(KUSTOMIZE) build config/default > dist/install.yaml
126-
127-
##@ Deployment
128-
12993
ifndef ignore-not-found
13094
ignore-not-found = false
13195
endif
13296

13397
.PHONY: install
13498
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
135-
$(KUSTOMIZE) build config/crd | $(KUBECTL) apply -f -
99+
$(KUSTOMIZE) build manifests/crds | $(KUBECTL) apply -f -
136100

137101
.PHONY: uninstall
138102
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
139-
$(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
140-
141-
.PHONY: deploy
142-
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
143-
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
144-
$(KUSTOMIZE) build config/default | $(KUBECTL) apply -f -
145-
146-
.PHONY: undeploy
147-
undeploy: kustomize ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
148-
$(KUSTOMIZE) build config/default | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
103+
$(KUSTOMIZE) build manifests/crds | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
149104

150105
##@ Dependencies
151106

README.md

Lines changed: 37 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,100 +1,67 @@
1-
# databend-operator
2-
// TODO(user): Add simple overview of use/purpose
1+
# Databend Operator
32

4-
## Description
5-
// TODO(user): An in-depth paragraph about your project and overview of use
3+
<img src="https://github.com/databendlabs/databend/assets/172204/9997d8bc-6462-4dbd-90e3-527cf50a709c" alt="databend" />
64

7-
## Getting Started
5+
<div align="center">
86

9-
### Prerequisites
10-
- go version v1.22.0+
11-
- docker version 17.03+.
12-
- kubectl version v1.11.3+.
13-
- Access to a Kubernetes v1.11.3+ cluster.
7+
<div>
8+
<a href="https://link.databend.com/join-slack">
9+
<img src="https://img.shields.io/badge/slack-databend-0abd59?logo=slack" alt="slack" />
10+
</a>
1411

15-
### To Deploy on the cluster
16-
**Build and push your image to the location specified by `IMG`:**
12+
<a href="https://link.databend.com/join-feishu">
13+
<img src="https://img.shields.io/badge/feishu-databend-0abd59" alt="feishu" />
14+
</a>
1715

18-
```sh
19-
make docker-build docker-push IMG=<some-registry>/databend-operator:tag
20-
```
21-
22-
**NOTE:** This image ought to be published in the personal registry you specified.
23-
And it is required to have access to pull the image from the working environment.
24-
Make sure you have the proper permission to the registry if the above commands don’t work.
16+
<br>
2517

26-
**Install the CRDs into the cluster:**
18+
</div>
19+
</div>
2720

28-
```sh
29-
make install
30-
```
21+
[Kubernetes](https://kubernetes.io/docs/home/) is an open source container orchestration engine for automating deployment, scaling, and management of containerized applications. [Operators](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/) are software extensions to Kubernetes that make use of custom resources to manage applications and their components. Operators follow Kubernetes principles, notably the control loop.
3122

32-
**Deploy the Manager to the cluster with the image specified by `IMG`:**
23+
Use this operator to manage [Databend](https://github.com/databendlabs/databend) clusters which are deployed as custom resources. In short, the task of configuring, creating, managing, automatically scaling up and scaling-in of Databend cluster(s) in a Kubernetes environment has been made simple, easy and quick.
3324

34-
```sh
35-
make deploy IMG=<some-registry>/databend-operator:tag
36-
```
25+
## Deploying Operator
3726

38-
> **NOTE**: If you encounter RBAC errors, you may need to grant yourself cluster-admin
39-
privileges or be logged in as admin.
27+
Run the following command to install the latest changes of the Databend Operator:
4028

41-
**Create instances of your solution**
42-
You can apply the samples (examples) from the config/sample:
43-
44-
```sh
45-
kubectl apply -k config/samples/
29+
```shell
30+
kubectl apply -k "github.com/databendcloud/databend-operator/manifests"
4631
```
4732

48-
>**NOTE**: Ensure that the samples has default values to test it out.
49-
50-
### To Uninstall
51-
**Delete the instances (CRs) from the cluster:**
52-
53-
```sh
54-
kubectl delete -k config/samples/
55-
```
33+
## Get Started
5634

57-
**Delete the APIs(CRDs) from the cluster:**
35+
You can get started by deploying [this example](./examples/get-started/) from `examples/get-started`!
5836

59-
```sh
60-
make uninstall
61-
```
37+
Learn more about Databend deployments from [this guide](https://docs.databend.com/guides/deploy/deploy/understanding-deployment-modes).
6238

63-
**UnDeploy the controller from the cluster:**
39+
Step1: Deploy Databend Meta Cluster
6440

65-
```sh
66-
make undeploy
41+
```shell
42+
helm repo add databend https://charts.databend.com
43+
helm install meta databend/databend-meta --namespace databend-system
6744
```
6845

69-
## Project Distribution
46+
Step2: Prepare Object Storage
7047

71-
Following are the steps to build the installer and distribute this project to users.
48+
We'll use [Minio](https://github.com/minio/minio) as the object storage for our example.
7249

73-
1. Build the installer for the image built and published in the registry:
74-
75-
```sh
76-
make build-installer IMG=<some-registry>/databend-operator:tag
50+
```shell
51+
kubectl apply -f "github.com/databendcloud/databend-operator/examples/get-started/minio.yaml"
7752
```
7853

79-
NOTE: The makefile target mentioned above generates an 'install.yaml'
80-
file in the dist directory. This file contains all the resources built
81-
with Kustomize, which are necessary to install this project without
82-
its dependencies.
83-
84-
2. Using the installer
54+
Step3: Define Tenant
8555

86-
Users can just run kubectl apply -f <URL for YAML BUNDLE> to install the project, i.e.:
87-
88-
```sh
89-
kubectl apply -f https://raw.githubusercontent.com/<org>/databend-operator/<tag or branch>/dist/install.yaml
56+
```shell
57+
kubectl apply -f "github.com/databendcloud/databend-operator/examples/get-started/tenant.yaml"
9058
```
9159

92-
## Contributing
93-
// TODO(user): Add detailed information on how you would like others to contribute to this project
94-
95-
**NOTE:** Run `make help` for more information on all potential `make` targets
60+
Step4: Deploy Dataebend Query Cluster(Warehouse)
9661

97-
More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html)
62+
```shell
63+
kubectl apply -f "github.com/databendcloud/databend-operator/examples/get-started/warehouse.yaml"
64+
```
9865

9966
## License
10067

config/rbac/role.yaml

Lines changed: 0 additions & 66 deletions
This file was deleted.

0 commit comments

Comments
 (0)