Configurr.Client 0.1.0-alpha1

This is a prerelease version of Configurr.Client.
The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package Configurr.Client --version 0.1.0-alpha1
                    
NuGet\Install-Package Configurr.Client -Version 0.1.0-alpha1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Configurr.Client" Version="0.1.0-alpha1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Configurr.Client" Version="0.1.0-alpha1" />
                    
Directory.Packages.props
<PackageReference Include="Configurr.Client" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Configurr.Client --version 0.1.0-alpha1
                    
#r "nuget: Configurr.Client, 0.1.0-alpha1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Configurr.Client@0.1.0-alpha1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Configurr.Client&version=0.1.0-alpha1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Configurr.Client&version=0.1.0-alpha1&prerelease
                    
Install as a Cake Tool

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

MIT

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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