Skip to content

Commit 798ff4e

Browse files
authored
Merge pull request #20 from catenax-ng/main
Release changes for QG4
2 parents 9b76bb9 + 0f24e7a commit 798ff4e

File tree

113 files changed

+1304
-807
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+1304
-807
lines changed

.github/workflows/chart-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232

3333
- name: Update helm dependencies for trace-x
3434
run: |
35-
cd charts/tx-traceability-foss-frontend
35+
cd charts/traceability-foss-frontend
3636
helm repo add bitnami https://charts.bitnami.com/bitnami
3737
helm dependency update
3838
- name: Run chart-releaser

DEPENDENCIES

Lines changed: 277 additions & 167 deletions
Large diffs are not rendered by default.

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Nonroot user is not needed beause we are using the "nginx-unprivileged" image
12
# STAGE 1: Build
23
FROM node:18-alpine as builder
34

@@ -20,6 +21,7 @@ HEALTHCHECK --interval=30s --timeout=10s --retries=3 --start-period=10s \
2021
CMD curl -fSs 127.0.0.1:8080/healthz || exit 1
2122

2223
USER root
24+
2325
RUN rm /usr/share/nginx/html/index.html && rm /etc/nginx/conf.d/default.conf
2426

2527
# Copy project files from ‘builder’ stage copy over the artifacts in dist folder to default nginx public folder
@@ -43,3 +45,4 @@ COPY ./scripts/inject-dynamic-env.js /docker-entrypoint.d/
4345

4446
# Validate NGINX configuration
4547
RUN nginx -t
48+
USER 101

INSTALL.md

Lines changed: 77 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
1-
## How to build the application
2-
3-
The angular app is built into Docker containers and exposed through NGINX
4-
5-
It is important to specify the type of configuration profile, previously defined in the angular JSON file, so it can
6-
build the application correctly.
7-
8-
## How to run the docker image
1+
# Environment variables
92

10-
When running the build docker image you are able to pass through multiple environment variables to configure the FE.
113
Support environment variables are:
124

135
```javascript
@@ -39,6 +31,82 @@ This variable points to the desired api
3931
`CATENAX_PORTAL_BASE_URL`
4032
This variable is used to set the base path of the application. (Should be set if application runs as a subtopic)
4133

34+
# Helm deployment
35+
36+
## Configuration of values.yaml
37+
38+
To run a helm chart you first need to specify a values file with instructions on how to run your helm file.
39+
Here is an example how you could structure this file for this frontend helm chart.
40+
41+
`your-values.yaml`
42+
43+
```yaml
44+
image:
45+
tag: $APP_REVISION
46+
ENVIRONMENT_VAR_1: 'VALUE'
47+
ENVIRONMENT_VAR_2: 'VALUE'
48+
...
49+
50+
ingress:
51+
enabled: true
52+
className: "nginx"
53+
annotations:
54+
cert-manager.io/cluster-issuer: letsencrypt-prod
55+
hosts:
56+
- host: "${FE_HOST_URL}"
57+
paths:
58+
- path: /
59+
pathType: Prefix
60+
tls:
61+
- hosts:
62+
- "${FE_HOST_URL}"
63+
secretName: "${FE_HOST_URL}-tls"
64+
65+
```
66+
67+
## Helm installation
68+
69+
Add the Trace-X frontend Helm repository:
70+
71+
```sh
72+
$ helm repo add traceability-foss-frontend https://catenax-ng.github.io/tx-traceability-foss-frontend
73+
```
74+
75+
Then install the Helm chart into your cluster:
76+
77+
```sh
78+
$ helm install -f your-values.yaml traceability-foss-frontend traceability-foss-frontend/traceability-foss-frontend
79+
```
80+
81+
### Deployment using ArgoCD
82+
83+
Create a new Helm chart and use Trace-X as a dependency.
84+
85+
```yaml
86+
dependencies:
87+
- name: traceability-foss-frontend
88+
alias: frontend
89+
version: x.x.x
90+
repository: 'https://catenax-ng.github.io/tx-traceability-foss-frontend/'
91+
```
92+
93+
Then provide your configuration as the values.yaml of that chart.
94+
95+
Create a new application in ArgoCD and point it to your repository / Helm chart folder.
96+
97+
# Docker deployment
98+
99+
## How to build the application
100+
101+
The angular app is built into Docker containers and exposed through NGINX
102+
103+
It is important to specify the type of configuration profile, previously defined in the angular JSON file, so it can
104+
build the application correctly.
105+
106+
## How to run the docker image
107+
108+
When running the build docker image you are able to pass through multiple environment variables to configure the FE.
109+
42110
### Example command:
43111
44112
```shell

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Secondly, Angular `scales` perfectly in the long run. Because of the restricted
2525
With that in mind it made sense it chose Angular for an `open source` project.
2626

