KonfigMap 1.0.10

dotnet tool install --global KonfigMap --version 1.0.10
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local KonfigMap --version 1.0.10
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=KonfigMap&version=1.0.10
nuke :add-package KonfigMap --version 1.0.10

KonfigMap

KonfigMap is dotnet tool, it generates properties files out of ASP.NET Core JSON config files to be used with kubernetes and kustomize

CLI details:

Description:
  Generates properties files out of ASP.NET Core JSON config files.

Usage:
  KonfigMap propsgen [options]

Options:
  -cd, --config-dir <config-dir> (REQUIRED)          Collection of directories which contains ASP.NET Core JSON configuration Files.
  -cf, --config-file <config-file>                   Collection of ASP.NET Core JOSN configuration files (file paths).
  -od, --output-dir <output-dir>                     Output directory for the generated properties files. [default: .]
  -of, --output-filename <output-filename>           Generate properties file name. [default: env.properties]
  -ep, --env-prefix <env-prefix>                     The environment variable name prefix. ASP.NET Core parses configuration keys using either 'DOTNET_', 'ASPNETCORE_' or without any prefix. []
  -ed, --env-delimiter <env-delimiter>               The environment variable delimiter of ':', ASP.NET Core default is '__'. [default: __]
  -ker, --key-exclusion-regex <key-exclusion-regex>  Key Exclusion Regex Patten to exclude matched key from being generated in .properties file. []
  -t, --tokenize                                     Should generates the properties values as tokens? [default: False]
  -tp, --tokenize-prefix <tokenize-prefix>           Token prefix. [default: $(]
  -ts, --tokenize-suffix <tokenize-suffix>           Token suffix. [default: )]
  -?, -h, --help                                     Show help and usage information

EXAMPLES

konfigmap propsgen --config-dir "d:\configs" --config-dir "d:\another-configs" --output-dir "d:\iac\overlays\dev"
konfigmap propsgen -cd "app/configs" -cf "app/single-file.json" -od "app/iac/overlays/prod" -ker "regex-here-to-skip" -of "genreated-file-name.properties"

It can be used with kustomize configMapGenerator, here is some examples:

File: mywebapp-deployment.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: mywebapp-deployment
spec:
  selector:
    matchLabels:
      app: mywebapp
  replicas: 2
  template:
    metadata:
      labels:
        app: mywebapp
    spec:
      containers:
        - name: mywebapp
          image: nginx:latest
          ports:
            - containerPort: 80
          envFrom:
            - configMapRef:
                name: mywebapp-config

File: kustomization.yaml

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
  - mywebapp-deployment.yaml

commonLabels:
  app: mywebapp

configMapGenerator:
  - name: mywebapp-config
    env: env.properties

Note that env.properties is the generated file from konfigmap cli tool.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
1.0.10 241 12/3/2023
1.0.8 283 9/25/2023
1.0.7 214 9/19/2023
1.0.6 242 9/14/2023
1.0.5 188 9/11/2023