feat: add platform deployment artifacts

This commit is contained in:
2026-03-13 16:01:40 +00:00
parent cae1f5b259
commit 5a03613090
8 changed files with 593 additions and 0 deletions

86
catalog-info.yaml Normal file
View File

@@ -0,0 +1,86 @@
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
annotations:
backstage.io/kubernetes-label-selector: app=test-siva-node-1
backstage.io/kubernetes-namespace: dev
backstage.io/techdocs-ref: dir:.
gitea.kyndemo.live/repo-slug: demo-platform/test-siva-node-1
grafana/alert-label-selector: app=test-siva-node-1
grafana/dashboard-selector: uid == 'app-test-siva-node-1'
grafana/grafana-instance: default
humanitec.dev/orgId: skillful-wild-chicken-2617
humanitec.dev/projectId: test-siva-node-1
prometheus.io/path: /metrics
prometheus.io/port: '3000'
prometheus.io/scrape: 'true'
description: Modernized test-siva-node-1 service
links:
- icon: web
title: Live API
url: https://test-siva-node-1.kyndemo.live
- icon: code
title: API Specification
url: https://gitea.kyndemo.live/demo-platform/test-siva-node-1/raw/branch/main/openapi.yaml
- icon: github
title: Source Repository
url: https://gitea.kyndemo.live/demo-platform/test-siva-node-1
- icon: dashboard
title: Humanitec Console
url: https://console.humanitec.dev/orgs/skillful-wild-chicken-2617/projects/test-siva-node-1/environments/dev
- icon: code
title: CI/CD Pipelines
url: https://gitea.kyndemo.live/demo-platform/test-siva-node-1/actions
- icon: dashboard
title: Grafana Dashboard
url: https://grafana.kyndemo.live/d/app-test-siva-node-1
name: test-siva-node-1
tags:
- nodejs
- express
- golden-path
- humanitec-v2
- platform-orchestrator
- score
spec:
lifecycle: production
owner: group:default/platform-engineering
providesApis:
- api:default/test-siva-node-1-api
system: test-siva-node-1-system
type: service
---
apiVersion: backstage.io/v1alpha1
kind: System
metadata:
annotations:
humanitec.dev/orgId: skillful-wild-chicken-2617
humanitec.dev/projectId: test-siva-node-1
description: System grouping for the test-siva-node-1 application
name: test-siva-node-1-system
spec:
domain: platform
owner: group:default/platform-engineering
---
apiVersion: backstage.io/v1alpha1
kind: API
metadata:
annotations:
backstage.io/techdocs-ref: dir:.
gitea.kyndemo.live/repo-slug: demo-platform/test-siva-node-1
description: OpenAPI definition for test-siva-node-1
name: test-siva-node-1-api
tags:
- nodejs
- express
- golden-path
- humanitec-v2
- platform-orchestrator
- score
spec:
definition:
$text: https://gitea.kyndemo.live/demo-platform/test-siva-node-1/raw/branch/main/openapi.yaml
lifecycle: production
owner: group:default/platform-engineering
system: test-siva-node-1-system
type: openapi

25
docs/api.md Normal file
View File

@@ -0,0 +1,25 @@
# API Reference
## Endpoints
### Health Check
```
GET /health
```
**Response:**
```json
{"status": "UP", "service": "test-siva-node-1"}
```
### Root
```
GET /
```
**Response:**
```json
{"service": "test-siva-node-1", "description": "Modernized test-siva-node-1 service", "version": "1.0.0"}
```

15
docs/architecture.md Normal file
View File

@@ -0,0 +1,15 @@
# Architecture
## Service Design
test-siva-node-1 is a microservice following cloud-native patterns.
## Technology Stack
- **Runtime**: Node.js Express
- **Deployment**: Humanitec Platform Orchestrator
- **CI/CD**: Gitea Actions → ACR → Humanitec
## Dependencies
See `score.yaml` for external resource dependencies.

32
docs/index.md Normal file
View File

