Skip to content

Commit

Permalink
Merge branch 'main' into wallet-deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
oriolcanades authored Jun 6, 2024
2 parents d7d8916 + e431509 commit 82b3a75
Show file tree
Hide file tree
Showing 39 changed files with 1,547 additions and 17 deletions.
4 changes: 2 additions & 2 deletions charts/desmos/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ sources:
- https://github.com/in2workspace/desmos

maintainers:
- name: Oriol Canadés
email: oriol.canades@in2.es
- name: IN2 Team
email: domesupport@in2.es
12 changes: 7 additions & 5 deletions charts/desmos/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,19 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
containerPort: {{ .Values.app.internalServerPort }}
protocol: TCP
livenessProbe:
httpGet:
path: {{ .Values.livenessProbe.path }}
port: 8080
port: {{ .Values.app.internalServerPort }}
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
readinessProbe:
httpGet:
path: {{ .Values.readinessProbe.path }}
port: 8080
port: {{ .Values.app.internalServerPort }}
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
Expand All @@ -78,6 +78,8 @@ spec:
value: {{.Values.app.profile}}
- name: LOGGING_LEVEL_ROOT
value: {{.Values.app.logLevel}}
- name: SERVER_PORT
value: {{ quote .Values.app.internalServerPort}}
- name: SPRING_R2DBC_URL
value: "r2dbc:postgresql://{{ .Values.db.host }}{{ if not .Values.db.externalService }}:{{ .Values.db.port }}{{ end }}/{{ .Values.db.name }}"
- name: SPRING_R2DBC_USERNAME
Expand All @@ -98,7 +100,7 @@ spec:
- name: BROKER_INTERNAL_DOMAIN
value: {{.Values.app.broker.internalDomain}}
- name: NGSI_SUBSCRIPTION_NOTIFICATION_ENDPOINT
value: {{.Values.app.ngsiSubscription.notificationEndpoint}}
value: "http://{{.Chart.Name}}:{{.Values.app.internalServerPort}}{{.Values.app.ngsiSubscription.notificationEndpoint}}"
- name: NGSI_SUBSCRIPTION_ENTITY_TYPES
value: {{.Values.app.ngsiSubscription.entityTypes}}
- name: DLT_ADAPTER_PROVIDER
Expand All @@ -108,6 +110,6 @@ spec:
- name: DLT_ADAPTER_EXTERNAL_DOMAIN
value: {{.Values.app.dltAdapter.externalDomain}}
- name: TX_SUBSCRIPTION_NOTIFICATION_ENDPOINT
value: {{.Values.app.txSubscription.notificationEndpoint}}
value: "http://{{.Chart.Name}}:{{.Values.app.internalServerPort}}{{.Values.app.txSubscription.notificationEndpoint}}"
- name: TX_SUBSCRIPTION_ENTITY_TYPES
value: {{.Values.app.txSubscription.entityTypes}}
2 changes: 1 addition & 1 deletion charts/desmos/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
targetPort: {{.Values.app.internalServerPort}}
protocol: TCP
name: http
selector:
Expand Down
7 changes: 4 additions & 3 deletions charts/desmos/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,23 +110,24 @@ tolerations: []
affinity: {}

app:
profile: dev
profile: test
logLevel: DEBUG
internalServerPort: 8080
operator:
organizationIdentifier: VATES-S9999999E
broker:
provider: scorpio
internalDomain: http://scorpio:9090
externalDomain: http://scorpio:9090
ngsiSubscription:
notificationEndpoint: http://desmos:8080/api/v1/notifications/broker
notificationEndpoint: /api/v1/notifications/broker
entityTypes: catalog,product-offering,category,individual,organization,product,service-specification,product-offering-price,resource-specification,product-specification
dltAdapter:
provider: digitelts
internalDomain: http://dlt-adapter:8080
externalDomain: http://dlt-adapter:8080
txSubscription:
notificationEndpoint: http://desmos:8080/api/v1/notifications/dlt
notificationEndpoint: /api/v1/notifications/dlt
entityTypes: catalog,product-offering,category,individual,organization,product,service-specification,product-offering-price,resource-specification,product-specification

db:
Expand Down
23 changes: 23 additions & 0 deletions charts/dome-issuer-keycloak/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
13 changes: 13 additions & 0 deletions charts/dome-issuer-keycloak/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v2
name: dome-issuer-keycloak
description: A Helm chart for Kubernetes
type: application
version: 1.0.0
appVersion: v1.1.0

sources:
- https://github.com/in2workspace/dome-issuer-keycloak

