@@ -9,7 +9,7 @@ Managing configurations and secrets across multiple Kubernetes deployments is a
99Key challenges include:
1010- Ensuring configurations remain consistent across different environments (e.g., dev, staging, production).
1111- Managing sensitive values securely using external secret management systems.
12- - Automating the generation of ` values.yaml ` while integrating with GitOps tools like ArgoCD.
12+ - Automating the generation of ` values.json ` while integrating with GitOps tools like ArgoCD.
1313- Providing a user-friendly CLI that integrates well with Helm workflows.
1414
1515## Decision
@@ -22,110 +22,145 @@ We have decided to implement the **Helm Values Manager** as a **Helm plugin writ
22224 . ** Secret Storage Abstraction:** Securely manages sensitive values by integrating with AWS Secrets Manager, Azure Key Vault, and HashiCorp Vault.
23235 . ** CLI-Based Approach:** Interactive commands for managing configurations and secrets.
24246 . ** Autocomplete Support:** Smooth CLI experience.
25- 7 . ** ArgoCD Compatibility:** Generates ` values.yaml ` dynamically for GitOps workflows.
25+ 7 . ** ArgoCD Compatibility:** Generates ` values.json ` dynamically for GitOps workflows.
26+ 8 . ** JSON for Configuration:** Using JSON for configuration files provides better schema validation and consistent parsing across different platforms.
2627
27- ## YAML Structure
28+ ## Configuration Structure
2829
2930The configuration follows this structure:
3031
31- ``` yaml
32- version : " 1.0" # Schema version
33- release : my-release
34-
35- deployments :
36- dev :
37- secrets_backend : aws_secrets_manager
38- secrets_config :
39- region : us-west-2
40- secret_prefix : " /dev/myapp/"
41- auth :
42- type : env # Use AWS environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
43- # Alternative: type: file, path: "~/.aws/credentials"
44- # Alternative: type: direct
45- # access_key_id: "AKIA..."
46- # secret_access_key: "xyz..."
47-
48- staging :
49- secrets_backend : google_secret_manager
50- secrets_config :
51- project_id : " my-gcp-project"
52- secret_prefix : " myapp-staging-"
53- auth :
54- type : file
55- path : " /path/to/gcp-service-account.json"
56- # Alternative: type: env, credential_env: "GOOGLE_APPLICATION_CREDENTIALS"
57- # Alternative: type: direct
58- # credentials_json: "{...}"
59-
60- prod :
61- secrets_backend : azure_key_vault
62- secrets_config :
63- vault_url : " https://my-prod-vault.vault.azure.net"
64- auth :
65- type : managed_identity # Use Azure Managed Identity
66- # Alternative: type: service_principal
67- # tenant_id: "${AZURE_TENANT_ID}"
68- # client_id: "${AZURE_CLIENT_ID}"
69- # client_secret: "${AZURE_CLIENT_SECRET}"
70-
71- local :
72- secrets_backend : git_secret
73- secrets_config :
74- gpg_key : " ${GPG_KEY}" # GPG key for decryption
75- secret_files_path : " ./.gitsecret" # Path to git-secret files
76- auth :
77- type : file
78- path : " ~/.gnupg/secring.gpg"
79- # Alternative: type: env
80- # passphrase_env: "GIT_SECRET_PASSPHRASE"
81- # Alternative: type: direct
82- # passphrase: "your-passphrase"
83-
84- config :
85- - key : DATABASE_URL
86- path : global.database.url
87- description : " Database connection string for the application"
88- required : true
89- sensitive : true
90- values :
91- dev : " mydb://dev-connection"
92- staging : " mydb://staging-connection"
93- prod : " mydb://prod-connection"
94- local : " mydb://localhost"
95-
96- - key : LOG_LEVEL
97- path : global.logging.level
98- description : " Application logging verbosity level"
99- required : false
100- sensitive : false
101- values :
102- dev : " debug"
103- staging : " info"
104- prod : " warn"
105- local : " debug"
32+ ``` json
33+ {
34+ "version" : " 1.0" ,
35+ "release" : " my-release" ,
36+ "deployments" : {
37+ "dev" : {
38+ "secrets_backend" : " aws_secrets_manager" ,
39+ "secrets_config" : {
40+ "region" : " us-west-2" ,
41+ "secret_prefix" : " /dev/myapp/" ,
42+ "auth" : {
43+ "type" : " env"
44+ }
45+ }
46+ },
47+ "staging" : {
48+ "secrets_backend" : " google_secret_manager" ,
49+ "secrets_config" : {
50+ "project_id" : " my-gcp-project" ,
51+ "secret_prefix" : " myapp-staging-" ,
52+ "auth" : {
53+ "type" : " file" ,
54+ "path" : " /path/to/gcp-service-account.json"
55+ }
56+ }
57+ },
58+ "prod" : {
59+ "secrets_backend" : " azure_key_vault" ,
60+ "secrets_config" : {
61+ "vault_url" : " https://my-prod-vault.vault.azure.net" ,
62+ "auth" : {
63+ "type" : " managed_identity"
64+ }
65+ }
66+ },
67+ "local" : {
68+ "secrets_backend" : " git_secret" ,
69+ "secrets_config" : {
70+ "gpg_key" : " ${GPG_KEY}" ,
71+ "secret_files_path" : " ./.gitsecret" ,
72+ "auth" : {
73+ "type" : " file" ,
74+ "path" : " ~/.gnupg/secring.gpg"
75+ }
76+ }
77+ }
78+ },
79+ "config" : [
80+ {
81+ "path" : " global.database.url" ,
82+ "description" : " Database connection string for the application" ,
83+ "required" : true ,
84+ "sensitive" : true ,
85+ "values" : {
86+ "dev" : " mydb://dev-connection" ,
87+ "staging" : " mydb://staging-connection" ,
88+ "prod" : " mydb://prod-connection" ,
89+ "local" : " mydb://localhost"
90+ }
91+ },
92+ {
93+ "path" : " global.logging.level" ,
94+ "description" : " Application logging verbosity level" ,
95+ "required" : false ,
96+ "sensitive" : false ,
97+ "values" : {
98+ "dev" : " DEBUG" ,
99+ "staging" : " INFO" ,
100+ "prod" : " WARN" ,
101+ "local" : " DEBUG"
102+ }
103+ }
104+ ]
105+ }
106106```
107107
108- ### Secret Backend Configuration
109-
110- The configuration supports multiple secret backend types with flexible authentication methods:
111-
112- 1. **Authentication Methods**:
113- - ` env`: Use environment variables
114- - `file` : Use credential files
115- - `direct` : Direct credential specification (not recommended for production)
116- - `managed_identity` : For cloud-native authentication (Azure)
117-
118- 2. **Supported Secret Backends** :
119- - AWS Secrets Manager
120- - Google Secret Manager
121- - Azure Key Vault
122- - git-secret (for local development)
123-
124- 3. **Authentication Patterns** :
125- - Environment variables for cloud credentials
126- - Credential files for service accounts
127- - Direct credentials (development only)
128- - Managed identities for cloud services
108+ Alternative authentication configurations:
109+ - AWS:
110+ ``` json
111+ {
112+ "type" : " file" ,
113+ "path" : " ~/.aws/credentials"
114+ }
115+ ```
116+ or
117+ ``` json
118+ {
119+ "type" : " direct" ,
120+ "access_key_id" : " AKIA..." ,
121+ "secret_access_key" : " xyz..."
122+ }
123+ ```
124+
125+ - Google Cloud:
126+ ``` json
127+ {
128+ "type" : " env" ,
129+ "credential_env" : " GOOGLE_APPLICATION_CREDENTIALS"
130+ }
131+ ```
132+ or
133+ ``` json
134+ {
135+ "type" : " direct" ,
136+ "credentials_json" : " {...}"
137+ }
138+ ```
139+
140+ - Azure:
141+ ``` json
142+ {
143+ "type" : " service_principal" ,
144+ "tenant_id" : " ${AZURE_TENANT_ID}" ,
145+ "client_id" : " ${AZURE_CLIENT_ID}" ,
146+ "client_secret" : " ${AZURE_CLIENT_SECRET}"
147+ }
148+ ```
149+
150+ - Git Secret:
151+ ``` json
152+ {
153+ "type" : " env" ,
154+ "passphrase_env" : " GIT_SECRET_PASSPHRASE"
155+ }
156+ ```
157+ or
158+ ``` json
159+ {
160+ "type" : " direct" ,
161+ "passphrase" : " your-passphrase"
162+ }
163+ ```
129164
130165## Consequences
131166- The project will be built as a Helm plugin with Python as the core language.
0 commit comments