forked from oceanbase/ob-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix compatibility for 2.0.0 release (oceanbase#85)
Fix compatibility for 2.0.0 release
- Loading branch information
Showing
50 changed files
with
8,551 additions
and
1,201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: release helm chart | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
- '*release' | ||
- 'helm-chart' | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Configure Git | ||
run: | | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
- name: Run chart-releaser | ||
uses: helm/[email protected] | ||
env: | ||
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,94 +1,67 @@ | ||
# ob-operator-generate | ||
// TODO(user): Add simple overview of use/purpose | ||
# What is ob-operator | ||
The ob-operator is a Kubernetes operator that simplifies the deployment and management of OceanBase cluster and related resources on Kubernetes. | ||
|
||
## Description | ||
// TODO(user): An in-depth paragraph about your project and overview of use | ||
# Quick Start | ||
## Requirement | ||
In order to run ob-operator properly, [cert-manager](https://cert-manager.io/docs) needs to be deployed as its dependency, for more details about how to install it, please refer to the [installation](https://cert-manager.io/docs/installation/) document. | ||
|
||
## Getting Started | ||
You’ll need a Kubernetes cluster to run against. You can use [KIND](https://sigs.k8s.io/kind) to get a local cluster for testing, or run against a remote cluster. | ||
**Note:** Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster `kubectl cluster-info` shows). | ||
## Deploy ob-operator | ||
### Using helm | ||
[Helm](https://github.com/helm/helm) is a package management tool for Kubernetes, please refer to the helm documentation to install the helm client. | ||
|
||
### Running on the cluster | ||
1. Install Instances of Custom Resources: | ||
|
||
```sh | ||
kubectl apply -f config/samples/ | ||
``` | ||
|
||
2. Build and push your image to the location specified by `IMG`: | ||
|
||
```sh | ||
make docker-build docker-push IMG=<some-registry>/ob-operator-generate:tag | ||
helm repo add ob-operator https://oceanbase.github.io/ob-operator/ | ||
helm install ob-operator ob-operator/ob-operator --namespace=oceanbase-system --create-namespace --version=2.0.0 | ||
``` | ||
|
||
3. Deploy the controller to the cluster with the image specified by `IMG`: | ||
|
||
```sh | ||
make deploy IMG=<some-registry>/ob-operator-generate:tag | ||
### Using configuration file | ||
The configuration files are located under deploy directory, using the following commands to deploy ob-operator. | ||
``` | ||
|
||
### Uninstall CRDs | ||
To delete the CRDs from the cluster: | ||
|
||
```sh | ||
make uninstall | ||
# Deploy ob-operator | ||
kubectl apply -f deploy/operator.yaml | ||
``` | ||
|
||
### Undeploy controller | ||
UnDeploy the controller from the cluster: | ||
## Deploy OceanBase cluster | ||
### Customize configuration file | ||
`deploy/obcluster.yaml` defines an OceanBase cluster, including deployment topology, resources, storages etc. You can configure your own OceanBase based on this file. | ||
|
||
```sh | ||
make undeploy | ||
### Deploy OceanBase | ||
Create namespace if needed, namespace should match the one in configuration file `deploy/obcluster.yaml` | ||
``` | ||
|
||
## Contributing | ||
// TODO(user): Add detailed information on how you would like others to contribute to this project | ||
|
||
### How it works | ||
This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/). | ||
|
||
It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/), | ||
which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster. | ||
|
||
### Test It Out | ||
1. Install the CRDs into the cluster: | ||
|
||
```sh | ||
make install | ||
kubectl create namespace oceanbase | ||
``` | ||
|
||
2. Run your controller (this will run in the foreground, so switch to a new terminal if you want to leave it running): | ||
|
||
```sh | ||
make run | ||
Create secret for users, secret name must be the same as these configed in deploy/obcluster.yaml under spec.userSecrets | ||
``` | ||
# create secret to hold password for user root | ||
kubectl create secret -n oceanbase generic test-user-root --from-literal=password='******' | ||
**NOTE:** You can also run this in one step by running: `make install run` | ||
# create secret to hold password for user proxyro, proxyro is a readonly user for obproxy to query meta info | ||
kubectl create secret -n oceanbase generic test-user-proxyro --from-literal=password='******' | ||
### Modifying the API definitions | ||
If you are editing the API definitions, generate the manifests such as CRs or CRDs using: | ||
# create secret to hold password for user monitor, monitor is a readonly user for obagent to query metric data | ||
kubectl create secret -n oceanbase generic test-user-monitor --from-literal=password='******' | ||
```sh | ||
make manifests | ||
# create secret to hold password for user operator, operator is the admin user for obproxy to maintain obcluster | ||
kubectl create secret -n oceanbase generic test-user-operator --from-literal=password='******' | ||
``` | ||
Using the following command to deploy OceanBase Cluster | ||
``` | ||
kubectl apply -f deploy/obcluster.yaml | ||
``` | ||
It may take a while to complete the whole process to deploy OceanBase cluster, you can use the following command to check whether it's finished | ||
``` | ||
kubectl get obclusters test -n oceanbase -o yaml | ||
``` | ||
wait until the status of obclster resource turns into running. | ||
|
||
**NOTE:** Run `make --help` for more information on all potential `make` targets | ||
|
||
More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html) | ||
|
||
## License | ||
|
||
Copyright 2023. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
### Connect to OceanBase Cluster | ||
After successfully deployed OceanBase cluster, you can connect to OceanBase cluster via any observer pod's ip. | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
# Contributing | ||
Contributions are warmly welcomed and greatly appreciated. Here are a few ways you can contribute: | ||
- Raise us an [Issue](https://github.com/oceanbase/ob-operator/issues). | ||
- Create a [Pull Request](https://github.com/oceanbase/ob-operator/pulls). | ||
|
||
# License | ||
Ob-operator is licensed under the [MulanPSL - 2.0](http://license.coscl.org.cn/MulanPSL2) license. You can copy and use the source code freely. When you modify or distribute the source code, please follow the MulanPSL - 2.0 license. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.