Skip to content
프로젝트

소개

Kubernetes Secret, ConfigMap, Go 템플릿을 사용해 애플리케이션 설정을 관리합니다.

시스템 및 인프라

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

konfd

Super Dope

Manage application configuration using Kubernetes secrets, configmaps, and Go templates.

Usage

Usage of konfd:
  -configmap value
    	the configmap to process.
  -namespace value
    	the namespace to process.
  -noop
    	print processed configmaps and secrets and do not submit them to the cluster.
  -onetime
    	run one time and exit.
  -sync-interval duration
    	the time duration between template processing. (default 1m0s)

Create configmaps and secrets

kubectl create secret generic vault-secrets \
  --from-literal 'mysql_password=v@ulTi$d0p3'
kubectl create configmap vault-configs \
  --from-literal 'default_lease_ttl=768h' \
  --from-literal 'mysql_username=vault'

Create a template configmap

cat configmaps/vault-template.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: vault-template
  annotations:
    konfd.io/kind: configmap
    konfd.io/name: vault
    konfd.io/key:  server.hcl
  labels:
    konfd.io/template: "true"
data:
  template: |
    default_lease_ttl = {{configmap "vault-configs" "default_lease_ttl"}}
    backend "mysql" {
      username = "{{configmap "vault-configs" "mysql_username"}}"
      password = "{{secret "vault-secrets" "mysql_password"}}"
      tls_ca_file = "/etc/tls/mysql-ca.pem"
    }

See the templates docs for more details.

Submit the vault-template configmap:

kubectl create -f configmaps/vault-template.yaml

Deploy the konfd replicaset

kubectl create -f replicasets/konfd.yaml

See the deployment guide for more details.

Review the results

kubectl get configmaps vault -o yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: vault
  namespace: default
data:
  server.hcl: |
    default_lease_ttl = 768h
    backend "mysql" {
      username = "vault"
      password = "v@ulTi$d0p3"
    }

Testing with noop mode

konfd can be run outside of the Kubernetes cluster by running kubectl in proxy mode:

kubectl proxy

Process a single template in the default namespace:

konfd -onetime -noop -namespace default -configmap vault-template

관련 프로젝트 살펴보기

불러오는 중…