Skip to content

Commit

Permalink
fix: node selector turnaround
Browse files Browse the repository at this point in the history
  • Loading branch information
Filipe Forattini committed Jun 18, 2022
1 parent 00e7506 commit d96d4f8
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 7 deletions.
14 changes: 8 additions & 6 deletions deploy/as-k8s/dependencies.schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,19 @@ mysql:
#@schema/type any=True
extraEnvVars: []
primary:
affinity: {}
nodeSelector: {}
#@schema/type any=True
nodeSelector: []
#@schema/type any=True
extraEnvVars: []
persistence:
enabled: true
size: 2Gi
storageClass: ""
resources:
limits: {}
requests: {}
#@schema/type any=True
limits: []
#@schema/type any=True
requests: []

#! POSTGRES
postgres:
Expand All @@ -50,8 +52,8 @@ postgres:
#@schema/type any=True
extraEnvVars: []
primary:
affinity: {}
nodeSelector: {}
#@schema/type any=True
nodeSelector: []
#@schema/type any=True
extraEnvVars: []
persistence:
Expand Down
18 changes: 17 additions & 1 deletion deploy/as-k8s/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
#@ load("@ytt:base64", "base64")
#@ load("@ytt:sha256", "sha256")

#@ def ListToMap (listOfMaps):
#@ newMap = {}
#@ for i in range(len(listOfMaps)):
#@ newMap.update({ listOfMaps[i].name: listOfMaps[i].value })
#@ end
#@ return newMap
#@ end

---
#@ dependencies = []
#@ if data.values.mysql.enabled:
Expand Down Expand Up @@ -49,13 +57,21 @@ mysql:
username: #@ data.values.repository
database: #@ "/{}".format(data.values.repository)
secret: mysql-password

#@ mysqlValues = {}
#@ mysqlValues.update(data.values.mysql.values)
#@ mysqlValues.update({
#@ "auth": {
#@ "database": data.values.repository,
#@ "username": data.values.repository
#@ }
#@ },
#@ "primary": {
#@ "nodeSelector": ListToMap(data.values.mysql.values.primary.nodeSelector),
#@ "resources": {
#@ "limits": ListToMap(data.values.mysql.values.primary.resources.limits),
#@ "requests": ListToMap(data.values.mysql.values.primary.resources.requests),
#@ }
#@ }
#@ })
values: #@ mysqlValues

Expand Down
10 changes: 10 additions & 0 deletions test/concerns/dependencies-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,24 @@ mysql:
enabled: true
values:
primary:
nodeSelector:
- name: arch
value: amd64
persistence:
size: 2Gi
storageClass: longhorn
resources:
requests:
- name: cpu
value: 0.2

postgres:
enabled: true
values:
primary:
nodeSelector:
- name: arch
value: amd64
persistence:
size: 2Gi
storageClass: longhorn
Expand Down

0 comments on commit d96d4f8

Please sign in to comment.