minio/sidekick 是一个托管在 GitHub 上的开源项目,主要使用 Go 编写,采用 GNU Affero General Public License v3.0 许可证,目前获得 584 个 Star、94 次 Fork。
仓库全名
minio/sidekick
README 摘要
sidekick is a high-performance sidecar load balancer. By attaching a tiny load balancer to each client application process, you can eliminate the need for a centralized load balancer and DNS failover management. sidekick automatically avoids sending traffic to the failed servers by checking their health via the readiness API and HTTP error returns. Architecture Install Binary Releases OS | ARCH | Binary |…
sidekick is a high-performance sidecar load balancer. By attaching a tiny load balancer to each client application process, you can eliminate the need for a centralized load balancer and DNS failover management. sidekick automatically avoids sending traffic to the failed servers by checking their health via the readiness API and HTTP error returns.
[!IMPORTANT]
You will need a working Go environment. Therefore, please follow How to install Go.
The minimum version required is go1.22
Usage
NAME:
sidekick - High-Performance sidecar load-balancer
USAGE:
sidekick - [FLAGS] SITE1 [SITE2..]
FLAGS:
--address value, -a value listening address for sidekick (default: ":8080")
--health-path value, -p value health check path
--read-health-path value, -r value health check path for read access - valid only for failover site
--health-port value health check port (default: 0)
--health-duration value, -d value health check duration in seconds (default: 5s)
--health-timeout value health check timeout in seconds (default: 10s)
--insecure, -i disable TLS certificate verification
--rr-dns-mode enable round-robin DNS mode
--log, -l enable logging
--trace value, -t value enable request tracing - valid values are [all,application,minio] (default: "all")
--quiet, -q disable console messages
--json output sidekick logs and trace in json format
--debug output verbose trace
--cacert value CA certificate to verify peer against
--client-cert value client certificate file
--client-key value client private key file
--cert value server certificate file
--key value server private key file
--pprof :1337 start and listen for profiling on the specified address (e.g. :1337)
--dns-ttl value choose custom DNS TTL value for DNS refreshes for load balanced endpoints (default: 10m0s)
--errors, -e filter out any non-error responses
--status-code value filter by given status code
--host-balance value specify the algorithm to select backend host when load balancing, supported values are 'least', 'random' (default: "least")
--help, -h show help
--version, -v print the version
Examples
Load balance across a web service using DNS provided IPs.
Ensure that the standard storage class was previously installed.
Note that TLS is disabled for this test. Note also that the minio tenant created is called myminio.
Configure mc and upload some data. Use mybucket as the s3 bucket name.
Create bucket named mybucket and upload some text data for spark word count sample.
mc alias set myminio http://localhost:9000 minio minio123
mc mb myminio/mybucket
mc cp /etc/hosts myminio/mybucket/mydata.txt
Run the spark job in k8s
Obtain the IP address and port of the minio service. Use them as input to fs.s3a.endpoint the below SparkApplication. e.g. http://10.43.141.149:80
The above SparkApplication will not complete until the Health check returns “200 OK”, in this case, when there is a MinIO read quorum. The Health check is provided at the path “/v1/health.” It returns “200 OK” even if any one of the sites is reachable; otherwise, it returns a “502 Bad Gateway” error.
评论