Concept / Core model
Dependency contracts
Connecting an application to PostgreSQL, Redis, mail, or single sign-on in Kubernetes usually requires configuring environment variables, Secret key names, and ConfigMap files differently for each backing provider. Running an in-cluster database operator on a laptop and Amazon RDS in production then means maintaining two sets of application settings. Kix avoids that duplication with dependency contracts: shared interfaces between service providers and consuming applications.
Decoupling what an app needs from who provides it
Section titled “Decoupling what an app needs from who provides it”An application package in Kix never binds directly to a specific operator such as CloudNativePG or StackGres. Instead, it declares that it needs a service matching a standard contract, such as a PostgreSQL database, Redis cache, SMTP mail server, OpenID Connect client, or HTTP gateway.
Kix checks both sides against that contract at build time. Every provider package verifies that its outputs include the host, port, database name, and credential fields required by the contract before exposing them to the cluster. Every consuming application reads only those contract fields to generate its environment variables, configuration files, and firewall rules.
Because the contract sits between the two packages, changing how a service is provisioned requires no changes to the application. Suppose you deploy Metabase across three clusters: one running StackGres, one running CloudNativePG, and a cloud cluster using Amazon RDS or Google Cloud SQL through an external service import. Across all three clusters, the Metabase instance definition stays identical.
Bundling credentials and respecting namespace boundaries
Section titled “Bundling credentials and respecting namespace boundaries”In plain Kubernetes YAML or Helm values, connecting to an authenticated service usually splits configuration across two places: the server address in one field and the login Secret in another. Those two settings can drift apart and point an application at one server with another server’s credentials.
In Kix, every authenticated contract bundles the login Secret reference alongside the connection address. When Kix runs the database or cache in the cluster, the provider package creates the Kubernetes Secret and attaches it to the contract. When the service runs outside Kix on RDS or an external mail provider, you attach a Secret reference to the service import, and Kix checks at build time that the Secret declares every required key, such as username and password.
Bundling credentials also follows a core Kubernetes boundary: a pod can read Secrets only in its own namespace. An unauthenticated internal mail relay carries no Secret, so one import can serve applications across every namespace. An authenticated database, cache, or mail import carries a Secret in one namespace, so you scope that import to its namespace and Kix blocks other namespaces from binding to a Secret they could not read at runtime.
Multi-tenant identity providers such as Keycloak split the shared provider from the per-namespace client. One Keycloak instance serves the whole cluster, while a small client instance in each application’s namespace pairs the central issuer URL with that namespace’s own client Secret.
Catching configuration and security mistakes early
Section titled “Catching configuration and security mistakes early”Shared contracts also let packages catch subtle configuration and security mistakes before deployment.
Once an application connects to a mail or single sign-on contract, the package owns the corresponding application settings and rejects duplicate environment variables or config keys. Where an application such as Immich would accept a password inside a JSON settings file stored in an unencrypted ConfigMap, the Kix package blocks that field and injects the password from the contract’s Secret instead.
Contracts also check protocol rules across mail clients. Kix rejects unencrypted connections to external mail servers so credentials and mail never cross the internet in clear text. Packages whose mailers would send passwords over a plain connection if STARTTLS is missing require implicit TLS when credentials are set, and clusters with generated network policies automatically open outbound egress to external mail ports.
Next, read Dependency injection to see how connected packages configure each other in both directions and switch between Secrets and cloud workload identities. For contract fields and Secret key names, see the Dependency contracts reference and Connect external databases, caches, mail, and single sign-on.