-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add E2E for data-values-file reading a dir
- Loading branch information
Showing
9 changed files
with
87 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
This example demonstrates how ytt handles specifying a directory for Data Values | ||
inputs. (originally https://kubernetes.slack.com/archives/CH8KCCKA5/p1651167583289939) | ||
|
||
With this: | ||
``` | ||
├── config | ||
│ ├── config.yml | ||
│ └── values-schema.yml | ||
└── values <-- any YAML under here is assumed to be plain Data Values | ||
├── appdev-overrides <-- sorted by full pathname, alphabetically | ||
│ └── values.yaml | ||
└── operator-overrides | ||
├── 50-operations-overrides.yml | ||
├── 99-opssec-overrides.yml | ||
└── approvals.toml <-- non YAML files are ignored. | ||
``` | ||
|
||
Executing this: | ||
|
||
```console | ||
$ ytt -f examples/data-values-directory/config.yml \ | ||
--data-values-file examples/data-values-directory/values/ | ||
``` |
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,8 @@ | ||
#! In the real-world, this configuration would be the manifests that describe | ||
#! this application's deployment. For this example, we simply render the | ||
#! net values; this is the point of this example. | ||
|
||
#@ load("@ytt:data", "data") | ||
|
||
--- | ||
values: #@ data.values |
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,10 @@ | ||
#@data/values-schema | ||
--- | ||
name: suggestion-service | ||
instances: 0 | ||
accept_insecure_conns: true | ||
#@schema/nullable | ||
cache: | ||
driver: "" | ||
#@schema/type any=True | ||
config: {} |
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,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
./ytt -f examples/data-values-directory/config/ \ | ||
--data-values-file examples/data-values-directory/values/ |
8 changes: 8 additions & 0 deletions
8
examples/data-values-directory/values/appdev-overrides/values.yaml
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,8 @@ | ||
--- | ||
instances: 1 | ||
accept_insecure_conns: true | ||
cache: | ||
driver: in-memory | ||
config: | ||
maxEntries: 1024 | ||
strategy: MRU |
10 changes: 10 additions & 0 deletions
10
examples/data-values-directory/values/operator-overrides/50-operations-overrides.yml
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,10 @@ | ||
--- | ||
# 2022-05-13: avg + rms over last 3 months | ||
instances: 4 | ||
|
||
cache: | ||
driver: redis | ||
config: | ||
host: localhost:6379 | ||
tls-client-cert-file: client.crt | ||
tls-client-key-file: client.key |
3 changes: 3 additions & 0 deletions
3
examples/data-values-directory/values/operator-overrides/99-opssec-overrides.yml
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 @@ | ||
--- | ||
# Policy 1.31a: all north-south connections must be encrypted. | ||
accept_insecure_conns: false |
7 changes: 7 additions & 0 deletions
7
examples/data-values-directory/values/operator-overrides/approvals.toml
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,7 @@ | ||
[[approvals]] | ||
dept = "operations" | ||
user = "[email protected]" | ||
|
||
[[approvals]] | ||
dept = "Operations Security" | ||
user = "[email protected]" |
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