whatisgithub

What is konfig?

kelseyhightower/konfig — explained in plain English

Analysis updated 2026-07-17 · repo last pushed 2024-02-29

116GoAudience · ops devopsComplexity · 4/5DormantSetup · hard

In one sentence

Konfig lets serverless apps on Google Cloud Run and Cloud Functions pull config values and secrets from a Kubernetes cluster at runtime, so teams store them once and reuse them everywhere.

Mindmap

mindmap
  root((konfig))
    What it does
      Pulls config at runtime
      Reads Kubernetes secrets
      Reads configmaps
      Writes temp files
    Tech stack
      Go
      Kubernetes
      Cloud Run
      Cloud Functions
    Use cases
      Central secret store
      Share config across services
      Avoid duplicate API keys
    Audience
      DevOps teams
      GKE users

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Centralize secrets and config in a Kubernetes cluster and reference them from Cloud Run or Cloud Functions services.

USE CASE 2

Share the same database password between a GKE-hosted service and a serverless function without copying it around.

USE CASE 3

Store a JSON credentials file as a Kubernetes secret and have konfig write it to a temp file your app can read.

What is it built with?

GoKubernetesCloud RunCloud FunctionsGKE

How does it compare?

kelseyhightower/konfigadguardteam/urlfilterkelseyhightower/kargo
Stars116113123
LanguageGoGoGo
Last pushed2024-02-292026-06-252017-07-13
MaintenanceDormantActiveDormant
Setup difficultyhardhard
Complexity4/53/5
Audienceops devopsdevelopergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

Requires a running Kubernetes (GKE) cluster reachable from Cloud Run/Functions.

So what is it?

Konfig lets applications running on Google Cloud's serverless platforms, Cloud Run and Cloud Functions, pull configuration values and secrets from a Kubernetes cluster at runtime. Instead of duplicating config files or API keys across multiple services, you store them once in a Kubernetes cluster and reference them from your serverless workloads, which then automatically receive the actual values when they start up. The way it works is straightforward. You add a single import line to your application code, and behind the scenes the library intercepts the environment variables that were set when your service was deployed. When it sees a special reference string pointing to a Kubernetes configmap or secret, it reaches out to the cluster, fetches the actual value, and swaps it in. For file-based configs like a JSON database connection file, it can even write the contents to a temporary file and give your app the file path instead of the raw content. This is useful for teams already using Google Kubernetes Engine (GKE) who want a central place to manage secrets and configuration across both containerized and serverless workloads. For example, if you have a database password stored as a Kubernetes secret, both a traditional service running in GKE and a Cloud Run function can reference the same source of truth without you having to manage separate secret stores or copy values around. One notable design choice is that konfig reads environment variable definitions from the Cloud Run or Cloud Functions API rather than scanning the runtime environment directly. This avoids a common pitfall where other libraries might set or modify environment variables before konfig runs, which could cause confusion. It also means the GKE cluster is used purely as a storage layer, the tutorial even shows you can delete the cluster's compute nodes after setup, since only the Kubernetes API server is needed to serve config and secret lookups.

Copy-paste prompts

Prompt 1
Show me how to add konfig to a Go Cloud Run service so it pulls a database password from a Kubernetes secret at startup.
Prompt 2
Write a Kubernetes secret and configmap example that konfig can reference from a Cloud Function's environment variables.
Prompt 3
Explain how konfig intercepts environment variables from the Cloud Run API instead of scanning the runtime environment.
Prompt 4
Help me set up konfig so I can delete my GKE cluster's compute nodes after config setup, keeping only the API server.

Frequently asked questions

What is konfig?

Konfig lets serverless apps on Google Cloud Run and Cloud Functions pull config values and secrets from a Kubernetes cluster at runtime, so teams store them once and reuse them everywhere.

What language is konfig written in?

Mainly Go. The stack also includes Go, Kubernetes, Cloud Run.

Is konfig actively maintained?

Dormant — no commits in 2+ years (last push 2024-02-29).

How hard is konfig to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is konfig for?

Mainly ops devops.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.