maintainers:
- name: IN2 Team
email: domesupport@in2.es
119 changes: 119 additions & 0 deletions charts/dome-issuer-keycloak/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "dome-issuer-keycloak.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 "dome-issuer-keycloak.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 "dome-issuer-keycloak.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "dome-issuer-keycloak.labels" -}}
helm.sh/chart: {{ include "dome-issuer-keycloak.chart" . }}
{{ include "dome-issuer-keycloak.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "dome-issuer-keycloak.selectorLabels" -}}
app.kubernetes.io/name: {{ include "dome-issuer-keycloak.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "dome-issuer-keycloak.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "dome-issuer-keycloak.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Support for existing keycloak admin secret
*/}}
{{- define "keycloak.secretName.admin" -}}
{{- if .Values.keycloak.admin.existingSecret.enabled -}}
{{- printf "%s" (tpl .Values.keycloak.admin.existingSecret.name $) -}}
{{- else -}}
{{- printf "%s" (include "dome-issuer-keycloak.fullname" .) -}}
{{- end -}}
{{- end -}}

{{- define "keycloak.passwordKey.admin" -}}
{{- if .Values.keycloak.admin.existingSecret.enabled -}}
{{- printf "%s" (tpl .Values.keycloak.admin.existingSecret.passwordKey $) -}}
{{- else -}}
{{- printf "keycloak-admin-password" -}}
{{- end -}}
{{- end -}}

{{/*
Support for existing keycloak https secret
*/}}
{{- define "keycloak.secretName.https" -}}
{{- if .Values.keycloak.https.existingSecret.enabled -}}
{{- printf "%s" (tpl .Values.keycloak.https.existingSecret.name $) -}}
{{- else -}}
{{- printf "%s" (include "dome-issuer-keycloak.fullname" .) -}}
{{- end -}}
{{- end -}}

{{- define "keycloak.trustStorePasswordKey.https" -}}
{{- if .Values.keycloak.https.existingSecret.enabled -}}
{{- printf "%s" (tpl .Values.keycloak.https.existingSecret.trustStorePasswordKey $) -}}
{{- else -}}
{{- printf "keycloak-trust-store-password" -}}
{{- end -}}
{{- end -}}

{{/*
Support for existing keycloak db secret
*/}}
{{- define "keycloak.secretName.db" -}}
{{- if .Values.keycloak.db.existingSecret.enabled -}}
{{- printf "%s" (tpl .Values.keycloak.db.existingSecret.name $) -}}
{{- else -}}
{{- printf "%s" (include "dome-issuer-keycloak.fullname" .) -}}
{{- end -}}
{{- end -}}

{{- define "keycloak.passwordKey.db" -}}
{{- if .Values.keycloak.db.existingSecret.enabled -}}
{{- printf "%s" (tpl .Values.keycloak.db.existingSecret.passwordKey $) -}}
{{- else -}}
{{- printf "keycloak-db-password" -}}
{{- end -}}
{{- end -}}
106 changes: 106 additions & 0 deletions charts/dome-issuer-keycloak/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "dome-issuer-keycloak.fullname" . }}
namespace: {{ $.Release.Namespace | quote }}
labels:
{{- include "dome-issuer-keycloak.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "dome-issuer-keycloak.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "dome-issuer-keycloak.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "dome-issuer-keycloak.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.app.internalServerPort }}
protocol: TCP
livenessProbe:
httpGet:
path: {{ .Values.livenessProbe.path }}
port: {{ .Values.app.internalServerPort }}
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
readinessProbe:
httpGet:
path: {{ .Values.readinessProbe.path }}
port: {{ .Values.app.internalServerPort }}
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
env:
- name: KEYCLOAK_ADMIN
value: {{ .Values.keycloak.admin.username }}
- name: KEYCLOAK_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "keycloak.secretName.admin" . }}
key: {{ include "keycloak.passwordKey.admin" . }}
- name: KC_HOSTNAME_URL
value: {{ .Values.keycloak.hostname.url }}
- name: KC_HOSTNAME_ADMIN_URL
value: {{ .Values.keycloak.hostname.adminUrl }}
- name: KC_HTTPS_CERTIFICATE_KEY_FILE
value: {{ .Values.keycloak.https.certificateKeyFile }}
- name: KC_HTTPS_CERTIFICATE_FILE
value: {{ .Values.keycloak.https.certificateFile }}
- name: KC_HTTPS_TRUST_STORE_FILE
value: {{ .Values.keycloak.https.trustStoreFile }}
- name: KC_HTTPS_TRUST_STORE_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "keycloak.secretName.https" . }}
key: {{ include "keycloak.trustStorePasswordKey.https" . }}
- name: KC_HTTPS_CLIENT_AUTH
value: {{ .Values.keycloak.https.clientAuth }}
- name: KC_DB
value: {{ .Values.keycloak.db.type }}
- name: KC_DB_USERNAME
value: {{ .Values.keycloak.db.username }}
- name: KC_DB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "keycloak.secretName.db" . }}
key: {{ include "keycloak.passwordKey.db" . }}
- name: KC_DB_URL
value: {{ .Values.keycloak.db.url }}
- name: DB_PORT
value: "{{ .Values.keycloak.db.port }}"
- name: ISSUER_API_URL
value: {{ .Values.issuerApi.url }}
- name: ISSUER_API_EXTERNAL_URL
value: {{ .Values.issuerApi.externalUrl }}
- name: PRE_AUTH_LIFESPAN
value: "{{ .Values.preAuth.lifespan }}"
- name: PRE_AUTH_LIFESPAN_TIME_UNIT
value: {{ .Values.preAuth.lifespanTimeUnit }}
- name: TX_CODE_SIZE
value: "{{ .Values.txCode.size }}"
- name: TX_CODE_DESCRIPTION
value: {{ .Values.txCode.description }}
- name: TOKEN_EXPIRATION
value: "{{ .Values.token.expiration }}"
Loading

0 comments on commit 82b3a75

Please sign in to comment.