Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add helm install based on kubeblocks #1788

Merged
merged 16 commits into from
Aug 8, 2023

Conversation

machinly
Copy link
Collaborator

@machinly machinly commented Jul 22, 2023

This RP defines a helm for a pika cluster, built on top of kubeblocks.
Use the following command to quickly install a highly available pika codis cluster.

  1. Install kbcli
  2. kubeblocks
  3. install pika cluster definition and install pika cluster
cd ./tools/kubeblock-helm/
helm install pika ./pika
helm install pika-cluster ./pika-cluster
  1. connect codis front end
 kubectl port-forward svc/pika-cluster-codis-fe 8080
  1. connect pika cluster
kubectl port-forward svc/pika-cluster-codis-proxy 19000
# start new terminal
redis-cli -p 19000 info

## connect to pika
```
redis-cli -p 9221
```
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the provided code patch, here are some observations and suggestions:

  1. Ensure that all dependencies are clearly stated and properly installed.
  2. Add comments or documentation to explain the purpose and usage of each section.
  3. Include error handling and validation checks where appropriate.
  4. Consider using variables or configuration files for values that may change in different environments.
  5. Perform testing and consider adding unit tests to verify the functionality of the code.
  6. Double-check that the indentation and formatting are consistent.

Without additional context or the actual code being referred to, it's challenging to provide specific bug risk assessments or improvement suggestions. However, based on the given information, these general recommendations should help you with your code review.

.project
.idea/
*.tmproj
.vscode/
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code patch you provided appears to be a file containing patterns for ignoring certain files and directories when building packages. It is commonly used in version control systems to exclude unnecessary files from being included in the package.

Overall, the code looks fine as it defines patterns to ignore various types of files and directories such as VCS directories, backup files, and IDE-specific files. However, here are a few suggestions for improvement:

  1. You might consider adding comments for each pattern to clarify why it is being ignored. This would make it easier for other developers to understand the purpose behind each pattern.
  2. Adding a descriptive header comment at the beginning of the file explaining its purpose would also be helpful.
  3. It's generally a good practice to sort the patterns alphabetically to improve readability and organization.
  4. You may want to review the list of IDE-specific files and directories to ensure that all relevant ones are included. Different IDEs have different file structures and naming conventions, so it's important to account for the ones you encounter in your project.

Apart from these suggestions, there don't seem to be any specific bugs or risks in the code patch. However, please note that without the context of how this code is used or the larger codebase it belongs to, it is challenging to provide a comprehensive review.

@machinly machinly marked this pull request as draft July 22, 2023 01:03
@Mixficsol
Copy link
Collaborator

Mixficsol commented Aug 6, 2023

  • 0516 没有稳定的 docker 镜像,先搞一个 helm,helm 是标准,后续再继续推进
  • 0603 有些 e2e 可以基于 operator 去做,比较方便
  • 0617 maxin 建议关注 kubeblock,比较成熟
  • 0701 helm 等待有稳定镜像才比较好,maxin 先打一下临时镜像
  • 0701 基于 kubeblock 实现下集群,需要codis集群的资料
  • 0708 Codis 集群已经能拉起来
  • 0722 基于 kubeblocks 初步PR,WIP

@machinly machinly marked this pull request as ready for review August 8, 2023 03:35
@machinly machinly changed the title WIP: Add helm install based on kubeblocks Add helm install based on kubeblocks Aug 8, 2023
yaoyinnan
yaoyinnan previously approved these changes Aug 8, 2023
Copy link
Contributor

@yaoyinnan yaoyinnan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

目前已验证部署 codis 集群过程。我测试了下目前支持的功能和未来需要支持的基础功能。可以考虑在之后的 PR 支持 Codis 的 group 自动部署和 slot 自动 rebalance。

支持的功能:

  1. 目前版本的 pika operator 借助 kubeblocks 可以方便地将 codis 和 pika 实例部署在 K8s 上,但是仅仅支持部署,实际添加实例到 codis 集群需要手动操作。
  2. 创建的只是单独的一个个 pika 实例,并不是主从 group,需要手动将 pika 实例添加到 codis 中并进行 slaveof 才能构成 group。
  3. 支持通过 kbcli 扩容,但扩容后的节点依旧需要手动添加和启动 rebalance。
  4. 支持通过 kbcli 缩容,但需要手动将 slot 先迁移走,然后再进行缩容,否则 pika 实例会直接被关闭,导致 slot 当前不可用。

未来迭代需要支持的基础功能:

  1. 集群:
    a. createGroup():支持部署 codis 集群能够自动部署 pika 实例后构成主从 group,从现有的部署 pika 实例修改到能够以 group 粒度的部署。
    b. addServerToGroup()、addSlotToGroup():支持新增 group 后根据配置判断是否将 slot rebalance 到新的 group。
    c. migrateSlotFromGroup()、deleteServerFromGroup():支持减少 group 后将 slot rebalance 到现有的其他 group,并将节点删除。需要做一些资源评估的校验,若去除 group 后的集群规格不足以容纳 slot,则需要返回相应的错误信息。
  2. 监控:
    a. 支持部署 exporter、prometheus、grafana 的 pods,能够对 codis 集群进行监控。
  3. 自愈:
    a. 支持哨兵模式,能够通过 codis-dashboard 对 group 进行自动切主。
  4. 存储
    a. 创建 PVC 和 PV 并绑定 PV,使用持久存储卷。

tools/helm/README.md Outdated Show resolved Hide resolved
tools/kubeblocks_helm/README.md Outdated Show resolved Hide resolved
tools/kubeblocks_helm/pika-cluster/Chart.yaml Outdated Show resolved Hide resolved
tools/kubeblocks_helm/pika/Chart.yaml Outdated Show resolved Hide resolved
@chejinge chejinge merged commit 76d437d into OpenAtomFoundation:unstable Aug 8, 2023
10 of 11 checks passed
@machinly machinly deleted the feat_helm branch August 16, 2023 06:37
bigdaronlee163 pushed a commit to bigdaronlee163/pika that referenced this pull request Jun 8, 2024
* helm: add part of pika cluster definition
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants