ops: route Belki S3 through HAProxy

This commit is contained in:
nyan404 committed 2026-09-24 00:56:35 +03:00
1 parent 6c508e7c1f
commit 3ae0257c46
4 files changed
+8 -3

No files matched your search

+4
View File
@@ -79,6 +79,10 @@ The final gateway Dockerfile must copy `nginx.conf` into the release image, not
`app/belki/image_host.py` now uses private distributed MinIO rather than `nyan.nyan404.ru`. The five internal S3 endpoints are tried in order for each operation; uploads are stored under an unguessable 128-bit object ID and public URLs resolve only through `https://cat.nyan404.ru/api/images/<id>`. Keep the MinIO bucket private. `belki-image-store` is a standalone out-of-band Secret with only `GetObject`/`PutObject` plus required `GetBucketLocation` for `belki-images`; never merge it into CI-recreated `belki-runtime` or commit credentials. Existing legacy img.nyan404.ru URLs remain stored as historical links and cannot be recovered by this change.
# 2026-09-24: Belki S3 HAProxy front door
`belki-image-store` now points to the in-cluster HAProxy Service `10.43.30.146:9000` (`minio-haproxy` in namespace `minio-proxy`) instead of listing the five MinIO node addresses. The live Secret was updated out-of-band and both Belki deployments were restarted; credentials remain out of the repository.
# 2026-09-21: admin inspection score breakdown
Inspection results persist the base score for the number of inspections and each resource's calculated contribution in addition to the total. `/admin` displays these details in a dedicated `Баллы` column without changing the VK/public report text; legacy rows fall back to the stored total.
+1 -1
View File
@@ -20,7 +20,7 @@ metadata:
namespace: belki
type: Opaque
stringData:
BELKI_S3_ENDPOINTS: 10.18.0.50:9000,10.18.0.51:9000,10.18.0.52:9000,10.18.0.53:9000,10.18.0.55:9000
BELKI_S3_ENDPOINTS: 10.43.30.146:9000
BELKI_S3_ACCESS_KEY: replace-out-of-band
BELKI_S3_SECRET_KEY: replace-out-of-band
BELKI_S3_BUCKET: belki-images
+1 -1
View File
@@ -68,7 +68,7 @@ mindmap
SQLite local fallback
Private MinIO image storage
belki-images bucket
five internal S3 endpoints
HAProxy front door 10.43.30.146:9000
bucket-scoped GetObject PutObject GetBucketLocation account
public proxy /api/images/id
Integrations
+2 -1
View File
@@ -20,7 +20,8 @@
- [`CONTRIBUTING.md`](./CONTRIBUTING.md): contribution and verification rules.
## Runtime / Deployment
- 2026-09-08: report screenshots and VK attachment mirrors use private distributed MinIO through the `minio==7.2.20` SDK. `belki-image-store` is a separate, out-of-band Kubernetes Secret containing the five internal endpoints, a bucket-scoped `GetObject`/`PutObject` account plus required `GetBucketLocation`, and `belki-images`; it is deliberately separate from CI-managed `belki-runtime` so normal deploys cannot remove it. `belki-web` and `belki-bot` return/retain `https://cat.nyan404.ru/api/images/<128-bit-random-id>.<extension>` while `Handler` proxies reads from MinIO. MinIO has no public exposure.
- 2026-09-08: report screenshots and VK attachment mirrors use private distributed MinIO through the `minio==7.2.20` SDK. `belki-image-store` is a separate, out-of-band Kubernetes Secret containing the internal S3 endpoint, a bucket-scoped `GetObject`/`PutObject` account plus required `GetBucketLocation`, and `belki-images`; it is deliberately separate from CI-managed `belki-runtime` so normal deploys cannot remove it. `belki-web` and `belki-bot` return/retain `https://cat.nyan404.ru/api/images/<128-bit-random-id>.<extension>` while `Handler` proxies reads from MinIO. MinIO has no public exposure.
- 2026-09-24: switched the live Belki S3 endpoint from the five direct MinIO nodes to the in-cluster HAProxy front door `10.43.30.146:9000` (`minio-haproxy` in namespace `minio-proxy`). The cluster Secret was updated out-of-band and `belki-web`/`belki-bot` were restarted; the repository example mirrors this endpoint. HAProxy remains responsible for balancing the healthy MinIO nodes.
- `Dockerfile.base` is rebuilt and pushed with the immutable `py312-<commit>` tag before the final Belki image; `Dockerfile` accepts that base through `BELKI_BASE_IMAGE`, leaving only application sources in the final layer.
- GitLab CI runs the build job.
- Production container architecture is explicitly `linux/amd64`: CI sets `DOCKER_DEFAULT_PLATFORM` and passes `--platform linux/amd64`, Dockerfiles pin the platform, and Kubernetes workloads select nodes labeled `kubernetes.io/arch: amd64`. The former private Python base tag was arm64-only and is no longer used by the application image.