2727
Source files are exposed statically through the NGINX web server.
28+
TRACE-FOSS product composes of the backend and frontend repositories, backend repository can be found under [GitHub repository](https://github.com/catenax-ng/tx-traceability-foss-backend).
2829

2930
### Challenges and solutions
3031

charts/tx-traceability-foss-frontend/Chart.yaml renamed to charts/traceability-foss-frontend/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
apiVersion: v2
2-
name: tx-traceability-foss-frontend
2+
name: traceability-foss-frontend
33
description: A Helm chart for Traceability frontend application
44

55
# A chart can be either an 'application' or a 'library' chart.

charts/tx-traceability-foss-frontend/templates/NOTES.txt renamed to charts/traceability-foss-frontend/templates/NOTES.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
1. Get the application URL by running these commands:
22
{{- if contains "NodePort" .Values.service.type }}
3-
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "tx-traceability-foss-frontend.fullname" . }})
3+
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "traceability-foss-frontend.fullname" . }})
44
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
55
echo http://$NODE_IP:$NODE_PORT
66
{{- else if contains "LoadBalancer" .Values.service.type }}
77
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
8-
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "tx-traceability-foss-frontend.fullname" . }}'
9-
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "tx-traceability-foss-frontend.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
8+
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "traceability-foss-frontend.fullname" . }}'
9+
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "traceability-foss-frontend.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
1010
echo http://$SERVICE_IP:{{ .Values.service.port }}
1111
{{- else if contains "ClusterIP" .Values.service.type }}
12-
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "tx-traceability-foss-frontend.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
12+
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "traceability-foss-frontend.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
1313
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
1414
echo "Visit http://127.0.0.1:8080 to use your application"
1515
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT

charts/tx-traceability-foss-frontend/templates/_helpers.tpl renamed to charts/traceability-foss-frontend/templates/_helpers.tpl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{/*
22
Expand the name of the chart.
33
*/}}
4-
{{- define "tx-traceability-foss-frontend.name" -}}
4+
{{- define "traceability-foss-frontend.name" -}}
55
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
66
{{- end }}
77

@@ -10,7 +10,7 @@ Create a default fully qualified app name.
1010
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
1111
If release name contains chart name it will be used as a full name.
1212
*/}}
13-
{{- define "tx-traceability-foss-frontend.fullname" -}}
13+
{{- define "traceability-foss-frontend.fullname" -}}
1414
{{- if .Values.fullnameOverride }}
1515
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
1616
{{- else }}
@@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name.
2626
{{/*
2727
Create chart name and version as used by the chart label.
2828
*/}}
29-
{{- define "tx-traceability-foss-frontend.chart" -}}
29+
{{- define "traceability-foss-frontend.chart" -}}
3030
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
3131
{{- end }}
3232

