$ show uswitch/yggdrasil
Yggdrasil is an Envoy control plane that watches Kubernetes ingress resources across multiple clusters and generates dynamic configuration for Envoy proxies. It implements a modular architecture with separate packages for Kubernetes integration (pkg/k8s) and Envoy configuration generation (pkg/envoy). The system uses Kubernetes informers to watch resources, aggregates events from multiple clusters, translates ingress objects into Envoy listeners and clusters, and serves the configuration via xDS gRPC protocol. It also provides metrics and health endpoints for monitoring. The code demonstrates good separation of concerns, proper use of Kubernetes client-go patterns, and clean abstraction for handling multiple Kubernetes API versions.
The LLM identified 2 files worth highlighting for reuse:
Implements a reusable pattern for aggregating Kubernetes resources from multiple clusters using informers. Provides a clean event channel interface that decouples resource watching from consumption. Demonstrates proper use of Kubernetes client-go informers, cache synchronization, and conditional resource watching based on configuration. Could be extracted as a standalone library for multi-cluster Kubernetes resource aggregation with minimal modification.
Provides version-agnostic handling of Kubernetes ingress resources across different API versions (extensions/v1beta1, networking/v1beta1, networking/v1). Solves the common problem of dealing with evolving Kubernetes APIs by offering a unified interface. The conversion functions are well-isolated and handle complex nested structures like rules and TLS configurations. This pattern could be reused in any project needing to work with Kubernetes resources across multiple versions.