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

doc: add pika-operator guide on readme #1831

Merged
merged 3 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,33 @@ Here is an example usage of the script:
```bash
./build_docker.sh -p linux/amd64 -t private_registry/pika:latest
```
### Use pika-operator to deploy

You can use the `pika-operator` to easily deploy `pika` in a Kubernetes environment.

Please note that this operator is **NOT** recommended for use in a production environment.

Local Deploy:

1. install [MiniKube](https://minikube.sigs.k8s.io/docs/start/)
2. deploy pika-operator
```bash
cd tools/pika_operator
make minikube-up # run this if you don't have a minikube cluster
make local-deploy
```
3. create pika instance
```
cd tools/pika_operator
kubectl apply -f examples/pika-sample/

# check pika status
kubectl get pika pika-sample

# get pika instance info
kubectl run pika-sample-test --image redis -it --rm --restart=Never \
-- /usr/local/bin/redis-cli -h pika-sample -p 9221 info
```

## Performance

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 for improvement:

  1. Consider adding comments: It's beneficial to include comments in the code to provide clarity and make it easier for other developers to understand the code's functionality.

  2. Error handling: Ensure that appropriate error handling mechanisms are in place to handle any potential errors or exceptions that may occur during execution.

  3. Input validation: Validate the command-line arguments passed to the script or function to ensure they meet the expected format and values. This helps prevent unexpected behavior or security vulnerabilities.

  4. Security considerations: When using private registries, make sure to handle authentication and authorization properly to maintain security. Avoid storing sensitive information directly in the code (such as usernames and passwords) and consider using environment variables or secure secrets management solutions.

  5. Documentation: Provide clear and comprehensive documentation for the steps required to deploy and use the pika-operator in a Kubernetes environment. Include any necessary prerequisites and helpful tips to aid users in the deployment process.

  6. Maintainability: Create thorough unit tests to ensure the reliability and maintainability of the codebase. Additionally, consider adhering to coding best practices and conventions for consistent style and readability.

It's important to review the specific implementation details of the script or function to identify any bugs or issues accurately.

Expand Down
27 changes: 27 additions & 0 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,33 @@ redis-cli -p 9221 "info"
./build_docker.sh -p linux/amd64 -t private_registry/pika:latest
```

### 使用 pika-operator 部署

使用 `pika-operator` 可以简单的在 Kubernetes 环境中部署单实例 `pika` 。
请勿在生产环境中使用此功能。

本地安装:

1. 安装 [MiniKube](https://minikube.sigs.k8s.io/docs/start/)
2. 部署 pika-operator
```bash
cd tools/pika_operator
make minikube-up # run this if you don't have a minikube cluster
make local-deploy
```
3. 创建 pika 实例
```
cd tools/pika_operator
kubectl apply -f examples/pika-sample/

# check pika status
kubectl get pika pika-sample

# get pika instance info
kubectl run pika-sample-test --image redis -it --rm --restart=Never \
-- /usr/local/bin/redis-cli -h pika-sample -p 9221 info
```

## 性能 (感谢[deep011](https://github.com/deep011)提供性能测试结果)
### 注!!!
本测试结果是在特定环境特定场景下得出的,不能够代表所有环境及场景下的表现,__仅供参考__。
Copy link

Choose a reason for hiding this comment

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

Without the complete context of the code, it's difficult to provide a comprehensive code review. However, based on the provided code snippet, here are some observations:

  1. Comments: The comments in the code are helpful for providing instructions and context, which is good practice.

  2. Documentation: It's great that you have included documentation on how to deploy and use pika-operator in a Kubernetes environment. Documenting installation steps and usage instructions makes it easier for others to understand and use your code.

  3. Error handling: It's not clear from the given code snippet how error handling is done. Proper error handling is crucial to ensure the stability and reliability of the application. Make sure to handle any potential errors that may occur during deployment and when interacting with the pika instance.

  4. Testing: It's important to thoroughly test the functionality of your code to identify any bugs or issues. Automated unit tests and integration tests can help ensure the correctness of your code.

  5. Security considerations: Ensure that you follow security best practices when deploying applications, especially in production environments. Use secure configurations, such as strong passwords or authentication methods, to protect sensitive data.

Overall, it seems like a good starting point, but further review and testing would be necessary to fully assess any bug risks and suggest improvements.

Expand Down
Loading