Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • eclipse/xfsc/ocm/ocm-engine
  • zdravko61/ocm-engine
  • mjuergenscg/ocm-engine
  • tsabolov/ocm-engine
  • mikesell/ocm-engine
5 results
Show changes
Commits on Source (328)
Showing
with 340 additions and 2473 deletions
......@@ -3,6 +3,7 @@
# Except these files
!*.ts
!*.mts
!*.d.ts
# .. also in subdirectories
......
......@@ -14,13 +14,13 @@ module.exports = {
project: ['./tsconfig.eslint.json'],
},
settings: {
'import/extensions': ['.js', '.ts'],
'import/extensions': ['.js', '.mjs', '.ts', '.mts'],
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
'@typescript-eslint/parser': ['.ts', '.tsx', '.mts'],
},
'import/resolver': {
typescript: {
project: 'packages/*/tsconfig.json',
project: ['apps/*/tsconfig.json'],
alwaysTryTypes: true,
},
},
......@@ -75,7 +75,7 @@ module.exports = {
},
overrides: [
{
files: ['*.spec.ts', '*.e2e-spec.ts', '**/tests/**'],
files: ['*.spec.ts', '*.e2e-spec.ts', '**/tests/**', '**/test/**'],
env: {
jest: true,
node: true,
......@@ -88,6 +88,6 @@ module.exports = {
},
],
},
},
}
],
};
include:
- project: 'eclipse/xfsc/dev-ops/ci-templates'
file: 'helm-build-ci.yaml'
ref: main
- project: 'eclipsefdn/it/releng/gitlab-runner-service/gitlab-ci-templates'
file: '/jobs/buildkit.gitlab-ci.yml'
stages:
- build
- release
docker-build:
extends: .buildkit
parallel:
matrix:
- SERVICE: [connection-manager, credential-manager,did-manager,proof-manager,ssi-abstraction,schema-manager,tenant-manager]
stage: build
variables:
CI_REGISTRY: ${HARBOR_HOST}
CI_REGISTRY_USER: ${HARBOR_USERNAME}
CI_REGISTRY_PASSWORD: ${HARBOR_PASSWORD}
CI_REGISTRY_IMAGE: ${HARBOR_HOST}/${HARBOR_PROJECT}/$SERVICE
BUILD_ARG: "--opt build-arg:SERVICE=${SERVICE}"
......@@ -4,7 +4,9 @@
# Except for these files
!*.ts
!*.d.ts
!*.mts
!jest.config.js
!*.json
# .. also in subdirectories
!*/
......@@ -17,6 +19,3 @@ node_modules
apps/**/dist
compose
documentation
# Ignore ssi-abstraction for now
apps/ssi-abstraction
# Base
FROM node:20 AS base
FROM node:20.11 AS dependencies
ARG APP_HOME=/home/node/app
ARG SERVICE
WORKDIR /home/node/app
RUN corepack enable
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml tsconfig*.json .swcrc ./
COPY patches ./patches
COPY apps/shared/package.json ./apps/shared/
RUN pnpm install --frozen-lockfile
# Build shared
FROM node:20.11 as build-shared
ARG APP_HOME=/home/node/app
ARG SERVICE
......@@ -8,65 +21,47 @@ WORKDIR ${APP_HOME}
RUN corepack enable
# # libindy build
# FROM node:20-bullseye AS ssi-base
# RUN apt-get update \
# && apt-get install -y --no-install-recommends libsodium-dev libzmq3-dev
# RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain '1.58.0'
# RUN git clone https://github.com/hyperledger/indy-sdk
# RUN cd indy-sdk/libindy && ~/.cargo/bin/cargo build --release
# RUN cd indy-sdk/libindy && mv target/release/libindy.so /usr/lib/libindy.so
COPY apps/shared ./apps/shared
COPY --from=dependencies /home/node/app/package.json /home/node/app/pnpm-lock.yaml /home/node/app/pnpm-workspace.yaml /home/node/app/tsconfig*.json /home/node/app/.swcrc ./
COPY --from=dependencies /home/node/app/node_modules ./node_modules
COPY --from=dependencies /home/node/app/apps/shared/node_modules ./apps/shared/node_modules
COPY --from=dependencies /home/node/app/patches ./patches
RUN pnpm --filter shared build
# Build
FROM base AS build
# Build service
FROM node:20.11 AS build-service
ARG APP_HOME=/home/node/app
WORKDIR ${APP_HOME}
ARG SERVICE
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml tsconfig*.json .swcrc ./
COPY apps/${SERVICE}/package.json ./apps/${SERVICE}/
COPY apps/shared/package.json ./apps/shared/
WORKDIR ${APP_HOME}
RUN pnpm install --frozen-lockfile
RUN corepack enable
COPY --from=dependencies /home/node/app/package.json /home/node/app/pnpm-lock.yaml /home/node/app/pnpm-workspace.yaml /home/node/app/tsconfig*.json /home/node/app/.swcrc ./
COPY --from=dependencies /home/node/app/node_modules ./node_modules
COPY --from=dependencies /home/node/app/patches ./patches
COPY --from=build-shared /home/node/app/apps/shared ./apps/shared
COPY apps/${SERVICE} ./apps/${SERVICE}
COPY apps/shared ./apps/shared
RUN pnpm --filter shared build
RUN pnpm --filter ${SERVICE} build:production
RUN pnpm --filter ${SERVICE} --prod deploy build
RUN pnpm --filter shared --prod deploy shared
# This is a way of keeping the generated prisma client in the build folder
RUN if [ -d ./apps/${SERVICE}/node_modules/\@prisma/client ]; then \
GLOBAL_PRISMA_SETUP=`realpath ./apps/${SERVICE}/node_modules/\@prisma/client` \
GLOBAL_PRISMA_CLIENT=`readlink -f ${GLOBAL_PRISMA_SETUP}/../../.prisma` \
BUILD_PRISMA_SETUP=`realpath ./build/node_modules/\@prisma/client` \
BUILD_PRISMA_CLIENT=`readlink -f ${BUILD_PRISMA_SETUP}/../..` \
sh -c 'cp -r $GLOBAL_PRISMA_CLIENT $BUILD_PRISMA_CLIENT'; \
fi
RUN pnpm install --frozen-lockfile && pnpm --filter ${SERVICE} build && pnpm --filter ${SERVICE} --prod deploy build
# Final
FROM node:20 AS final
FROM node:20.11-slim AS final
ARG APP_HOME=/home/node/app
ARG NODE_ENV=production
ENV NODE_ENV=${NODE_ENV}
WORKDIR ${APP_HOME}
ENTRYPOINT ["./docker-entrypoint.sh"]
WORKDIR /home/node/app
CMD ["node", "dist/main.js"]
COPY --chown=node:node ./docker-entrypoint.sh ./docker-entrypoint.sh
COPY --from=build --chown=node:node ${APP_HOME}/build/dist ./dist
COPY --from=build --chown=node:node ${APP_HOME}/shared/dist ./shared
COPY --from=build --chown=node:node ${APP_HOME}/build/node_modules ./node_modules
COPY --from=build --chown=node:node ${APP_HOME}/build/package.json .
COPY --from=build-service --chown=node:node /home/node/app/build/dist ./dist
COPY --from=build-service --chown=node:node /home/node/app/build/node_modules ./node_modules
COPY --from=build-service --chown=node:node /home/node/app/build/package.json .
# Cut unnecessary stuff from package.json. Only leave name, version and module type
# Cut unnecessary stuff from package.json. Only leave name, version, description and module type
RUN node -e "\
const { name, version, type } = JSON.parse(fs.readFileSync('./package.json', 'utf-8'));\
fs.writeFileSync('./package.json', JSON.stringify({ name, version, type }, null, 2));\
const { name, description, version, type } = JSON.parse(fs.readFileSync('./package.json', 'utf-8'));\
fs.writeFileSync('./package.json', JSON.stringify({ name, version, description, type }, null, 2));\
"
# USER node
USER node
This diff is collapsed.
# ocm-engine version 1
# Organization Credential Manager (OCM)
#### Dependencies
## Introduction
Node 12
Python 2.5.0 >= <3.0.0
pnpm
Organization Credential Manager (OCM) is a comprehensive suite of microservices designed to facilitate the management of digital credentials within an organizational context. Utilizing the principles of Self-Sovereign Identity (SSI), OCM leverages a series of components to enable secure, efficient handling of credentials, keys, and connections between entities.
### Setup local
## Components
1. pnpm install
2. pnpm prisma:generate
3. pnpm /app/:build
OCM is comprised of several key microservices, each serving a specific role within the credential management ecosystem:
app options: attestation, connection, principal, ssi
### [SSI Abstraction](apps/ssi-abstraction/README.md)
A wrapper around the Credo library ([Credo](https://credo.js.org)), formerly known as Aries Framework Javascript, an implementation of a Hyperledger Indy Agent in TypeScript. This service abstracts the complexities of SSI operations for other components.
### Docker compose
### [Tenant Manager](apps/tenant-manager/README.md)
Manages the creation and listing of OCM tenants, with each tenant maintaining their collections of credentials, keys, etc. This service acts as a critical interface to the SSI Abstraction functionality and is intended for administrative use only.
1. Go to compose dir
### [DID Manager](apps/did-manager/README.md)
Provides API functions for registering Decentralized Identifiers (DIDs) on the Indy Ledger and resolving existing DID Documents, facilitating secure identity verification and management.
2. docker-compose up
### [Connection Manager](apps/connection-manager/README.md)
Facilitates the establishment of connections between OCM tenants using Aries protocols, enabling secure, verified interactions.
## Example Flows (OCM Usage)
### [Schema Manager](apps/schema-manager/README.md)
Allows tenants to manage Indy Schemas and Credential Definitions, laying the groundwork for the creation and recognition of standardized credential formats.
Please refer to [OCM-flow-overview](documentation/ocm-flow-overview.md)
### [Credential Manager](apps/credential-manager/README.md)
Offers an API for the detailed management of tenant credentials, streamlining the process of issuing, holding, and verifying digital credentials.
### [Proof Manager](apps/proof-manager/README.md)
Enables tenants to create proof requests, an essential feature for the verification of credential authenticity and integrity.
## Deployment
### Kubernetes
OCM can be deployed within a Kubernetes cluster to leverage the benefits of container orchestration for managing and scaling the microservices efficiently. The deployment process is streamlined through the use of Helm, a package manager for Kubernetes that facilitates the installation, upgrade, and management of Kubernetes applications.
Each microservice within OCM is equipped with its own Helm chart located in the service's folder. These Helm charts define the Kubernetes resources required for deploying and running the service, including Deployments, Services, and any necessary ConfigMaps or Secrets.
### Docker Compose (Local)
For local development and testing purposes, the OCM stack can also be run using Docker Compose with the following command:
```bash
docker compose up -d
```
This command builds the service container images and starts the stack. It's a convenient way to quickly bring up the OCM environment on a local machine for development, testing, or demonstration purposes.
#### Starting multiple instances of OCM
To demonstrate
```bash
./scripts/start_instance.sh
```
> This command can be run multiple times to start several instances of OCM.
> To stop instances that were started using the above command, use `./scripts/stop_instance.sh`.
## Local Development
To run each service locally, the following prerequisites are needed:
- Node.js (installed on the local machine)
- pnpm (package manager)
- Docker Compose (for running NATS server and S3 storage)
Before starting a service, create a `.env` file in the service's directory based on the `.env.example` provided, renaming it to `.env`.
## Documentation and Example Flows
For detailed usage and example flows, please refer to the [Postman Collection](documentation/Gaia-X_Organization_Credential_Manager.postman_collection.json) and the [OCM Example Flows](documentation/ocm-example-flows.md).
## Security
Note: Authentication and Authorization mechanisms are considered outside the scope of this project and should be addressed at the infrastructure level or through other means.
## License
Licensed under the Apache 2.0 License ([LICENSE](LICENSE)).
PORT=3005
DATABASE_URL=postgresql://root:password@localhost:5432/postgres?schema=attestation
ECSURL=http://localhost:9200/
ACCEPT_MEMBERSHIP_CREDENTIALS_CONFIG = AUTO
NATS_URL=nats://localhost:4222
AGENT_URL=http://localhost:3010
TSA_URL=https://gaiax.vereign.com/tsa/policy/policy/example
USE_AUTH=false
OAUTH_CLIENT_ID=clientid
OAUTH_CLIENT_SECRET=clientsecret
OAUTH_TOKEN_URL=https://tokenurl
\ No newline at end of file
# GDPR Compliance Document
The objective of this document is to detail, the data being stored and proccessed by the Organization Credential Manager's, Attestation Manger.
## What information is stored
### Source User Information
The Open Id connect claims that MAY contain all sorts of personal data (like email, name, age and others), are received from any external source.
### Technical User Information (Public)
- Schema information (public)
- Credential/credential definition ids and states
- DID of issuer
- DID of holder
- Created/updated dates
- Offered credential attributes and attachments
## How is the information stored
### Source User Information
Source User Information is encrypted using the Private Key of the Organizations SSI Agent and stored until the issuance of credential in Organization's SSI Agent's PostgreSQL database.
### Technical User Information (Public)
Technical User Information is encrypted using the Private Key of the Organizations SSI Agent and stored internally (on the agent) on PostgreSQL and externally/ metadata (shared between the OCM services) on PostgreSQL of Organization.
## Who can access the information
The Source User Information and Technical User Information both are accessible only by the Organization specific SSI agent's private key.
## How long will the information stay
### Source User Information
The Source User Information is wiped out once the credential is issued.
### Technical User Information (Public)
The Technical User Information is wiped out according to the retention periods (not defined yet).
This diff is collapsed.
# OCM Attestation Manager
## Description
<hr/>
The Attestation Manager is the microservice responsible for handling the features related to Issuance of Credentials. It handles REST endpoints for Schemas, Credential Definitions and Verifiable Credentials.
## Usage
<hr/>
### Swagger Documentation:
[Swagger/OpenAPI](swagger.json)
## Installation
<hr/>
### Pre-requisite
- pnpm
- docker
- docker-compose
- PostgreSQL
### OCM Services Dependencies
- SSI Abstraction
- Connection Manager
## Running the app
**Each service in the Organizational Credential Manager can be run from the infrastructure repository with Docker.**
**The .env files are in the infrastructure repository under /env**
```bash
## production in:
./deployment/ci
## development in:
./deployment/dev
```
- (optional) Edit docker-compose.yml in "infrastructure" to use either **/ci/** or **/dev/** Dockerfiles.
- Run while in **"infrastructure"** project:
```bash
$ docker-compose up --build attestation-m
```
to run only Attestation Manager or
```bash
$ docker-compose up --build
```
to run all the services.
## Build
```
pnpm build
```
## Run
```
pnpm start
```
### Environment Variables Required
```
1. PORT
2. DATABASE_URL
3. ECSURL
4. NATS_URL
5. AGENT_URL
```
### Outgoing communication services
```
1. SSI Abstraction
```
### Incomming communication services
```
1. Principal Manager
```
### Features supported
```
1. Create Schema
2. Create Credential Definition
3. Offer Credentials
4. Propose Credentials
5. Accept Credential
```
## Test
<hr/>
```bash
# unit tests
$ pnpm test
# e2e tests
$ pnpm test:e2e
# test coverage
$ pnpm test:cov
```
## GDPR
<hr/>
[GDPR](GDPR.md)
## Dependencies
<hr/>
[Dependencies](package.json)
## License
<hr/>
[Apache 2.0 license](LICENSE)
apiVersion: v1
appVersion: v1.0.4-rc
description: attestation-manager deployment
name: attestation-manager
version: 1.0.4
icon: 'https://www.vereign.com/wp-content/themes/vereign2020/images/vereign-logo.svg'
Deployment recipe for OCM attestation manager.
Copyright 2022 Vereign AG
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
# attestation-manager
![Version: 1.0.1](https://img.shields.io/badge/Version-1.0.1-informational?style=flat-square) ![AppVersion: v1.0.1-rc](https://img.shields.io/badge/AppVersion-v1.0.1--rc-informational?style=flat-square)
attestation-manager deployment
## Values
| Key | Type | Default | Description |
| ----------------------------------------------------------------- | ------ | ------------------------------------------------------- | -------------------------------------------------------------- |
| attestationManager.acceptMembershipCredentialsConfig | string | `"AUTO"` | |
| attestationManager.agent.host | string | `"ssi-abstraction"` | |
| attestationManager.agent.port | int | `3010` | |
| attestationManager.agent.protocol | string | `"http"` | |
| attestationManager.database.db | string | `"ocm_attestation_manager"` | |
| attestationManager.database.host | string | `"postgresql-postgresql-ha-postgresql.infra"` | |
| attestationManager.database.password | string | `"ocm_attestation_manager"` | |
| attestationManager.database.port | int | `5432` | |
| attestationManager.database.schema | string | `"attestation"` | |
| attestationManager.database.user | string | `"ocm_attestation_manager"` | |
| attestationManager.elastic.port | int | `9200` | |
| attestationManager.elastic.protocol | string | `"http"` | |
| attestationManager.elastic.url | string | `"elasticsearch"` | |
| attestationManager.nats.port | int | `4222` | |
| attestationManager.nats.protocol | string | `"nats"` | |
| attestationManager.nats.url | string | `"nats"` | |
| attestationManager.url.attestationManager | string | `"https://gaiax.vereign.com/ocm/attestation"` | |
| attestationManager.url.connectionManager | string | `"https://gaiax.vereign.com/ocm/connection"` | |
| attestationManager.url.tsa | string | `"https://gaiax.vereign.com/tsa/policy/policy/example"` | |
| autoscaling.enabled | bool | `false` | Enable autoscaling |
| autoscaling.maxReplicas | int | `3` | Maximum replicas |
| autoscaling.minReplicas | int | `1` | Minimum replicas |
| autoscaling.targetCPUUtilizationPercentage | int | `70` | CPU target for autoscaling trigger |
| autoscaling.targetMemoryUtilizationPercentage | int | `70` | Memory target for autoscaling trigger |
| image.name | string | `"gaiax/attestation-manager"` | Image name |
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy |
| image.pullSecrets | string | `"deployment-key-light"` | Image pull secret when internal image is used |
| image.repository | string | `"eu.gcr.io/vrgn-infra-prj"` | |
| image.sha | string | `""` | Image sha, usually generated by the CI Uses image.tag if empty |
| image.tag | string | `""` | Image tag Uses .Chart.AppVersion if empty |
| ingress.annotations."cert-manager.io/cluster-issuer" | string | `"letsencrypt-production-http"` | |
| ingress.annotations."kubernetes.io/ingress.class" | string | `"nginx"` | |
| ingress.annotations."kubernetes.io/ingress.global-static-ip-name" | string | `"dev-light-public"` | |
| ingress.annotations."nginx.ingress.kubernetes.io/rewrite-target" | string | `"/$2"` | |
| ingress.enabled | bool | `true` | |
| ingress.frontendDomain | string | `"gaiax.vereign.com"` | |
| ingress.frontendTlsSecretName | string | `"cert-manager-tls"` | |
| ingress.tlsEnabled | bool | `true` | |
| log.encoding | string | `"json"` | |
| log.level | string | `"INFO"` | |
| metrics.enabled | bool | `true` | Enable prometheus metrics |
| metrics.port | int | `2112` | Port for prometheus metrics |
| name | string | `"ssi-abstraction"` | Application name |
| nameOverride | string | `""` | Ovverwrites application name |
| podAnnotations | object | `{}` | |
| replicaCount | int | `1` | Default number of instances to start |
| resources.limits.cpu | string | `"150m"` | |
| resources.limits.memory | string | `"128Mi"` | |
| resources.requests.cpu | string | `"25m"` | |
| resources.requests.memory | string | `"64Mi"` | |
| security.runAsGid | int | `0` | Group used by the apps |
| security.runAsNonRoot | bool | `false` | by default, apps run as non-root |
| security.runAsUid | int | `0` | User used by the apps |
| service.port | int | `3005` | |
---
Autogenerated from chart metadata using [helm-docs v1.10.0](https://github.com/norwoodj/helm-docs/releases/v1.10.0)
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "app.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create a fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "app.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" $name .Release.Namespace | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create instance name based on app version and short image sha.
*/}}
{{- define "app.revision" -}}
{{- default .Release.Name .Values.appRel | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "app.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Common labels
*/}}
{{- define "app.labels" -}}
helm.sh/chart: {{ include "app.chart" . }}
{{ include "app.selectorLabels" . }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}
{{/*
Selector labels
*/}}
{{- define "app.selectorLabels" -}}
app.kubernetes.io/name: {{ include "app.name" . }}
app.kubernetes.io/component: {{ include "app.fullname" . }}
{{- end -}}
{{/*
Metrics Annotations
*/}}
{{- define "app.metricsAnnotations" -}}
{{- if .Values.metrics.enabled -}}
prometheus.io/scrape: "true"
prometheus.io/port: "{{ .Values.metrics.port }}"
prometheus.io/path: {{ .Values.metrics.path | default "/metrics" | quote }}
{{- end -}}
{{- end -}}
{{/*
Image string
*/}}
{{- define "app.image" -}}
{{- if .Values.image.sha -}}
{{ .Values.image.repository }}/{{ .Values.image.name }}@{{ .Values.image.sha }}
{{- else -}}
{{ .Values.image.repository }}/{{ .Values.image.name }}:{{ default .Chart.AppVersion .Values.image.tag }}
{{- end -}}
{{- end -}}
{{/*
Security context
*/}}
{{- define "app.securitycontext" -}}
runAsNonRoot: {{ .Values.security.runAsNonRoot | default false }}
runAsGroup: {{ .Values.security.runAsGid | default 0 }}
runAsUser: {{ .Values.security.runAsUid | default 0 }}
fsGroup: {{ .Values.security.runAsGid | default 0 }}
{{- end -}}
{{/*
PostgreSQL Connection string URI
*/}}
{{- define "app.postgresql.connectionstring" -}}
postgresql://{{ .Values.attestationManager.database.user }}:{{ .Values.attestationManager.database.password }}@{{ .Values.attestationManager.database.host }}:{{ .Values.attestationManager.database.port }}/{{ .Release.Namespace }}_{{ include "app.name" . | replace "-" "_" }}?schema={{ .Values.attestationManager.database.schema }}
{{- end -}}
{{/*
Ingress custom path.
*/}}
{{- define "app.path" -}}
{{- default .Chart.Name .Values.ingress.pathOverride | replace "-manager" "" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: "{{ template "app.name" . }}"
namespace: {{ .Release.Namespace }}
labels:
{{- include "app.labels" . | nindent 4 }}
app.kubernetes.io/instance: {{ include "app.revision" . }}
app.kubernetes.io/part-of: rse
spec:
replicas: {{ .Values.replicaCount }}
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
selector:
matchLabels:
{{- include "app.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "app.labels" . | nindent 8 }}
annotations:
{{- include "app.metricsAnnotations" . | nindent 8 }}
{{- if .Values.podAnnotations }}
{{ toYaml .Values.podAnnotations | indent 8 }}
{{- end }}
spec:
securityContext:
{{- include "app.securitycontext" . | nindent 8 }}
imagePullSecrets:
- name: {{ .Values.image.pullSecrets }}
containers:
- name: {{ template "app.name" . }}
image: "{{ .Values.image.repository }}/{{ .Values.image.name }}:{{ default .Chart.AppVersion .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
env:
- name: PORT
value: {{ .Values.service.port | quote }}
- name: DATABASE_URL
value: {{ template "app.postgresql.connectionstring" (merge (dict "application" "true") .) }}
- name: NATS_URL
value: "{{ .Values.attestationManager.nats.protocol }}://{{ .Values.attestationManager.nats.url }}:{{ .Values.attestationManager.nats.port }}"
- name: ECSURL
value: "{{ .Values.attestationManager.elastic.protocol }}://{{ .Values.attestationManager.elastic.url }}:{{ .Values.attestationManager.elastic.port }}/"
- name: LOG_LEVEL
value: {{ .Values.log.level | default "INFO" }}
- name: LOG_ENCODING
value: {{ .Values.log.encoding | default "json" }}
- name: AGENT_URL
value: "{{ .Values.attestationManager.agent.protocol }}://{{ .Values.attestationManager.agent.host }}:{{ .Values.attestationManager.agent.port }}"
- name: ACCEPT_MEMBERSHIP_CREDENTIALS_CONFIG
value: {{ .Values.attestationManager.acceptMembershipCredentialsConfig }}
- name: TSA_URL
value: {{ .Values.attestationManager.url.tsa }}
- name: CONNECTION_MANAGER_URL
value: {{ .Values.attestationManager.url.connectionManager }}
- name: ATTESTATION_MANAGER_URL
value: {{ .Values.attestationManager.url.attestationManager }}
{{- if .Values.extraVars }}
{{ toYaml .Values.extraVars | indent 8 }}
{{- end }}
ports:
{{- if .Values.metrics.enabled }}
- name: monitoring
containerPort: {{ .Values.metrics.port }}
{{- end }}
- name: http
containerPort: {{ .Values.service.port }}
readinessProbe:
httpGet:
path: /v1/health
port: {{ .Values.service.port }}
initialDelaySeconds: 5
periodSeconds: 5
successThreshold: 2
failureThreshold: 2
timeoutSeconds: 5
resources:
{{ toYaml .Values.resources | indent 10 }}
{{- if .Values.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ template "app.path" . }}
namespace: {{ .Release.Namespace }}
annotations:
{{ toYaml .Values.ingress.annotations | indent 4 }}
labels:
{{- include "app.labels" . | nindent 4 }}
spec:
{{- if .Values.ingress.tlsEnabled }}
tls:
- hosts:
- {{ .Values.ingress.frontendDomain }}
secretName: {{ .Values.ingress.frontendTlsSecretName }}
{{- end }}
rules:
- host: {{ .Values.ingress.frontendDomain }}
http:
paths:
- path: /{{ template "app.path" . }}(/|$)(.*)
pathType: Prefix
backend:
service:
name: {{ template "app.name" . }}
port:
number: {{ .Values.service.port }}
{{- end }}
\ No newline at end of file
apiVersion: v1
kind: Service
metadata:
name: { { template "app.name" . } }
namespace: { { .Release.Namespace } }
labels: { { - include "app.labels" . | nindent 4 } }
spec:
clusterIP: None
ports:
- name: http
port: { { .Values.service.port } }
targetPort: { { .Values.service.port } }
selector: { { - include "app.selectorLabels" . | nindent 4 } }