What is this Hyperf skeleton package?
Hyperf officially provides container images, and the configuration options are very open. It is not complicated to deploy Hyperf to the cloud. Let’s take Kubernetes as an example and make some modifications to Hyperf’s default skeleton package so that it can run on Kubernetes gracefully.
Please refer to this blog: https://guxi.me/posts/cloudnative-hyperf/
The difference from the official Hyperf skeleton
- Add Kubernetes health check routing (specific content still needs to be implemented independently by users)
- According to Docker container custom, output logs to stdout
- Outputting JSON format in production environments is convenient for integrating FluentBit, ELK and other collection tools.
- Set different log levels according to environment variables
- Tracing and Metric components are integrated by default
- The default is Base mode, and only 1 process is enabled. This mode can be used to implement process-level expansion and shrinking of Kubernetes HPA.
- Due to the above reasons, the Metric component does not enable independent processes by default and outputs directly from the route
- Timer cleaning is performed when Worker terminates, achieving elegant exit under Kubernetes
- Tracing uses Jaeger by default
- Integrate league/flysystem, the development environment uses the local file system by default, and other environments use the S3 driver by default.
- Turn on the Error listener
- Added helm chart, deployed to k8s with one click
- Integrated APIDOG
# helm 2
helm install .helm
# helm 3
helm install hyperf .helm