How onexstack/onex works
Project Type and Purpose
• This is a Go-based, enterprise-grade cloud-native platform (“OneX”) that implements a full microservices ecosystem.
• It includes a custom Kubernetes API server with CRDs, a suite of controllers (controller-manager), multiple business services (cacheserver, gateway, fakeserver, nightwatch, toyblc, usercenter, pump, etc.), CLI tools (onex, onexctl), code-generation pipelines, and deployment manifests for Kubernetes.
File Structure Analysis
• Top-level “cmd/” directory holds each microservice or tool’s main.go (e.g., cmd/onex-apiserver, cmd/onex-gateway, cmd/onex-usercenter, cmd/onexctl, etc.).
• “internal/” and “pkg/” contain shared libraries: middleware, configuration, clients, contract definitions, code-gen tools, utilities.
• “api/” and “pkg/api/…” hold OpenAPI/Swagger specs and Protobuf/gRPC definitions.
• “manifests/” provides Kubernetes YAML, Helm charts, and Kustomize overlays for deploying all components and dependencies (etcd, Kafka, Jaeger, MariaDB, MongoDB, Redis, Traefik, etc.).
• “docs/” and “scripts/” drive documentation generation, build, test, and release workflows.
README Insights
• It uses Kubernetes CRD machinery for custom resources, follows controller–reconciler patterns, and exposes gRPC and REST endpoints for each service.