Skip to content

Commit

Permalink
fix: helm deployment (#81)
Browse files Browse the repository at this point in the history
* fix: helm deployment with the follwing changes:

- feat: added new application.properties to deployment.yaml,values.yaml and their README's           - feat: splitted NOTES text to 'local' and 'internet' after deployment  with ingress enabled
- feat: added edc.controlplane.data.path to values.yaml's and to deployment.yaml

* refactor: harmonised the appliciation.properties,changed pullPolicy in values,fixed backendBaseUrl

* feat: updated ingress config in helm for argo cd deployment

* chore: updated Security.md files according to eclipse-tractus TRG-7-01

* feat: updated Install.md and values in charts/puris/values.yaml

* feat: updated .Values and includes in templates due to incoming refactor of templates

* feat: added frontend/backend templates to root chart and made it deployable

Signed-off-by: Pascal Marzec <[email protected]>

* feat: connected frontend, backend and edc

Signed-off-by: Pascal Marzec <[email protected]>

* fix: missed semicolon in VariablesService

* fix: fixed typo and added forgotten liveness and readiness probe in backend-deployment.yaml

Signed-off-by: Pascal Marzec <[email protected]>

* fix: fixed typo and changed edc-controlplane-management/protocol port to 8181/8184

Signed-off-by: Pascal Marzec <[email protected]>

---------

Signed-off-by: Pascal Marzec <[email protected]>
  • Loading branch information
PaMarzec authored Dec 12, 2023
1 parent 6176cef commit 7eeb128
Show file tree
Hide file tree
Showing 31 changed files with 826 additions and 173 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ indent_size = 4
indent_style = space
insert_final_newline = true

[*.yml]
[*.yaml]
indent_size = 2
21 changes: 16 additions & 5 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
## Project Installation
### Running using mvn (local develpment) or Running using docker (deployment)
### Running for development using mvn/npm or using docker
See the `INSTALL.md` files in the [backend](./backend/INSTALL.md) and [frontend](./frontend/INSTALL.md) folder.
### Running local integration testing user docker compose
See `Install.md` file in folder [local](./local/docker-compose.yaml) for integration testing environment with two deployed applications and EDCs.
### Running using helm (deployment)
1. Run the application:
1. Configure the application:
1. Open the `values.yaml` file in [charts/puris](./charts/puris/values.yaml).
2. Edit the following properties to your requirements:
- **Ingress**(if you want to enable ingress) for frontend/backend, under *frontend.ingress.* and *backend.ingress.*
- **EDC**, under *backend.puris.edc*
- **Own data**, under *backend.puris.own*
- **Current role for demonstrator**, under *backend.puris.demonstrator.role*
> **NOTE**
Further information on the individual properties can be found in the following [README.md](./charts/puris/README.md).
2. Run the application
```shell
cd charts/puris/

helm install puris --namespace puris --create-namespace . --set frontend.ingress.enabled=true --set backend.ingress.enabled=true
helm install puris charts/puris \
--namespace puris \
--create-namespace
```
2. Done! The applications should be available at
- (frontend) `http://YOURIP:30000`
Expand Down
17 changes: 14 additions & 3 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# Security Policy

## Reporting a Vulnerability
Please do **not** report security vulnerabilities through public GitHub issues.

Please report vulnerabilities to this repository via **GitHub security advisories** instead.

How? Inside affected repository --> security tab

for contributor:
--> Report a vulnerability

for committer:
--> advisories --> New draft security advisory

In severe cases, you can also report a found vulnerability via mail or eclipse issue here: https://www.eclipse.org/security/

Please report a found vulnerability here:
[https://www.eclipse.org/security/](https://www.eclipse.org/security/)
See [Eclipse Foundation Vulnerability Reporting Policy](https://www.eclipse.org/projects/handbook/#vulnerability)
17 changes: 14 additions & 3 deletions backend/SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# Security Policy

## Reporting a Vulnerability
Please do **not** report security vulnerabilities through public GitHub issues.

Please report vulnerabilities to this repository via **GitHub security advisories** instead.

How? Inside affected repository --> security tab

for contributor:
--> Report a vulnerability

for committer:
--> advisories --> New draft security advisory

In severe cases, you can also report a found vulnerability via mail or eclipse issue here: https://www.eclipse.org/security/

Please report a found vulnerability here:
[https://www.eclipse.org/security/](https://www.eclipse.org/security/)
See [Eclipse Foundation Vulnerability Reporting Policy](https://www.eclipse.org/projects/handbook/#vulnerability)
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ public class VariablesService {
* during asset creation.
*/
private String responseApiAssetId;
@Value("${puris.api.key}")
/**
* The key for accessing the api.
*/
private String apiKey;

@Value("${edc.controlplane.key}")
/**
Expand Down Expand Up @@ -114,43 +119,39 @@ public class VariablesService {
* the name of your company.
*/
private String ownName;
@Value("${own.default.bpns}")
@Value("${own.bpns}")
/**
* A BPNS that was assigned to you.
*/
private String ownDefaultBpns;
@Value("${own.default.site.name}")
@Value("${own.site.name}")
/**
* A human-readable description of the site that you referenced in
* the ownDefaultBpns.
*/
private String ownDefaultSiteName;
@Value("${own.default.bpna}")
@Value("${own.bpna}")
/** A BPNA that was assigned to you. If you initialised the
* ownDefaultBpns variable, then it must be a BPNA that is associated
* to that BPNS.
*/
private String ownDefaultBpna;
@Value("${own.default.streetandnumber}")
@Value("${own.streetandnumber}")
/**
* The street and number associated to the ownDefaultBpna
*/
private String ownDefaultStreetAndNumber;
@Value("${own.default.zipcodeandcity}")
@Value("${own.zipcodeandcity}")
/**
* The zip code and name of the city associated to the ownDefaultBpna
*/
private String ownDefaultZipCodeAndCity;
@Value("${own.default.country}")
@Value("${own.country}")
/**
* The country in which your ownDefaultBpna-address is located.
*/
private String ownDefaultCountry;
/**
* The key for accessing the api.
*/
@Value("${puris.api.key}")
private String apiKey;


/**
* Returns the asset-id as defined in the properties file for the given api method
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
// any request in spring context
(authorizeHttpRequests) -> authorizeHttpRequests
.requestMatchers("/stockView/**", "/partners/**", "/materials/**", "/materialpartnerrelations/**", "/product-stock/**", "/edrendpoint/**").authenticated()
.requestMatchers("/swagger-ui/**", "/v3/api-docs/**").permitAll()
.requestMatchers("/swagger-ui/**", "/v3/api-docs/**", "/health/**").permitAll()
)
.httpBasic(
AbstractHttpConfigurer::disable
Expand Down
20 changes: 13 additions & 7 deletions backend/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ edc.controlplane.key=${EDC_CONTROLPLANE_KEY:password}
edc.controlplane.management.url=${EDC_CONTROLPLANE_MANAGEMENT_URL:http://customer-control-plane:8181/management}
edc.controlplane.protocol.url=${EDC_CONTROLPLANE_PROTOCOL_URL:http://customer-control-plane:8184/api/v1/dsp}

# Needs to be set for forwarding http --> https
edc.web.rest.cors.enabled=true

# Jackson (JSON)
#spring.jackson.default-property-inclusion=non_empty
#logging.level.org.hibernate.SQL=DEBUG
Expand All @@ -31,18 +34,21 @@ spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true

# Own BPNL
own.bpnl=${OWN_BPNL:BPNL4444444444XX}

# Own name (self-description)
own.name=${OWN_NAME:Scenario Customer}
# Own BPNS (optional: if this is set, then set own.default.site.name as well)
own.default.bpns=${OWN_DEFAULT_BPNS:BPNS4444444444XX}

# Own BPNS (optional: if this is set, then set own.site.name as well)
own.bpns=${OWN_BPNS:BPNS4444444444XY}
# Name of Site (see above)
own.default.site.name=${OWN_DEFAULT_SITE_NAME:Hauptwerk Musterhausen}
own.site.name=${OWN_SITE:Hauptwerk Musterhausen}

# If a BPNS is set, then this BPNA will be attached to it.
# Otherwise, it will be attached immediately to the BPNL (see above)
own.default.bpna=${OWN_DEFAULT_BPNA:BPNA4444444444ZZ}
own.default.streetandnumber=${OWN_DEFAULT_STREETANDNUMBER:Musterstrasse 35b}
own.default.zipcodeandcity=${OWN_DEFAULT_ZIPCODEANDCITY:77777 Musterhausen}
own.default.country=${OWN_DEFAULT_COUNTRY:Germany}
own.bpna=${OWN_BPNA:BPNA4444444444ZZ}
own.streetandnumber=${OWN_STREETANDNUMBER:Musterstrasse 35b}
own.zipcodeandcity=${OWN_ZIPCODEANDCITY:77777 Musterhausen}
own.country=${OWN_COUNTRY:Germany}

# run with:
# ./mvnw spring-boot:run -Dspring-boot.run.arguments=--spring.config.location="./src/main/resources/application.properties"
10 changes: 2 additions & 8 deletions charts/puris/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,12 @@

apiVersion: v2
name: puris
description: An umbrella Helm chart for Kubernetes deployment of PURIS
description: A helm chart for Kubernetes deployment of PURIS
type: application
home: https://github.com/eclipse-tractusx/puris
sources:
- https://github.com/eclipse-tractusx/puris
dependencies:
- name: frontend
version: 1.0.0
repository: "file://charts/frontend"
- name: backend
version: 1.0.0
repository: "file://charts/backend"
dependencies: []

# 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.
Expand Down
Loading

0 comments on commit 7eeb128

Please sign in to comment.