@@ -0,0 +1,32 @@
# test-siva-node-1
Modernized test-siva-node-1 service
## Overview
This service is built with **Node.js Express** and follows the Golden Path architecture patterns.
### Key Features
- 🚀 Production-ready configuration
- 📊 Prometheus metrics exposed
- 🏥 Health check endpoints
- 🔒 Security scanning in CI/CD
- 📦 Containerized deployment
## Quick Start
```bash
git clone https://gitea.kyndemo.live/kyndryl-demos/test-siva-node-1.git
cd test-siva-node-1
```
## Monitoring
- **Metrics**: Prometheus metrics at `/metrics`
- **Health**: `/health`
- **Grafana**: [View Dashboard](https://grafana.kyndemo.live/d/app-test-siva-node-1)
## Support
Contact the Platform Engineering team.

43
docs/migration-plan.md Normal file
View File

@@ -0,0 +1,43 @@
# Modernization Plan for test-siva-node-1
## Application Type
Nodejs Application
## Selected Modernization Strategy
- **Migration Approach**: containerize-optimize
- **Target Platform**: kubernetes-humanitec
- **Observability**: ENABLED (Prometheus metrics, health checks, tracing)
- **Security Scanning**: ENABLED (Trivy vulnerability scanning)
## Discovery Summary
### Discovery Report for Application at `/tmp/modernize_cd6dtzap`
#### Application Overview
The application appears to be a Node.js-based project, as indicated by the presence of `package.json`, `tsconfig.json`, and other TypeScript configuration files. It uses Express.js as the web framework, suggesting it is likely a server-side application.
#### Technology Stack
- **Programming Language:** TypeScript
- **Framework:** Express.js
- **Build Tools:** Node.js and npm
- **Configuration Files:**
...
## Generated Artifacts
1. **Dockerfile**: Optimized with health checks and metrics endpoints
2. **score.yaml**: Platform-agnostic environment intent optimized for kubernetes-humanitec with Prometheus metrics resources
3. **CI Workflow**: Automated build/push to ACR with Trivy security scanning
## Next Steps
1. Review and customize generated artifacts
2. Test container build and run
3. Deploy to development environment using score.yaml
4. Validate application functionality
5. Promote to staging/production via Humanitec
## Migration Strategy Details
### Containerize Optimize
Add cloud-native patterns: health checks, metrics, optimized base images.
### Platform: kubernetes-humanitec
score.yaml is the single environment intent. Use Humanitec Platform Orchestrator for deployment.

13
mkdocs.yml Normal file
View File

@@ -0,0 +1,13 @@
site_name: test-siva-node-1
site_description: Modernized test-siva-node-1 service
nav:
- Home: index.md
- Architecture: architecture.md
- API Reference: api.md
plugins:
- techdocs-core
theme:
name: material

350
openapi.yaml Normal file
View File

@@ -0,0 +1,350 @@
openapi: 3.0.3
info:
title: test-siva-node-1
description: Modernized test-siva-node-1 service
version: 1.0.0
servers:
- url: https://test-siva-node-1.kyndemo.live
description: Production
- url: http://localhost:3000
description: Local development
paths:
/health:
get:
summary: Health check
operationId: getHealth
tags:
- System
responses:
'200':
description: Healthy
/api/articles:
get:
summary: GET /api/articles
operationId: getApi_articles
responses:
'200':
description: Success
'400':
description: Bad request
'401':
description: Unauthorized
post:
summary: POST /api/articles
operationId: postApi_articles
responses:
'200':
description: Success
'400':
description: Bad request
'401':
description: Unauthorized
requestBody:
required: true
content:
application/json:
schema:
type: object
/api/articles/feed:
get:
summary: GET /api/articles/feed
operationId: getApi_articles_feed
responses:
'200':
description: Success
'400':
description: Bad request
'401':
description: Unauthorized
/api/articles/{slug}:
get:
summary: GET /api/articles/{slug}
operationId: getApi_articles_slug
responses:
'200':
description: Success
'400':
description: Bad request
'401':
description: Unauthorized
parameters:
- name: slug
in: path
required: true
schema:
type: string
put:
summary: PUT /api/articles/{slug}
operationId: putApi_articles_slug
responses:
'200':
description: Success
'400':
description: Bad request
'401':
description: Unauthorized
parameters:
- name: slug
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
type: object
delete:
summary: DELETE /api/articles/{slug}
operationId: deleteApi_articles_slug
responses:
'200':
description: Success
'400':
description: Bad request
'401':
description: Unauthorized
parameters:
- name: slug
in: path
required: true
schema:
type: string
/api/articles/{slug}/comments:
get:
summary: GET /api/articles/{slug}/comments
operationId: getApi_articles_slug_comments
responses:
'200':
description: Success
'400':
description: Bad request
'401':
description: Unauthorized
parameters:
- name: slug
in: path
required: true
schema:
type: string
post:
summary: POST /api/articles/{slug}/comments
operationId: postApi_articles_slug_comments
responses:
'200':
description: Success
'400':
description: Bad request
'401':
description: Unauthorized
parameters:
- name: slug
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
type: object
/api/articles/{slug}/comments/{id}:
delete:
summary: DELETE /api/articles/{slug}/comments/{id}
operationId: deleteApi_articles_slug_comments_id
responses:
'200':
description: Success
'400':
description: Bad request
'401':
description: Unauthorized
parameters:
- name: slug
in: path
required: true
schema:
type: string
- name: id
in: path
required: true
schema:
type: string
/api/articles/{slug}/favorite:
post:
summary: POST /api/articles/{slug}/favorite
operationId: postApi_articles_slug_favorite
responses:
'200':
description: Success
'400':
description: Bad request
'401':
description: Unauthorized
parameters:
- name: slug
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
type: object
delete:
summary: DELETE /api/articles/{slug}/favorite
operationId: deleteApi_articles_slug_favorite
responses:
'200':
description: Success
'400':
description: Bad request
'401':
description: Unauthorized
parameters:
- name: slug
in: path
required: true
schema:
type: string
/api/profiles/{username}:
get:
summary: GET /api/profiles/{username}
operationId: getApi_profiles_username
responses:
'200':
description: Success
'400':
description: Bad request
'401':
description: Unauthorized
parameters:
- name: username
in: path
required: true
schema:
type: string
/api/profiles/{username}/follow:
post:
summary: POST /api/profiles/{username}/follow
operationId: postApi_profiles_username_follow
responses:
'200':
description: Success
'400':
description: Bad request
'401':
description: Unauthorized
parameters:
- name: username
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
type: object
delete:
summary: DELETE /api/profiles/{username}/follow
operationId: deleteApi_profiles_username_follow
responses:
'200':
description: Success
'400':
description: Bad request
'401':
description: Unauthorized
parameters:
- name: username
in: path
required: true
schema:
type: string
/api/tags:
get:
summary: GET /api/tags
operationId: getApi_tags
responses:
'200':
description: Success
'400':
description: Bad request
'401':
description: Unauthorized
/api/user:
get:
summary: GET /api/user
operationId: getApi_user
responses:
'200':
description: Success
'400':
description: Bad request
'401':
description: Unauthorized
put:
summary: PUT /api/user
operationId: putApi_user
responses:
'200':
description: Success
'400':
description: Bad request
'401':
description: Unauthorized
requestBody:
required: true
content:
application/json:
schema:
type: object
/api/users:
post:
summary: POST /api/users
operationId: postApi_users
responses:
'200':
description: Success
'400':
description: Bad request
'401':
description: Unauthorized
requestBody:
required: true
content:
application/json:
schema:
type: object
/api/users/login:
post:
summary: POST /api/users/login
operationId: postApi_users_login
responses:
'200':
description: Success
'400':
description: Bad request
'401':
description: Unauthorized
requestBody:
required: true
content:
application/json:
schema:
type: object
/metrics:
get:
summary: Prometheus metrics
operationId: getMetrics
tags:
- System
responses:
'200':
description: text/plain; Prometheus exposition format

29
score.yaml Normal file
View File

@@ -0,0 +1,29 @@
apiVersion: score.dev/v1b1
containers:
test-siva-node-1:
image: .
variables:
DATABASE_URL: postgresql://${resources.db.username}:${resources.db.password}@${resources.db.host}:${resources.db.port}/${resources.db.name}
NODE_ENV: production
PORT: '3000'
metadata:
annotations:
prometheus.io/path: /metrics
prometheus.io/port: '3000'
prometheus.io/scrape: 'true'
labels:
app: test-siva-node-1
backstage.io/kubernetes-id: test-siva-node-1
name: test-siva-node-1
resources:
db:
type: postgres
dns:
type: dns
env:
type: environment
service:
ports:
http:
port: 3000
targetPort: 3000