Skip to content

Commit

Permalink
helm chart optimize (#2917)
Browse files Browse the repository at this point in the history
* save and cosv divide in gateway

* added cosv deployment templates for helm chart

* Update values.yaml

* modified agent service templates

* removed properties from configmaps to app native properties.

* removed s3 and mysql for dev deploy

* codehub logo for cosv front

* set all links for cosv to gitlink

* yaml files merged

* deleted gateway host port

* updated README

* fix storage.yml

* yaml files merged

* fixed values.yaml

* fix

* fix storage dict

* fixed default for proxy

* add optional proxy params

* fix

* fix

* properties moved from kube to main prop file

---------

Co-authored-by: Andrey Kuleshov <[email protected]>
  • Loading branch information
acies312 and orchestr7 authored Feb 1, 2024
1 parent 0e19690 commit be2e216
Show file tree
Hide file tree
Showing 59 changed files with 752 additions and 769 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
gateway.backend.url=http://backend
gateway.frontend.url=http://frontend
gateway.demo-cpg.url=http://demo-cpg
gateway.demo.url=http://demo
server.shutdown=graceful
management.endpoints.web.exposure.include=*
management.server.port=5301
logging.level.org.springframework=DEBUG
logging.level.com.saveourtool=DEBUG
12 changes: 6 additions & 6 deletions api-gateway/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ spring:
- id: api_route
uri: ${gateway.backend.url}
predicates:
- Host=**.${hosts.save}:5300
- Host=**.${hosts.save}
- Path=/api/**
filters:
# If SESSION cookie is passed to downstream, it is then removed, because downstream discards it
Expand All @@ -56,7 +56,7 @@ spring:
- id: cosv_api_route
uri: ${gateway.backend-cosv.url}
predicates:
- Host=**.${hosts.cosv}:5300
- Host=**.${hosts.cosv}
- Path=/api/**
filters:
# If SESSION cookie is passed to downstream, it is then removed, because downstream discards it
Expand All @@ -71,31 +71,31 @@ spring:
- id: resource_route
uri: ${gateway.frontend.url}
predicates:
- Host=**.${hosts.save}:5300
- Host=**.${hosts.save}
- Path=/*.html,/*.js*,/*.css,/img/**,/*.ico,/*.png
filters:
# If SESSION cookie is passed to downstream, it is then removed, because downstream discards it
- RemoveRequestHeader=Cookie
- id: index_route
uri: ${gateway.frontend.url}/index.html
predicates:
- Host=**.${hosts.save}:5300
- Host=**.${hosts.save}
- Path=/**
filters:
# If SESSION cookie is passed to downstream, it is then removed, because downstream discards it
- RemoveRequestHeader=Cookie
- id: resource_route_cosv
uri: ${gateway.frontend-cosv.url}
predicates:
- Host=**.${hosts.cosv}:5300
- Host=**.${hosts.cosv}
- Path=/*.html,/*.js*,/*.css,/img/**,/*.ico,/*.png
filters:
# If SESSION cookie is passed to downstream, it is then removed, because downstream discards it
- RemoveRequestHeader=Cookie
- id: index_route_cosv
uri: ${gateway.frontend-cosv.url}/index.html
predicates:
- Host=**.${hosts.cosv}:5300
- Host=**.${hosts.cosv}
- Path=/**
filters:
# If SESSION cookie is passed to downstream, it is then removed, because downstream discards it
Expand Down
11 changes: 11 additions & 0 deletions save-backend/src/main/resources/application-kubernetes.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
backend.preprocessor-url=http://preprocessor
backend.orchestrator-url=http://orchestrator
backend.demo-url=http://demo
backend.loki.url=http://loki:3100
backend.loki.labels.agent-container-name=pod
backend.loki.labels.application-name=app
backend.agent-settings.backend-url=http://save-backend
server.shutdown=graceful
management.endpoints.web.exposure.include=*
management.server.port=5801
spring.datasource.url=${spring.datasource.backend-url}
2 changes: 2 additions & 0 deletions save-backend/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ backend.s3-storage.prefix=cnb/files
backend.s3-storage.credentials.accessKeyId=${s3-storage.credentials.accessKeyId}
backend.s3-storage.credentials.secretAccessKey=${s3-storage.credentials.secretAccessKey}
backend.working-dir=/home/cnb/working-dir
logging.level.org.springframework=DEBUG
logging.level.com.saveourtool=DEBUG
7 changes: 1 addition & 6 deletions save-cloud-charts/save-cloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ It will also create a Service for an external MySQL database.
api-gateway acts as an entrypoint and svc/gateway is actually a LoadBalancer.

## Prerequisites
* **save-backend** expects the following secrets to be set under the secret `db-secrets` (`kubectl create secret generic db-secrets <...>`,
also see Secrets section in dev profile in [mysql-deployment.yaml](templates/mysql-deployment.yaml) as a reference):
* **save-backend** expects the following secrets to be set under the secret `db-secrets` (`kubectl create secret generic db-secrets <...>`
* `spring.datasource.username`
* `spring.datasource.password`
* `spring.datasource.backend-url`
Expand Down Expand Up @@ -73,7 +72,3 @@ command line using `--set` flag.
```bash
$ helm --kube-context=minikube --namespace=save-cloud upgrade -i save-cloud save-cloud-0.1.0.tgz/<or use ulr oci://ghcr.io/saveourtool/save-cloud> --values values-minikube.yaml --values=values-images.yaml <any other value files and/or --set flags>
```
* Database migrations can be run by setting value `mysql.migrations.enabled` to `true` (no additional setup, migrations
are executed by init container, but may be too slow with constant recreations of backend pods)
or port 3306 of mysql pod can be forwarded and `liquibaseUpdate` can be executed manually. If needed, don't forget that
JDBC URL for liquibase in dev profile is read from `application-dev.properties` value `dev.datasource.url`.
14 changes: 0 additions & 14 deletions save-cloud-charts/save-cloud/templates/agent-backend-service.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions save-cloud-charts/save-cloud/templates/agent-demo-service.yaml

This file was deleted.

8 changes: 0 additions & 8 deletions save-cloud-charts/save-cloud/templates/agent-namespace.yaml

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit be2e216

Please sign in to comment.