Skip to content

Commit fa78b93

Browse files
author
xavier
committed
some variables.yaml stuff
1 parent 9784e3c commit fa78b93

13 files changed

+605
-131
lines changed

platform-kama/Pipfile.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
kind: MultiPredicate
2+
id: predicate.ingress_enabled_resource_in_sync
3+
title: Ingress enabled variable/resource in Sync?
4+
reason: "The variable 'ingress.enabled' and the Kubernetes resource
5+
are out of sync: the variable is set to 'false' but the resource
6+
exists. This is a normal occurrence when you change the 'ingress.enabled'
7+
variable directly instead of running the operation."
8+
operator: and
9+
negate: true
10+
source:
11+
- kind: Predicate
12+
challenge: get::kind::ConfigVarsSupplier->.ingress.enabled
13+
operator: falsy
14+
- kind: ResourceCountPredicate
15+
res_kind: Ingress
16+
operator: greater-than
17+
check_against: 0
18+
19+
---
20+
21+
kind: RemediationOption
22+
title: Delete the dangling Ingress resource
23+
info: "If the intention is to keep ingress disabled, the dangling
24+
resource should be deleted. Clicking this button will"
25+
button:
26+
text: Delete Ingress
27+
uri:
28+
kind: DeleteResourcesAction
29+
selector: "expr::Ingress:*"
30+
match_predicates:
31+
id: predicate.ingress_enabled_resource_in_sync
32+
33+
---
34+
35+
kind: Remediation
36+
title: "Change the variable to 'true'"
37+
info: "If the intention is actually to have ingress enabled, the variable
38+
should be updated to 'true'."
39+
button:
40+
text: Delete Ingress
41+
uri:
42+
kind: Action
43+
inherit: sdk.action.safely_apply_application_manifest_e2e_action
44+
values:
45+
ingress.enabled: true
46+
match_predicates:
47+
id: predicate.ingress_enabled_resource_in_sync
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
kind: ResourceCountPredicate
2+
id: predicate.db-creds-exists
3+
title: Database credentials secret exists
4+
reason: Secret db-creds not present in namespace '${get::ns}'
5+
res_kind: Secret
6+
name: db-creds
7+
8+
---
9+
10+
kind: ResourceCountPredicate
11+
id: predicate.auth0-creds-exists
12+
title: Auth0 credentials secret exists
13+
reason: Secret auth0 not present in namespace '${get::ns}'
14+
res_kind: Secret
15+
name: auth0
16+
17+
---
18+
19+
kind: Supplier
20+
id: goo
21+
inhert: template
22+
secret_name: gcp-svc-acct-keyfile
23+
output: ".gcp_svc_acct_keyfile"
24+
25+
---
26+
27+
kind: Supplier
28+
id: template
29+
secret_name: ''
30+
cached:
31+
res:
32+
kind: ResourcesSupplier
33+
selector:
34+
res_kind: Secret
35+
name: get::self>>secret_name
36+
many: false
37+
serializer: legacy
38+
source: get::self>>res=>decoded_data
39+
40+
---
41+
#
42+
#kind: Predicate
43+
#res:
44+
# kind: ResourcesSupplier
45+
# selector:
46+
# res_kind: Secret
47+
# name: db-creds
48+
# many: false
49+
#challenge: get::self>>res=>data->.db_user=>__count__
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#kind: ManifestVariableDependency
2+
#id: variable_relations.hpa_disabled_prevents_min
3+
#effect: prevents_read
4+
#title: "HPA configuration will be ignored if it is disabled"
5+
#active:
6+
# kind: Predicate
7+
# challenge: get::self>>from_variable>>current_value
8+
# operator: falsiness
9+
#
10+
#---
11+
#
12+
#kind: ManifestVariableDependencySelector
13+
#inherit: variable_dependency.template.hpa_disabled
14+
#from:
15+
# id: backend.server.hpa.enabled
16+
#to:
17+
# id: "backend.server.hpa.-*"
18+
#
19+
#---
20+
#
21+
#kind: ManifestVariableDependency
22+
#inherit: variable_dependency.template.ingress_disabled
23+
#labels:
24+
# from_variable: ingress.enabled
25+
# to_variable: ingress.class
26+
#
27+
#---
28+
#
29+
#kind: ManifestVariableDependency
30+
#inherit: variable_dependency.template.ingress_disabled
31+
#variable_selectors:
32+
# from_variable: ingress.enabled
33+
# to_variable: ingress.routes.-.*
34+
#
35+
#---
36+
#
37+
#kind: ManifestVariableDependency
38+
#inherit: variable_dependency.template.ingress_disabled
39+
#labels:
40+
# from_variable: ingress.enabled
41+
# to_variable: ingress.routes.backend
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
kind: VariableCategory
2+
id: variable-category.networking
3+
title: Networking
4+
info: HTTP, HTTPS, DNS, SSH settings
5+
graphic: language
6+
7+
---
8+
9+
kind: VariableCategory
10+
id: variable-category.compute
11+
title: Workloads
12+
info: All things performance and functionality
13+
graphic: build
14+
15+
---
16+
17+
kind: VariableCategory
18+
id: variable-category.security
19+
title: Security
20+
info: Network policies, RBAC and admin access
21+
graphic: security
22+
23+
---
24+
25+
kind: VariableCategory
26+
id: variable-category.storage
27+
title: Storage
28+
info: PVCs, StorageClass, and backups
29+
graphic: save
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
################## TEMPLATES ###################
2+
3+
kind: ManifestVariable
4+
id: variable.template.ingress_route_host
5+
casual_name: ""
6+
title: ${get::self>>casual_name} Ingress Host
7+
info: "Routes requests from this domain to the ${get::self>>casual_name}. Has
8+
no effect if ingress.enabled is false/null Has no effect if
9+
cluster does not have an ingress backend."
10+
category: id::variable-category.networking
11+
validators:
12+
- kind: FormatPredicate
13+
check_against: domain
14+
15+
---
16+
17+
kind: ManifestVariable
18+
id: variable.template.ingress_route_path
19+
category: id::variable-category.networking
20+
casual_name: ""
21+
title: ${get::self>>casual_name} Ingress Host
22+
info: "Custom path prefix path for ${get::self>>casual_name}. It
23+
is not recommended to set a value other than '/' as it may create bugs."
24+
owner: publisher
25+
validators:
26+
- kind: FormatPredicate
27+
check_against: path
28+
29+
30+
################## ACTUAL ###################
31+
32+
33+
---
34+
35+
kind: ManifestVariable
36+
id: ingress.enabled
37+
category: id::variable-category.networking
38+
title: Application Ingress Toggle
39+
info: "If enabled, Ingress resource is provisioned to route out-of-cluster
40+
traffic to the application's various services. Note that you must have
41+
a DNS solution"
42+
input:
43+
kind: OnOffInput
44+
correctness_predicates:
45+
- id::predicate.ingress_enabled_resource_in_sync
46+
47+
---
48+
49+
kind: ManifestVariable
50+
id: ingress.routes.publisher_frontend.host
51+
inherit: variable.template.ingress_route_host
52+
casual_name: Publisher Dashboard
53+
correctness_predicates:
54+
- kind::FalsePredicate
55+
56+
---
57+
58+
kind: ManifestVariable
59+
id: ingress.routes.backend.path
60+
inherit: variable.template.ingress_route_path
61+
casual_name: Backend
62+
63+
---
64+
65+
kind: ManifestVariable
66+
id: ingress.routes.publisher_frontend.path
67+
inherit: variable.template.ingress_route_path
68+
casual_name: Publisher Dashboard
69+
70+
---
71+
72+
kind: ManifestVariable
73+
id: ingress.routes.backend.host
74+
inherit: variable.template.ingress_route_host
75+
casual_name: Backend
76+
77+
78+
79+
################## DEPENDENCIES ###################
80+
81+
82+
---
83+
84+
kind: ManifestVariableDependency
85+
id: variable-dependency.when-ingress-is-disabled
86+
title: Value ignored when ingress.enabled is false
87+
from: [id::ingress.enabled]
88+
to:
89+
id: [ingress.class, ingress.routes.*]
90+
active:
91+
kind: Predicate
92+
challenge: get::self>>from_variable>>current_value
93+
operator: falsy
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#kind: ManifestVariableDependency
2+
#id: variable_dependency.template.hpa_disabled
3+
#effect: prevents_read
4+
#info: HPA-specific configurations ignored if HPA is disabled
5+
#active:
6+
# kind: Predicate
7+
# challenge: get::self>>from_variable>>current_value
8+
# operator: true
9+
#
10+
#---
11+
#
12+
#kind: ManifestVariableDependency
13+
#id: variable_dependency.template.ingress_disabled
14+
#effect: prevents_read
15+
#info: Ingress-specific configurations ignored if Ingress is disabled
16+
##info: Something about ingress yo
17+
#active:
18+
# kind: Predicate
19+
# challenge: get::self>>from_variable>>current_value
20+
# operator: falsiness
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
kind: ConfigurationPreset
2+
id: provider.presets.default
3+
title: Absolute Default
4+
info: Bare minimum defaults set by the publisher.
5+
default: true
6+
variables:
7+
kind: ConfigSupplier
8+
field_key: default_vars
9+
10+
---
11+
12+
kind: ConfigurationPreset
13+
id: provider.presets.high-limits
14+
title: Starter pack
15+
info: Insecure database, no authentication provider.
16+
variables:
17+
kind: PresetAssignmentsSupplier
18+
source: unsafe-database

0 commit comments

Comments
 (0)