Configurr.Client
0.1.0-alpha1
dotnet add package Configurr.Client --version 0.1.0-alpha1
NuGet\Install-Package Configurr.Client -Version 0.1.0-alpha1
<PackageReference Include="Configurr.Client" Version="0.1.0-alpha1" />
<PackageVersion Include="Configurr.Client" Version="0.1.0-alpha1" />
<PackageReference Include="Configurr.Client" />
paket add Configurr.Client --version 0.1.0-alpha1
#r "nuget: Configurr.Client, 0.1.0-alpha1"
#:package Configurr.Client@0.1.0-alpha1
#addin nuget:?package=Configurr.Client&version=0.1.0-alpha1&prerelease
#tool nuget:?package=Configurr.Client&version=0.1.0-alpha1&prerelease
Configurr.Client
.NET client library for consuming configuration rendered by the Configurr Kubernetes operator.
Auto-discovers mounted ConfigMap JSON files, supports hot reload, environment variable injection, section prefixing, and health checks.
Built on Microsoft.Extensions.Configuration — works with IOptions<T>, IOptionsMonitor<T>, and all standard .NET
configuration patterns.
Installation
dotnet add package Configurr.Client
Quick start
var builder = WebApplication.CreateBuilder(args);
// Auto-discovers all *.json files in /config, enables hot reload
builder.AddConfigurr();
var app = builder.Build();
app.Run();
That's it. All JSON files mounted to /config/ are loaded automatically with hot reload enabled.
Configuration options
builder.AddConfigurr(configurr =>
{
// Change the base directory (default: /config)
configurr.BasePath = "/etc/myapp/config";
// Load environment variables with a prefix
configurr.EnvVarSources.Add(new EnvVarSource { Prefix = "DB_" });
// Enable health check endpoint
configurr.EnableHealthCheck = true;
// Control files explicitly instead of auto-discovery
configurr.AutoDiscover = false;
configurr.JsonFiles.Add(new JsonFileSource
{
FileName = "appsettings.Database.json",
SectionPrefix = "Database" // Nests all keys under "Database:*"
});
});
All options
| Option | Type | Default | Description |
|---|---|---|---|
BasePath |
string |
"/config" |
Directory where ConfigMap JSON files are mounted |
AutoDiscover |
bool |
true |
Auto-load all *.json files in BasePath |
EnableHotReload |
bool |
true |
Watch files for changes and reload automatically |
OptionalFiles |
bool |
true |
Silently ignore missing files (config may arrive after pod starts) |
EnableHealthCheck |
bool |
false |
Register a health check that verifies config files exist and are valid JSON |
JsonFiles |
List<JsonFileSource> |
[] |
Explicit JSON file sources to load |
EnvVarSources |
List<EnvVarSource> |
[] |
Environment variable sources filtered by prefix |
JsonFileSource
| Property | Type | Default | Description |
|---|---|---|---|
FileName |
string |
— | File name (relative to BasePath) or absolute path |
Optional |
bool? |
inherits OptionalFiles |
Whether a missing file is ignored |
ReloadOnChange |
bool? |
inherits EnableHotReload |
Whether to watch for changes |
SectionPrefix |
string? |
null |
Nest all keys under this prefix (e.g. "Database" makes Host → Database:Host) |
EnvVarSource
| Property | Type | Default | Description |
|---|---|---|---|
Prefix |
string? |
null |
Filter env vars by prefix. The prefix is stripped from key names (e.g. DB_Host → Host). null loads all env vars |
Health checks
When EnableHealthCheck = true, a health check named "configurr" is registered with tags configurr, config,
ready.
| State | Condition |
|---|---|
| Healthy | All config files exist and contain valid JSON |
| Degraded | Optional files are missing |
| Unhealthy | Required files are missing or contain invalid JSON |
Map it to an endpoint:
app.MapHealthChecks("/healthz/ready", new HealthCheckOptions
{
Predicate = check => check.Tags.Contains("ready")
});
Usage with Configurr operator
The operator renders ConfigMaps that you mount into your pod:
spec:
containers:
- name: my-app
volumeMounts:
- name: db-config
mountPath: /config/appsettings.Database.json
subPath: appsettings.Database.json
readOnly: true
envFrom:
- configMapRef:
name: my-app-database-env
volumes:
- name: db-config
configMap:
name: my-app-database-json
Then in your application:
builder.AddConfigurr(configurr =>
{
configurr.EnvVarSources.Add(new EnvVarSource { Prefix = "DB_" });
configurr.EnableHealthCheck = true;
});
// Bind to strongly-typed options (supports hot reload via IOptionsMonitor)
builder.Services.Configure<DatabaseOptions>(
builder.Configuration.GetSection("Database"));
IConfigurationBuilder overload
For non-host scenarios (e.g. tests), use the IConfigurationBuilder extension:
var config = new ConfigurationBuilder()
.AddConfigurr(configurr =>
{
configurr.BasePath = "./test-config";
configurr.AutoDiscover = true;
})
.Build();
Release
Releases are triggered by client/v*.*.* git tags and published
to NuGet.org and GitHub Packages. See
the release guide for details.
License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.Extensions.Configuration (>= 10.0.3)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 10.0.3)
- Microsoft.Extensions.Configuration.Json (>= 10.0.3)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.3)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.3)
- Microsoft.Extensions.Options (>= 10.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|