From 38f3cd9a6868a868cf8cedc389e0cd7839ec236d Mon Sep 17 00:00:00 2001 From: Stefan Wiedemann Date: Tue, 12 Mar 2024 12:35:54 +0100 Subject: [PATCH] add frontend --- aws/apps/fiware/fiware-wallet-driving.yaml | 21 ++++++++ .../dome-wallet/wallet-driving/Chart.yaml | 7 +++ .../wallet-driving/templates/_helpers.tpl | 45 ++++++++++++++++ .../wallet-driving/templates/certificate.yaml | 14 +++++ .../wallet-driving/templates/deployment.yaml | 52 +++++++++++++++++++ .../wallet-driving/templates/route.yaml | 16 ++++++ .../wallet-driving/templates/service.yaml | 18 +++++++ .../dome-wallet/wallet-driving/values.yaml | 14 +++++ 8 files changed, 187 insertions(+) create mode 100644 aws/apps/fiware/fiware-wallet-driving.yaml create mode 100644 aws/fiware/dome-wallet/wallet-driving/Chart.yaml create mode 100644 aws/fiware/dome-wallet/wallet-driving/templates/_helpers.tpl create mode 100644 aws/fiware/dome-wallet/wallet-driving/templates/certificate.yaml create mode 100644 aws/fiware/dome-wallet/wallet-driving/templates/deployment.yaml create mode 100644 aws/fiware/dome-wallet/wallet-driving/templates/route.yaml create mode 100644 aws/fiware/dome-wallet/wallet-driving/templates/service.yaml create mode 100644 aws/fiware/dome-wallet/wallet-driving/values.yaml diff --git a/aws/apps/fiware/fiware-wallet-driving.yaml b/aws/apps/fiware/fiware-wallet-driving.yaml new file mode 100644 index 00000000..dd4b684d --- /dev/null +++ b/aws/apps/fiware/fiware-wallet-driving.yaml @@ -0,0 +1,21 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: fiware-wallet-driving + namespace: argocd +spec: + destination: + namespace: fiware + server: https://kubernetes.default.svc + project: default + source: + helm: + valueFiles: + - values.yaml + path: aws/fiware/dome-wallet/wallet-driving + repoURL: https://github.com/FIWARE-Ops/fiware-gitops + targetRevision: HEAD + syncPolicy: + automated: + prune: true + selfHeal: true \ No newline at end of file diff --git a/aws/fiware/dome-wallet/wallet-driving/Chart.yaml b/aws/fiware/dome-wallet/wallet-driving/Chart.yaml new file mode 100644 index 00000000..a9b08890 --- /dev/null +++ b/aws/fiware/dome-wallet/wallet-driving/Chart.yaml @@ -0,0 +1,7 @@ +apiVersion: v2 +name: wallet-driving +description: wallet-driving Helm-Chart + +type: application +version: 0.1.0 +appVersion: "v1.0.0-SNAPSHOT" diff --git a/aws/fiware/dome-wallet/wallet-driving/templates/_helpers.tpl b/aws/fiware/dome-wallet/wallet-driving/templates/_helpers.tpl new file mode 100644 index 00000000..08a838b7 --- /dev/null +++ b/aws/fiware/dome-wallet/wallet-driving/templates/_helpers.tpl @@ -0,0 +1,45 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "wallet-driving.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "wallet-driving.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "wallet-driving.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + + +{{/* +Common labels +*/}} +{{- define "wallet-driving.labels" -}} +app.kubernetes.io/name: {{ include "wallet-driving.name" . }} +helm.sh/chart: {{ include "wallet-driving.chart" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} \ No newline at end of file diff --git a/aws/fiware/dome-wallet/wallet-driving/templates/certificate.yaml b/aws/fiware/dome-wallet/wallet-driving/templates/certificate.yaml new file mode 100644 index 00000000..16e316f7 --- /dev/null +++ b/aws/fiware/dome-wallet/wallet-driving/templates/certificate.yaml @@ -0,0 +1,14 @@ +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: dome-wallet +spec: + ## secret the certificate should be stored to, will be referenced by the route + secretName: dome-wallet + issuerRef: + ## certificate issuer, as created in the cert-manager installation step + kind: ClusterIssuer + name: letsencrypt-aws-prod + commonName: "dome-wallet.fiware.dev" + dnsNames: + - "dome-wallet.fiware.dev" \ No newline at end of file diff --git a/aws/fiware/dome-wallet/wallet-driving/templates/deployment.yaml b/aws/fiware/dome-wallet/wallet-driving/templates/deployment.yaml new file mode 100644 index 00000000..a188c8e8 --- /dev/null +++ b/aws/fiware/dome-wallet/wallet-driving/templates/deployment.yaml @@ -0,0 +1,52 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "wallet-driving.fullname" . }} + namespace: {{ .Release.Namespace | quote }} + labels: + {{ include "wallet-driving.labels" . | nindent 4 }} +spec: + replicas: 1 + revisionHistoryLimit: 3 + selector: + matchLabels: + app.kubernetes.io/name: {{ include "wallet-driving.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + strategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 + template: + metadata: + labels: + {{ include "wallet-driving.labels" . | nindent 8 }} + spec: + containers: + - name: {{ .Chart.Name }} + imagePullPolicy: {{ .Values.deployment.image.pullPolicy }} + image: "{{ .Values.deployment.image.repository }}:{{ .Values.deployment.image.tag }}" + env: + - name: WCA_URL + value: {{ .Values.deployment.walletServer.http | quote }} + - name: DATA_URL + value: {{ .Values.deployment.walletServer.http | quote }} + - name: LOGIN_URL + value: {{ .Values.deployment.keycloakUrl | quote }} + - name: EXECCONT_URI + value: "/api/v2/execute-content" + - name: VP_URL + value: "api/v2/verifiable-presentation" + - name: CRED_URI + value: "/api/v2/credentials" + - name: CREDID_URI + value: "/api/v2/credentials?credentialId=" + - name: USER_URI + value: "/api/v2/users" + - name: WEBSOCKET_URL + value: {{ .Values.deployment.walletServer.ws | quote }} + - name: WEBSOCKET_URI + value: "/api/v2/pin" + ports: + - containerPort: {{ .Values.service.port}} + name: http + protocol: TCP \ No newline at end of file diff --git a/aws/fiware/dome-wallet/wallet-driving/templates/route.yaml b/aws/fiware/dome-wallet/wallet-driving/templates/route.yaml new file mode 100644 index 00000000..ea314c3e --- /dev/null +++ b/aws/fiware/dome-wallet/wallet-driving/templates/route.yaml @@ -0,0 +1,16 @@ +apiVersion: route.openshift.io/v1 +kind: Route +metadata: + annotations: + cert-utils-operator.redhat-cop.io/certs-from-secret: dome-wallet + name: dome-wallet +spec: + host: dome-wallet.fiware.dev + port: + targetPort: 4200 + tls: + termination: edge + insecureEdgeTerminationPolicy: Redirect + to: + kind: Service + name: {{ include "wallet-driving.fullname" . }} \ No newline at end of file diff --git a/aws/fiware/dome-wallet/wallet-driving/templates/service.yaml b/aws/fiware/dome-wallet/wallet-driving/templates/service.yaml new file mode 100644 index 00000000..1a9cde10 --- /dev/null +++ b/aws/fiware/dome-wallet/wallet-driving/templates/service.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "wallet-server.fullname" . }} + namespace: {{ .Release.Namespace | quote }} + labels: + {{ include "wallet-server.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + # same as scorpio, makes other config easier + - port: {{ .Values.service.port }} + targetPort: {{ .Values.service.port }} + protocol: TCP + name: http + selector: + app.kubernetes.io/name: {{ include "wallet-server.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} \ No newline at end of file diff --git a/aws/fiware/dome-wallet/wallet-driving/values.yaml b/aws/fiware/dome-wallet/wallet-driving/values.yaml new file mode 100644 index 00000000..c5ab10c1 --- /dev/null +++ b/aws/fiware/dome-wallet/wallet-driving/values.yaml @@ -0,0 +1,14 @@ +deployment: + image: + repository: in2kizuna/wallet-driving-application + # -- tag of the image to be used + tag: v1.0.0-SNAPSHOT + # -- specification of the image pull policy + pullPolicy: IfNotPresent + walletServer: + http: http://dome-wallet-server:8080 + ws: ws://dome-wallet-server:8080 + keycloakUrl: http://fiware-wallet-keycloak:8080/realms/wallet +service: + port: 4200 + type: ClusterIP \ No newline at end of file