-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
nxcc
committed
Sep 2, 2024
1 parent
5f0fff9
commit a521a9f
Showing
10 changed files
with
94 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module: "cue.example" | ||
language: { | ||
version: "v0.10.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package main | ||
|
||
cuegen: apiVersion: "v1alpha4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
@extern(embed) | ||
|
||
package main | ||
|
||
objects: [ | ||
{ | ||
Kind: "ConfigMap" | ||
spec: {} @embed(file=values.json) | ||
}, | ||
{ | ||
Kind: "Secret" | ||
spec: {} @embed(file=secrets.json) | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
## Embed Experiment | ||
|
||
By setting `apiVersion` to `v1alpha4` in `cuegen.cue` the experiment is enabled. | ||
`Cuegen` will decrypt all sops files, so values from `secrets.sops.yaml` will be | ||
used. | ||
|
||
Running `CUEGEN_SKIP_DECRYPT=true cuegen` will use values from `secrets.yaml`. | ||
You could get the same result with | ||
|
||
cue export -e objects --out yaml | yq '.[] | split_doc' | ||
|
||
which might be useful for (cue) debugging purposes. | ||
|
||
|
||
To run this example you need to set | ||
|
||
SOPS_AGE_KEY=AGE-SECRET-KEY-14QUHLE5A6UNSKNYXLF5ZA26P3NCFX8P68JQ066T7VJ6JW5G8FHWQN4HAUQ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"USERNAME": "example-user", | ||
"PASSWORD": "example-pass-123" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"USERNAME": "ENC[AES256_GCM,data:50bGUSewU6hm,iv:GLJosnkWg17+rfs+pRs/61UpKkkCUBdcdjJvaNBKYPw=,tag:Ru9+KvJ040B13pq5ccoyfg==,type:str]", | ||
"PASSWORD": "ENC[AES256_GCM,data:LOUgGddQg5axEQ8=,iv:nHdyZXtlU+Nn5XpVtr/N6/m2BFMYmLbl2qeGt+kJE4I=,tag:WZwyYN92q0vtDON3geNHhA==,type:str]", | ||
"sops": { | ||
"kms": null, | ||
"gcp_kms": null, | ||
"azure_kv": null, | ||
"hc_vault": null, | ||
"age": [ | ||
{ | ||
"recipient": "age13643rcqprsmy33ff4rgj2strpyhxgzu3x6lvyrzvhsqqjvmk9d3qe59qn8", | ||
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBVYUtXc1E0ZTloeG9scnBK\nTThZdnZYcENJelN5TjJYWTYxOWlsREEyU0Q4Ck5ZM3FnN08ycDcxdmhJQkp3TTV4\neGhOeFR1SzFMbWc4OFlHOGtnT25hbWsKLS0tIEIzS1NibGQzVDNvMXA4MlZ0TGdC\nenFGbzdXeC9tV2VIdGdIaWlMMnRjNUEKv+ZnieZSNuwfAaZratHR0mRx30HA/TLZ\nCGYDZLO7EXcV+XDVUtG0KoZB/28Olnxr0tz7cL8RonHeQadUy8zjtA==\n-----END AGE ENCRYPTED FILE-----\n" | ||
} | ||
], | ||
"lastmodified": "2024-09-02T09:08:54Z", | ||
"mac": "ENC[AES256_GCM,data:njrsy9sYsYTGq34Qk7lcRoE+SawGFGyy9OzQHDURSZkUVmYYIwAZPfR0SerXnLaolsVoePVQqtFWcHiV/UYBeFB21I5qM3fyCjv6lD4fow2cHieOx6b8LvL+Z/gUcBAmMN1WBxZK01oYuH8n2tz2VaMWiR0qsN0QIT7mWGvapkQ=,iv:2z+5d/Ga/9vwGLmBw0DXnA3+mWEnyPfjRFdwX5UYK3Q=,tag:Vi/bEgRg2xpIGafWBrqFXw==,type:str]", | ||
"pgp": null, | ||
"unencrypted_suffix": "_unencrypted", | ||
"version": "3.7.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"DB_HOST": "mydbhost", | ||
"DB_PORT": "5432" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters