Rancher is a comprehensive Kubernetes management platform that provides multi-cluster management, authentication/authorization, application catalog (Helm charts), fleet management, and a web UI. The codebase is a monolithic Go application with two primary entry points: the Rancher server (main.go) and the Rancher agent (cmd/agent/main.go). The server runs as a Kubernetes operator using the controller-runtime pattern, managing custom resources for clusters, projects, users, authentication providers, and catalogs. It integrates with upstream Kubernetes APIs via generated clients (norman, wrangler) and provides a unified API (Steve) for downstream cluster management. The architecture follows a hub-and-spoke model where the Rancher server manages multiple downstream clusters through cluster agents. Key data flows include: cluster provisioning (RKE2, K3s, cloud providers), authentication (OIDC, LDAP, AD, SAML), catalog synchronization (Helm charts from Git/OCI), and fleet-based GitOps deployment. External dependencies include Kubernetes (v1.36), etcd, cert-manager, and various cloud provider SDKs (AWS, Azure, GCP, AliCloud). The codebase demonstrates high craftsmanship with extensive code generation, clean separation of concerns, comprehensive test infrastructure (unit, integration, controller-runtime envtest), and production-grade operational tooling.
Portainer Community Edition is a full-stack container management platform providing a unified web UI and REST API for Docker, Docker Swarm, Podman, Kubernetes, Azure Container Instances, and edge computing environments. The backend is written in Go, using BoltDB for storage, gorilla/mux for routing, and includes proxy layers for Docker/Kubernetes/Azure APIs, Helm chart management, GitOps workflows, LDAP/OAuth authentication, RBAC, and backup/restore functionality. The frontend is a hybrid of legacy AngularJS (1.8) and modern React with TypeScript, using React Query, Zustand, Formik, Yup, and a custom UI component library with Storybook. Key entry points are the Go main command (api/cmd/portainer/main.go) and the webpack-compiled React/AngularJS app (app/app.js). The system manages endpoints, stacks, services, containers, volumes, networks, images, registries, edge devices, user teams, and access controls through a layered architecture of HTTP handlers, data services, and middleware. External dependencies include Docker SDK, Kubernetes client libraries, Helm SDK, and various third-party registries.