Skip to content

Commit

Permalink
initial values refactor (#1032)
Browse files Browse the repository at this point in the history
  • Loading branch information
DmyMi authored Apr 12, 2023
1 parent b4801d8 commit 38007a1
Show file tree
Hide file tree
Showing 8 changed files with 88 additions and 47 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -337,5 +337,4 @@ fabric.properties

**/.DS_Store
**/.idea
https
**/.vagrant
61 changes: 37 additions & 24 deletions OutOfSchool/OutOfSchool.WebApi/appsettings.Kubernetes.json
Original file line number Diff line number Diff line change
@@ -1,44 +1,43 @@
{
"AppDefaults": {
"City": "Київ"
},
"Serilog": {
"Using": ["Serilog.Sinks.Console", "Serilog.Exceptions"],
"Using": [ "Serilog.Sinks.Console", "Serilog.Exceptions" ],
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Information",
"System": "Warning"
"System": "Warning",
"Quartz": "Warning",
"Quartz.Core.QuartzSchedulerThread": "Warning",
"Quartz.Core.JobRunShell": "Warning"
}
},
"WriteTo": [
{
"Name": "Console"
"Name": "Console",
"Args": {
"formatter": "Serilog.Formatting.Elasticsearch.ElasticsearchJsonFormatter, Serilog.Formatting.Elasticsearch"
}
}
]
},
"Identity": {
"Authority": "http://localhost/identity"
},
"Swagger": {
"IdentityAccess": {
"BaseUrl": "http://localhost/identity"
"BaseUrl": "https://auth.oos.dmytrominochkin.cloud"
}
},

"AllowedHosts": "*",

"AllowedCorsOrigins": "http://localhost",

"FeatureManagement": {
"Release1": true,
"Release2": false,
"Release3": false
"Identity": {
"Authority": "https://auth.oos.dmytrominochkin.cloud"
},

"ApplicationsConstraints": {
"ApplicationsLimit": 2,
"ApplicationsLimitDays": 7
"ConnectionStringsOverride": {
"DefaultConnection": {
"UseOverride": true,
"Server": "mysql",
"Port": 3306,
"Database": "outofschool",
"UserId": "api",
"Password": "",
"GuidFormat": "Binary16"
}
},
"Elasticsearch": {
"EnsureIndex": true,
Expand All @@ -48,10 +47,24 @@
"http://elasticsearch-master:9200/"
],
"User": "webapi",
"Password": "",
"PingIntervalSeconds": 30,
"SynchronizationScheduler": {
"OperationsPerTask": 10,
"DelayBetweenTasksInMilliseconds": 60000
}
},
"Redis": {
"Enabled": true,
"Server": "mysql-redis-master"
},
"Quartz": {
"CronSchedules": {
"GcpImagesSyncCronScheduleString": "0 0 11 * * ?",
"StatisticReportsMakingCronScheduleString": "0 0 * ? * *",
"ApplicationStatusChangingCronScheduleString": "0 0 * ? * *",
"NotificationsClearingCronScheduleString": "0 0 * ? * *",
"AverageRatingCalculatingCronScheduleString": "0 0 * ? * *"
}
}
}
}
16 changes: 8 additions & 8 deletions k8s/outofschool/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
dependencies:
- name: dotnetapp
repository: file://../dotnetapp
- name: webapp
repository: file://../webapp
version: 0.1.0
- name: dotnetapp
repository: file://../dotnetapp
- name: webapp
repository: file://../webapp
version: 0.1.0
- name: dotnetapp
repository: file://../dotnetapp
- name: webapp
repository: file://../webapp
version: 0.1.0
digest: sha256:e68d2e0ad76e04e62b9052055fcae05b889156af51cc730ef5322ab71ccf73d1
generated: "2022-06-09T12:31:32.644893+03:00"
digest: sha256:d379fea11d030b2540f33bfc17dd089940d531381ffc887c2d0f67d863062685
generated: "2023-03-26T19:30:59.530932+03:00"
2 changes: 1 addition & 1 deletion k8s/outofschool/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
version: 0.2.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
Binary file added k8s/outofschool/charts/webapp-0.1.0.tgz
Binary file not shown.
47 changes: 36 additions & 11 deletions k8s/outofschool/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

global:
extraEnvironment:
ASPNETCORE_ENVIRONMENT: Release

global: {}

# TODO: Configure global pull secrets
imagePullSecrets: []
Expand All @@ -32,14 +29,42 @@ webapi:
image:
repository: gcr.io/gcp101292-pozashkillya/oos-api
pullPolicy: IfNotPresent
tag: 1.0.0-RC1
extraEnvironment: {}
# ReverseProxy__BasePath: /webapi
connectionString:
username: webapi
secret:
tag: testing
containerPort: 8080
configuration:
extraEnvironment:
# ReverseProxy__BasePath: /webapi
ASPNETCORE_ENVIRONMENT: Kubernetes
AppDefaults__Version: testing
secrets:
- type: env
name: mysql-api-auth
key: API_PASSWORD
keys:
- key: API_PASSWORD
envKey: ConnectionStringsOverride__DefaultConnection__Password
upper: false
- type: env
name: elasticsearch-credentials
keys:
- key: apipass
envKey: Elasticsearch__Password
upper: false
- type: env
name: redis-auth
keys:
- key: password
envKey: Redis__Password
upper: false
# TODO: add geo api key to secrets
# - type: env
# name: mysql-api-auth
# keys:
# - key: API_PASSWORD
# envKey: GeoCoding__ApiKey
# upper: false
resources:
limits:
memory: 512Mi
identity:
enabled: false
image:
Expand Down
6 changes: 4 additions & 2 deletions k8s/webapp/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ spec:
{{- if eq $secret.type "env" }}
{{- range $key := $secret.keys }}
{{- $envPrefix := $secret.prefix | default "" | upper }}
{{- $envKey := (index $key "envKey") | default (index $key "key") | upper | replace "." "_" | replace "-" "_" }}
- name: {{ $envPrefix }}{{ $envKey }}
{{- $envKey := (index $key "envKey") | default (index $key "key") | replace "." "_" | replace "-" "_" }}
{{/* TODO: can't belive helm has not fixed booleans in 5 years ;) */}}
{{- $uppedKey := ternary (upper $envKey) $envKey (list nil true "true" | has (index $key "upper")) }}
- name: {{ $envPrefix }}{{ $uppedKey }}
valueFrom:
secretKeyRef:
name: {{ $secret.name }}
Expand Down
2 changes: 2 additions & 0 deletions k8s/webapp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ configuration:
## - key: x.y.z # my-secret.x.y.z => MY_X_Y_Z
## - key: old-val
## envKey: new-val # my-secret.old-val => MY_NEW_VAL
## - key: x.y.z
## upper: false # my-secret.x.y.z => MY_x_y_z
secrets: []

image:
Expand Down

0 comments on commit 38007a1

Please sign in to comment.