3333
{{/*
3434
Common labels
3535
*/}}
36-
{{- define "tx-traceability-foss-frontend.labels" -}}
37-
helm.sh/chart: {{ include "tx-traceability-foss-frontend.chart" . }}
38-
{{ include "tx-traceability-foss-frontend.selectorLabels" . }}
36+
{{- define "traceability-foss-frontend.labels" -}}
37+
helm.sh/chart: {{ include "traceability-foss-frontend.chart" . }}
38+
{{ include "traceability-foss-frontend.selectorLabels" . }}
3939
{{- if .Chart.AppVersion }}
4040
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
4141
{{- end }}
@@ -45,17 +45,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
4545
{{/*
4646
Selector labels
4747
*/}}
48-
{{- define "tx-traceability-foss-frontend.selectorLabels" -}}
49-
app.kubernetes.io/name: {{ include "tx-traceability-foss-frontend.name" . }}
48+
{{- define "traceability-foss-frontend.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "traceability-foss-frontend.name" . }}
5050
app.kubernetes.io/instance: {{ .Release.Name }}
5151
{{- end }}
5252

5353
{{/*
5454
Create the name of the service account to use
5555
*/}}
56-
{{- define "tx-traceability-foss-frontend.serviceAccountName" -}}
56+
{{- define "traceability-foss-frontend.serviceAccountName" -}}
5757
{{- if .Values.serviceAccount.create }}
58-
{{- default (include "tx-traceability-foss-frontend.fullname" .) .Values.serviceAccount.name }}
58+
{{- default (include "traceability-foss-frontend.fullname" .) .Values.serviceAccount.name }}
5959
{{- else }}
6060
{{- default "default" .Values.serviceAccount.name }}
6161
{{- end }}

charts/tx-traceability-foss-frontend/templates/deployment.yaml renamed to charts/traceability-foss-frontend/templates/deployment.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ apiVersion: apps/v1
22
kind: Deployment
33
metadata:
44
namespace: {{ .Values.namespace | default .Release.Namespace }}
5-
name: {{ include "tx-traceability-foss-frontend.fullname" . }}
5+
name: {{ include "traceability-foss-frontend.fullname" . }}
66
labels:
7-
{{- include "tx-traceability-foss-frontend.labels" . | nindent 4 }}
7+
{{- include "traceability-foss-frontend.labels" . | nindent 4 }}
88
spec:
99
{{- if not .Values.autoscaling.enabled }}
1010
replicas: {{ .Values.replicaCount }}
1111
{{- end }}
1212
selector:
1313
matchLabels:
14-
{{- include "tx-traceability-foss-frontend.selectorLabels" . | nindent 6 }}
14+
{{- include "traceability-foss-frontend.selectorLabels" . | nindent 6 }}
1515
revisionHistoryLimit: 2
1616
template:
1717
metadata:
@@ -21,19 +21,19 @@ spec:
2121
{{- toYaml . | nindent 8 }}
2222
{{- end }}
2323
labels:
24-
{{- include "tx-traceability-foss-frontend.selectorLabels" . | nindent 8 }}
24+
{{- include "traceability-foss-frontend.selectorLabels" . | nindent 8 }}
2525
spec:
2626
automountServiceAccountToken: false
2727
{{- if .Values.imagePullSecret.dockerconfigjson }}
2828
imagePullSecrets:
29-
- name: {{ include "tx-traceability-foss-frontend.fullname" . }}-imagepullsecret
29+
- name: {{ include "traceability-foss-frontend.fullname" . }}-imagepullsecret
3030
{{- else }}
3131
{{- with .Values.imagePullSecrets }}
3232
imagePullSecrets:
3333
{{- toYaml . | nindent 8 }}
3434
{{- end }}
3535
{{- end }}
36-
serviceAccountName: {{ include "tx-traceability-foss-frontend.serviceAccountName" . }}
36+
serviceAccountName: {{ include "traceability-foss-frontend.serviceAccountName" . }}
3737
securityContext:
3838
{{- toYaml .Values.podSecurityContext | nindent 8 }}
3939
containers:
@@ -76,4 +76,4 @@ spec:
7676
{{- with .Values.tolerations }}
7777
tolerations:
7878
{{- toYaml . | nindent 8 }}
79-
{{- end }}
79+
{{- end }}

0 commit comments

Comments
 (0)