iec-cli 0.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +159 -0
- package/dist/commands/backup.d.ts +11 -0
- package/dist/commands/backup.d.ts.map +1 -0
- package/dist/commands/backup.js +112 -0
- package/dist/commands/backup.js.map +1 -0
- package/dist/commands/config.d.ts +28 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +190 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/deploy.d.ts +16 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +235 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/destroy.d.ts +12 -0
- package/dist/commands/destroy.d.ts.map +1 -0
- package/dist/commands/destroy.js +62 -0
- package/dist/commands/destroy.js.map +1 -0
- package/dist/commands/domains.d.ts +36 -0
- package/dist/commands/domains.d.ts.map +1 -0
- package/dist/commands/domains.js +323 -0
- package/dist/commands/domains.js.map +1 -0
- package/dist/commands/env.d.ts +7 -0
- package/dist/commands/env.d.ts.map +1 -0
- package/dist/commands/env.js +42 -0
- package/dist/commands/env.js.map +1 -0
- package/dist/commands/git.d.ts +32 -0
- package/dist/commands/git.d.ts.map +1 -0
- package/dist/commands/git.js +340 -0
- package/dist/commands/git.js.map +1 -0
- package/dist/commands/init-ai.d.ts +7 -0
- package/dist/commands/init-ai.d.ts.map +1 -0
- package/dist/commands/init-ai.js +257 -0
- package/dist/commands/init-ai.js.map +1 -0
- package/dist/commands/init.d.ts +8 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +228 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/link.d.ts +10 -0
- package/dist/commands/link.d.ts.map +1 -0
- package/dist/commands/link.js +193 -0
- package/dist/commands/link.js.map +1 -0
- package/dist/commands/login.d.ts +16 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +468 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/logs.d.ts +16 -0
- package/dist/commands/logs.d.ts.map +1 -0
- package/dist/commands/logs.js +362 -0
- package/dist/commands/logs.js.map +1 -0
- package/dist/commands/oauth.d.ts +33 -0
- package/dist/commands/oauth.d.ts.map +1 -0
- package/dist/commands/oauth.js +181 -0
- package/dist/commands/oauth.js.map +1 -0
- package/dist/commands/preflight.d.ts +8 -0
- package/dist/commands/preflight.d.ts.map +1 -0
- package/dist/commands/preflight.js +190 -0
- package/dist/commands/preflight.js.map +1 -0
- package/dist/commands/program.d.ts +7 -0
- package/dist/commands/program.d.ts.map +1 -0
- package/dist/commands/program.js +59 -0
- package/dist/commands/program.js.map +1 -0
- package/dist/commands/programs.d.ts +7 -0
- package/dist/commands/programs.d.ts.map +1 -0
- package/dist/commands/programs.js +42 -0
- package/dist/commands/programs.js.map +1 -0
- package/dist/commands/push.d.ts +12 -0
- package/dist/commands/push.d.ts.map +1 -0
- package/dist/commands/push.js +166 -0
- package/dist/commands/push.js.map +1 -0
- package/dist/commands/register-scaffold.test.d.ts +2 -0
- package/dist/commands/register-scaffold.test.d.ts.map +1 -0
- package/dist/commands/register-scaffold.test.js +291 -0
- package/dist/commands/register-scaffold.test.js.map +1 -0
- package/dist/commands/register.d.ts +7 -0
- package/dist/commands/register.d.ts.map +1 -0
- package/dist/commands/register.js +304 -0
- package/dist/commands/register.js.map +1 -0
- package/dist/commands/rollback.d.ts +11 -0
- package/dist/commands/rollback.d.ts.map +1 -0
- package/dist/commands/rollback.js +147 -0
- package/dist/commands/rollback.js.map +1 -0
- package/dist/commands/sample.d.ts +15 -0
- package/dist/commands/sample.d.ts.map +1 -0
- package/dist/commands/sample.js +312 -0
- package/dist/commands/sample.js.map +1 -0
- package/dist/commands/scopes.d.ts +29 -0
- package/dist/commands/scopes.d.ts.map +1 -0
- package/dist/commands/scopes.js +203 -0
- package/dist/commands/scopes.js.map +1 -0
- package/dist/commands/services.d.ts +13 -0
- package/dist/commands/services.d.ts.map +1 -0
- package/dist/commands/services.js +95 -0
- package/dist/commands/services.js.map +1 -0
- package/dist/commands/settings.d.ts +10 -0
- package/dist/commands/settings.d.ts.map +1 -0
- package/dist/commands/settings.js +41 -0
- package/dist/commands/settings.js.map +1 -0
- package/dist/commands/signup.d.ts +9 -0
- package/dist/commands/signup.d.ts.map +1 -0
- package/dist/commands/signup.js +192 -0
- package/dist/commands/signup.js.map +1 -0
- package/dist/commands/status.d.ts +9 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +170 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/troubleshoot.d.ts +19 -0
- package/dist/commands/troubleshoot.d.ts.map +1 -0
- package/dist/commands/troubleshoot.js +465 -0
- package/dist/commands/troubleshoot.js.map +1 -0
- package/dist/commands/update.d.ts +6 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +64 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/commands/user.d.ts +17 -0
- package/dist/commands/user.d.ts.map +1 -0
- package/dist/commands/user.js +126 -0
- package/dist/commands/user.js.map +1 -0
- package/dist/commands/versions.d.ts +16 -0
- package/dist/commands/versions.d.ts.map +1 -0
- package/dist/commands/versions.js +116 -0
- package/dist/commands/versions.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +556 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/__tests__/scaffold-integration.test.d.ts +2 -0
- package/dist/lib/__tests__/scaffold-integration.test.d.ts.map +1 -0
- package/dist/lib/__tests__/scaffold-integration.test.js +321 -0
- package/dist/lib/__tests__/scaffold-integration.test.js.map +1 -0
- package/dist/lib/ai/client.d.ts +39 -0
- package/dist/lib/ai/client.d.ts.map +1 -0
- package/dist/lib/ai/client.js +236 -0
- package/dist/lib/ai/client.js.map +1 -0
- package/dist/lib/ai/generator.d.ts +17 -0
- package/dist/lib/ai/generator.d.ts.map +1 -0
- package/dist/lib/ai/generator.js +338 -0
- package/dist/lib/ai/generator.js.map +1 -0
- package/dist/lib/ai/prompts.d.ts +47 -0
- package/dist/lib/ai/prompts.d.ts.map +1 -0
- package/dist/lib/ai/prompts.js +247 -0
- package/dist/lib/ai/prompts.js.map +1 -0
- package/dist/lib/ai/scanner.d.ts +50 -0
- package/dist/lib/ai/scanner.d.ts.map +1 -0
- package/dist/lib/ai/scanner.js +237 -0
- package/dist/lib/ai/scanner.js.map +1 -0
- package/dist/lib/api.d.ts +18 -0
- package/dist/lib/api.d.ts.map +1 -0
- package/dist/lib/api.js +67 -0
- package/dist/lib/api.js.map +1 -0
- package/dist/lib/auto-register.d.ts +12 -0
- package/dist/lib/auto-register.d.ts.map +1 -0
- package/dist/lib/auto-register.js +42 -0
- package/dist/lib/auto-register.js.map +1 -0
- package/dist/lib/bio.d.ts +90 -0
- package/dist/lib/bio.d.ts.map +1 -0
- package/dist/lib/bio.js +247 -0
- package/dist/lib/bio.js.map +1 -0
- package/dist/lib/builder.d.ts +65 -0
- package/dist/lib/builder.d.ts.map +1 -0
- package/dist/lib/builder.js +192 -0
- package/dist/lib/builder.js.map +1 -0
- package/dist/lib/catalog.d.ts +3 -0
- package/dist/lib/catalog.d.ts.map +1 -0
- package/dist/lib/catalog.js +17 -0
- package/dist/lib/catalog.js.map +1 -0
- package/dist/lib/config.d.ts +20 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +124 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/forgejo.d.ts +188 -0
- package/dist/lib/forgejo.d.ts.map +1 -0
- package/dist/lib/forgejo.js +305 -0
- package/dist/lib/forgejo.js.map +1 -0
- package/dist/lib/output.d.ts +12 -0
- package/dist/lib/output.d.ts.map +1 -0
- package/dist/lib/output.js +39 -0
- package/dist/lib/output.js.map +1 -0
- package/dist/lib/scaffold.d.ts +30 -0
- package/dist/lib/scaffold.d.ts.map +1 -0
- package/dist/lib/scaffold.js +180 -0
- package/dist/lib/scaffold.js.map +1 -0
- package/dist/lib/scope-requests.d.ts +17 -0
- package/dist/lib/scope-requests.d.ts.map +1 -0
- package/dist/lib/scope-requests.js +78 -0
- package/dist/lib/scope-requests.js.map +1 -0
- package/dist/lib/scope-requests.test.d.ts +2 -0
- package/dist/lib/scope-requests.test.d.ts.map +1 -0
- package/dist/lib/scope-requests.test.js +239 -0
- package/dist/lib/scope-requests.test.js.map +1 -0
- package/dist/lib/troubleshoot/analyzer.d.ts +14 -0
- package/dist/lib/troubleshoot/analyzer.d.ts.map +1 -0
- package/dist/lib/troubleshoot/analyzer.js +541 -0
- package/dist/lib/troubleshoot/analyzer.js.map +1 -0
- package/dist/lib/troubleshoot/auto-fix.d.ts +29 -0
- package/dist/lib/troubleshoot/auto-fix.d.ts.map +1 -0
- package/dist/lib/troubleshoot/auto-fix.js +373 -0
- package/dist/lib/troubleshoot/auto-fix.js.map +1 -0
- package/dist/lib/troubleshoot/index.d.ts +5 -0
- package/dist/lib/troubleshoot/index.d.ts.map +1 -0
- package/dist/lib/troubleshoot/index.js +6 -0
- package/dist/lib/troubleshoot/index.js.map +1 -0
- package/dist/lib/troubleshoot/log-fetcher.d.ts +43 -0
- package/dist/lib/troubleshoot/log-fetcher.d.ts.map +1 -0
- package/dist/lib/troubleshoot/log-fetcher.js +431 -0
- package/dist/lib/troubleshoot/log-fetcher.js.map +1 -0
- package/dist/lib/troubleshoot/redactor.d.ts +35 -0
- package/dist/lib/troubleshoot/redactor.d.ts.map +1 -0
- package/dist/lib/troubleshoot/redactor.js +208 -0
- package/dist/lib/troubleshoot/redactor.js.map +1 -0
- package/dist/lib/validators/catalog-schemas.d.ts +59 -0
- package/dist/lib/validators/catalog-schemas.d.ts.map +1 -0
- package/dist/lib/validators/catalog-schemas.js +32 -0
- package/dist/lib/validators/catalog-schemas.js.map +1 -0
- package/dist/lib/validators/catalog-validator.d.ts +3 -0
- package/dist/lib/validators/catalog-validator.d.ts.map +1 -0
- package/dist/lib/validators/catalog-validator.js +247 -0
- package/dist/lib/validators/catalog-validator.js.map +1 -0
- package/dist/lib/validators/catalog-validator.test.d.ts +2 -0
- package/dist/lib/validators/catalog-validator.test.d.ts.map +1 -0
- package/dist/lib/validators/catalog-validator.test.js +420 -0
- package/dist/lib/validators/catalog-validator.test.js.map +1 -0
- package/dist/lib/validators/dockerfile-validator.d.ts +5 -0
- package/dist/lib/validators/dockerfile-validator.d.ts.map +1 -0
- package/dist/lib/validators/dockerfile-validator.js +295 -0
- package/dist/lib/validators/dockerfile-validator.js.map +1 -0
- package/dist/lib/validators/dockerfile-validator.test.d.ts +2 -0
- package/dist/lib/validators/dockerfile-validator.test.d.ts.map +1 -0
- package/dist/lib/validators/dockerfile-validator.test.js +161 -0
- package/dist/lib/validators/dockerfile-validator.test.js.map +1 -0
- package/dist/lib/validators/env-validator.d.ts +3 -0
- package/dist/lib/validators/env-validator.d.ts.map +1 -0
- package/dist/lib/validators/env-validator.js +268 -0
- package/dist/lib/validators/env-validator.js.map +1 -0
- package/dist/lib/validators/git-validator.d.ts +3 -0
- package/dist/lib/validators/git-validator.d.ts.map +1 -0
- package/dist/lib/validators/git-validator.js +236 -0
- package/dist/lib/validators/git-validator.js.map +1 -0
- package/dist/lib/validators/health-detector.d.ts +4 -0
- package/dist/lib/validators/health-detector.d.ts.map +1 -0
- package/dist/lib/validators/health-detector.js +172 -0
- package/dist/lib/validators/health-detector.js.map +1 -0
- package/dist/lib/validators/health-detector.test.d.ts +2 -0
- package/dist/lib/validators/health-detector.test.d.ts.map +1 -0
- package/dist/lib/validators/health-detector.test.js +118 -0
- package/dist/lib/validators/health-detector.test.js.map +1 -0
- package/dist/lib/validators/index.d.ts +8 -0
- package/dist/lib/validators/index.d.ts.map +1 -0
- package/dist/lib/validators/index.js +8 -0
- package/dist/lib/validators/index.js.map +1 -0
- package/dist/lib/validators/route-validator.d.ts +3 -0
- package/dist/lib/validators/route-validator.d.ts.map +1 -0
- package/dist/lib/validators/route-validator.js +238 -0
- package/dist/lib/validators/route-validator.js.map +1 -0
- package/dist/lib/validators/scope-validator.d.ts +3 -0
- package/dist/lib/validators/scope-validator.d.ts.map +1 -0
- package/dist/lib/validators/scope-validator.js +141 -0
- package/dist/lib/validators/scope-validator.js.map +1 -0
- package/dist/lib/watch.d.ts +35 -0
- package/dist/lib/watch.d.ts.map +1 -0
- package/dist/lib/watch.js +171 -0
- package/dist/lib/watch.js.map +1 -0
- package/dist/templates/api/.env.example +15 -0
- package/dist/templates/api/Dockerfile +45 -0
- package/dist/templates/api/README.md +85 -0
- package/dist/templates/api/catalog-info.yaml +22 -0
- package/dist/templates/api/gitignore +31 -0
- package/dist/templates/api/helm/{{name}}/Chart.yaml +9 -0
- package/dist/templates/api/helm/{{name}}/templates/deployment.yaml +72 -0
- package/dist/templates/api/helm/{{name}}/templates/ingress.yaml +43 -0
- package/dist/templates/api/helm/{{name}}/templates/service.yaml +17 -0
- package/dist/templates/api/helm/{{name}}/values.yaml +64 -0
- package/dist/templates/api/package.json +33 -0
- package/dist/templates/api/src/index.ts +61 -0
- package/dist/templates/api/src/routes/example.ts +165 -0
- package/dist/templates/api/tsconfig.json +18 -0
- package/dist/templates/crosspod/README.md +87 -0
- package/dist/templates/crosspod/service-a/Dockerfile +27 -0
- package/dist/templates/crosspod/service-a/catalog-info.yaml +54 -0
- package/dist/templates/crosspod/service-a/gitignore +5 -0
- package/dist/templates/crosspod/service-a/helm/{{name}}-service-a/Chart.yaml +6 -0
- package/dist/templates/crosspod/service-a/helm/{{name}}-service-a/templates/deployment.yaml +72 -0
- package/dist/templates/crosspod/service-a/helm/{{name}}-service-a/templates/ingress.yaml +43 -0
- package/dist/templates/crosspod/service-a/helm/{{name}}-service-a/templates/service.yaml +17 -0
- package/dist/templates/crosspod/service-a/helm/{{name}}-service-a/values.yaml +44 -0
- package/dist/templates/crosspod/service-a/package.json +29 -0
- package/dist/templates/crosspod/service-a/src/index.ts +89 -0
- package/dist/templates/crosspod/service-a/tsconfig.json +14 -0
- package/dist/templates/crosspod/service-b/Dockerfile +27 -0
- package/dist/templates/crosspod/service-b/catalog-info.yaml +27 -0
- package/dist/templates/crosspod/service-b/gitignore +5 -0
- package/dist/templates/crosspod/service-b/helm/{{name}}-service-b/Chart.yaml +6 -0
- package/dist/templates/crosspod/service-b/helm/{{name}}-service-b/templates/deployment.yaml +72 -0
- package/dist/templates/crosspod/service-b/helm/{{name}}-service-b/templates/ingress.yaml +43 -0
- package/dist/templates/crosspod/service-b/helm/{{name}}-service-b/templates/service.yaml +17 -0
- package/dist/templates/crosspod/service-b/helm/{{name}}-service-b/values.yaml +47 -0
- package/dist/templates/crosspod/service-b/package.json +26 -0
- package/dist/templates/crosspod/service-b/src/index.ts +143 -0
- package/dist/templates/crosspod/service-b/tsconfig.json +14 -0
- package/dist/templates/mga/{{name}}-api/.env.example +5 -0
- package/dist/templates/mga/{{name}}-api/Dockerfile +45 -0
- package/dist/templates/mga/{{name}}-api/catalog-info.yaml +44 -0
- package/dist/templates/mga/{{name}}-api/gitignore +31 -0
- package/dist/templates/mga/{{name}}-api/helm/{{name}}-api/Chart.yaml +9 -0
- package/dist/templates/mga/{{name}}-api/helm/{{name}}-api/templates/deployment.yaml +72 -0
- package/dist/templates/mga/{{name}}-api/helm/{{name}}-api/templates/ingress.yaml +43 -0
- package/dist/templates/mga/{{name}}-api/helm/{{name}}-api/templates/service.yaml +17 -0
- package/dist/templates/mga/{{name}}-api/helm/{{name}}-api/values.yaml +65 -0
- package/dist/templates/mga/{{name}}-api/package.json +37 -0
- package/dist/templates/mga/{{name}}-api/src/index.ts +82 -0
- package/dist/templates/mga/{{name}}-api/src/lib/mongo.ts +19 -0
- package/dist/templates/mga/{{name}}-api/src/middleware/auth.ts +133 -0
- package/dist/templates/mga/{{name}}-api/src/models/agent.ts +45 -0
- package/dist/templates/mga/{{name}}-api/src/models/application.ts +58 -0
- package/dist/templates/mga/{{name}}-api/src/models/invite.ts +39 -0
- package/dist/templates/mga/{{name}}-api/src/models/policy.ts +59 -0
- package/dist/templates/mga/{{name}}-api/src/models/product.ts +51 -0
- package/dist/templates/mga/{{name}}-api/src/models/quote.ts +68 -0
- package/dist/templates/mga/{{name}}-api/src/routes/agents.ts +98 -0
- package/dist/templates/mga/{{name}}-api/src/routes/applications.ts +170 -0
- package/dist/templates/mga/{{name}}-api/src/routes/invites.ts +146 -0
- package/dist/templates/mga/{{name}}-api/src/routes/policies.ts +70 -0
- package/dist/templates/mga/{{name}}-api/src/routes/products.ts +154 -0
- package/dist/templates/mga/{{name}}-api/src/routes/quotes.ts +263 -0
- package/dist/templates/mga/{{name}}-api/src/routes/reports.ts +199 -0
- package/dist/templates/mga/{{name}}-api/tsconfig.json +18 -0
- package/dist/templates/mga/{{name}}-web/.dockerignore +6 -0
- package/dist/templates/mga/{{name}}-web/.env.example +6 -0
- package/dist/templates/mga/{{name}}-web/Dockerfile +51 -0
- package/dist/templates/mga/{{name}}-web/catalog-info.yaml +24 -0
- package/dist/templates/mga/{{name}}-web/dockerignore +6 -0
- package/dist/templates/mga/{{name}}-web/gitignore +36 -0
- package/dist/templates/mga/{{name}}-web/helm/{{name}}-web/Chart.yaml +9 -0
- package/dist/templates/mga/{{name}}-web/helm/{{name}}-web/templates/_helpers.tpl +49 -0
- package/dist/templates/mga/{{name}}-web/helm/{{name}}-web/templates/configmap.yaml +10 -0
- package/dist/templates/mga/{{name}}-web/helm/{{name}}-web/templates/deployment.yaml +56 -0
- package/dist/templates/mga/{{name}}-web/helm/{{name}}-web/templates/ingress.yaml +41 -0
- package/dist/templates/mga/{{name}}-web/helm/{{name}}-web/templates/service.yaml +15 -0
- package/dist/templates/mga/{{name}}-web/helm/{{name}}-web/values.yaml +70 -0
- package/dist/templates/mga/{{name}}-web/next.config.js +8 -0
- package/dist/templates/mga/{{name}}-web/package.json +30 -0
- package/dist/templates/mga/{{name}}-web/public/.gitkeep +0 -0
- package/dist/templates/mga/{{name}}-web/public/gitkeep +0 -0
- package/dist/templates/mga/{{name}}-web/src/app/api/auth/callback/route.ts +77 -0
- package/dist/templates/mga/{{name}}-web/src/app/api/auth/login/route.ts +16 -0
- package/dist/templates/mga/{{name}}-web/src/app/api/auth/logout/route.ts +7 -0
- package/dist/templates/mga/{{name}}-web/src/app/api/auth/session/route.ts +42 -0
- package/dist/templates/mga/{{name}}-web/src/app/api/health/route.ts +10 -0
- package/dist/templates/mga/{{name}}-web/src/app/api/proxy/applications/route.ts +47 -0
- package/dist/templates/mga/{{name}}-web/src/app/applications/layout.tsx +17 -0
- package/dist/templates/mga/{{name}}-web/src/app/applications/new/page.tsx +374 -0
- package/dist/templates/mga/{{name}}-web/src/app/applications/page.tsx +109 -0
- package/dist/templates/mga/{{name}}-web/src/app/dashboard/admin/page.tsx +179 -0
- package/dist/templates/mga/{{name}}-web/src/app/dashboard/agent/page.tsx +125 -0
- package/dist/templates/mga/{{name}}-web/src/app/dashboard/insured/page.tsx +145 -0
- package/dist/templates/mga/{{name}}-web/src/app/dashboard/layout.tsx +17 -0
- package/dist/templates/mga/{{name}}-web/src/app/dashboard/page.tsx +27 -0
- package/dist/templates/mga/{{name}}-web/src/app/dashboard/shell.tsx +89 -0
- package/dist/templates/mga/{{name}}-web/src/app/globals.css +477 -0
- package/dist/templates/mga/{{name}}-web/src/app/layout.tsx +19 -0
- package/dist/templates/mga/{{name}}-web/src/app/page.tsx +74 -0
- package/dist/templates/mga/{{name}}-web/src/app/reports/layout.tsx +21 -0
- package/dist/templates/mga/{{name}}-web/src/app/reports/page.tsx +231 -0
- package/dist/templates/mga/{{name}}-web/src/lib/api.ts +79 -0
- package/dist/templates/mga/{{name}}-web/src/lib/auth.ts +285 -0
- package/dist/templates/mga/{{name}}-web/src/middleware.ts +71 -0
- package/dist/templates/mga/{{name}}-web/tsconfig.json +26 -0
- package/dist/templates/nextjs/.env.example +11 -0
- package/dist/templates/nextjs/Dockerfile +51 -0
- package/dist/templates/nextjs/README.md +87 -0
- package/dist/templates/nextjs/catalog-info.yaml +16 -0
- package/dist/templates/nextjs/gitignore +36 -0
- package/dist/templates/nextjs/helm/{{name}}/Chart.yaml +9 -0
- package/dist/templates/nextjs/helm/{{name}}/templates/deployment.yaml +72 -0
- package/dist/templates/nextjs/helm/{{name}}/templates/ingress.yaml +43 -0
- package/dist/templates/nextjs/helm/{{name}}/templates/service.yaml +17 -0
- package/dist/templates/nextjs/helm/{{name}}/values.yaml +60 -0
- package/dist/templates/nextjs/next.config.js +23 -0
- package/dist/templates/nextjs/package.json +29 -0
- package/dist/templates/nextjs/public/.gitkeep +0 -0
- package/dist/templates/nextjs/public/gitkeep +0 -0
- package/dist/templates/nextjs/src/app/api/example/route.ts +63 -0
- package/dist/templates/nextjs/src/app/api/health/route.ts +10 -0
- package/dist/templates/nextjs/src/app/layout.tsx +18 -0
- package/dist/templates/nextjs/src/app/page.tsx +49 -0
- package/dist/templates/nextjs/tsconfig.json +26 -0
- package/dist/templates/nextjs-oauth/.dockerignore +6 -0
- package/dist/templates/nextjs-oauth/.env.example +12 -0
- package/dist/templates/nextjs-oauth/Dockerfile +51 -0
- package/dist/templates/nextjs-oauth/README.md +115 -0
- package/dist/templates/nextjs-oauth/catalog-info.yaml +17 -0
- package/dist/templates/nextjs-oauth/dockerignore +6 -0
- package/dist/templates/nextjs-oauth/gitignore +36 -0
- package/dist/templates/nextjs-oauth/helm/Chart.yaml +6 -0
- package/dist/templates/nextjs-oauth/helm/templates/_helpers.tpl +49 -0
- package/dist/templates/nextjs-oauth/helm/templates/configmap.yaml +10 -0
- package/dist/templates/nextjs-oauth/helm/templates/deployment.yaml +56 -0
- package/dist/templates/nextjs-oauth/helm/templates/ingress.yaml +41 -0
- package/dist/templates/nextjs-oauth/helm/templates/service.yaml +15 -0
- package/dist/templates/nextjs-oauth/helm/values.yaml +69 -0
- package/dist/templates/nextjs-oauth/helm/{{name}}/Chart.yaml +9 -0
- package/dist/templates/nextjs-oauth/helm/{{name}}/templates/deployment.yaml +68 -0
- package/dist/templates/nextjs-oauth/helm/{{name}}/templates/service.yaml +17 -0
- package/dist/templates/nextjs-oauth/helm/{{name}}/values.yaml +51 -0
- package/dist/templates/nextjs-oauth/next.config.js +23 -0
- package/dist/templates/nextjs-oauth/package.json +30 -0
- package/dist/templates/nextjs-oauth/public/.gitkeep +0 -0
- package/dist/templates/nextjs-oauth/public/gitkeep +0 -0
- package/dist/templates/nextjs-oauth/src/app/api/auth/callback/route.ts +77 -0
- package/dist/templates/nextjs-oauth/src/app/api/auth/login/route.ts +16 -0
- package/dist/templates/nextjs-oauth/src/app/api/auth/logout/route.ts +7 -0
- package/dist/templates/nextjs-oauth/src/app/api/auth/session/route.ts +42 -0
- package/dist/templates/nextjs-oauth/src/app/api/example/route.ts +63 -0
- package/dist/templates/nextjs-oauth/src/app/api/health/route.ts +10 -0
- package/dist/templates/nextjs-oauth/src/app/dashboard/page.tsx +92 -0
- package/dist/templates/nextjs-oauth/src/app/layout.tsx +18 -0
- package/dist/templates/nextjs-oauth/src/app/page.tsx +110 -0
- package/dist/templates/nextjs-oauth/src/lib/auth.ts +285 -0
- package/dist/templates/nextjs-oauth/src/middleware.ts +71 -0
- package/dist/templates/nextjs-oauth/tsconfig.json +26 -0
- package/dist/templates/static/catalog-info.yaml +14 -0
- package/dist/templates/static/index.html +16 -0
- package/dist/templates/static/styles.css +39 -0
- package/dist/templates/worker/.env.example +13 -0
- package/dist/templates/worker/Dockerfile +26 -0
- package/dist/templates/worker/README.md +106 -0
- package/dist/templates/worker/catalog-info.yaml +19 -0
- package/dist/templates/worker/gitignore +5 -0
- package/dist/templates/worker/helm/{{name}}/Chart.yaml +9 -0
- package/dist/templates/worker/helm/{{name}}/templates/deployment.yaml +68 -0
- package/dist/templates/worker/helm/{{name}}/templates/ingress.yaml +43 -0
- package/dist/templates/worker/helm/{{name}}/values.yaml +64 -0
- package/dist/templates/worker/package.json +26 -0
- package/dist/templates/worker/src/index.ts +185 -0
- package/dist/templates/worker/tsconfig.json +14 -0
- package/dist/types/index.d.ts +596 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +41 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/platform.d.ts +191 -0
- package/dist/types/platform.d.ts.map +1 -0
- package/dist/types/platform.js +17 -0
- package/dist/types/platform.js.map +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{{- if .Values.ingress.enabled -}}
|
|
2
|
+
apiVersion: networking.k8s.io/v1
|
|
3
|
+
kind: Ingress
|
|
4
|
+
metadata:
|
|
5
|
+
name: {{ .Release.Name }}
|
|
6
|
+
labels:
|
|
7
|
+
app: {{ .Release.Name }}
|
|
8
|
+
app.kubernetes.io/name: {{ .Release.Name }}
|
|
9
|
+
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
10
|
+
{{- with .Values.ingress.annotations }}
|
|
11
|
+
annotations:
|
|
12
|
+
{{- toYaml . | nindent 4 }}
|
|
13
|
+
{{- end }}
|
|
14
|
+
spec:
|
|
15
|
+
{{- if .Values.ingress.className }}
|
|
16
|
+
ingressClassName: {{ .Values.ingress.className }}
|
|
17
|
+
{{- end }}
|
|
18
|
+
{{- if .Values.ingress.tls }}
|
|
19
|
+
tls:
|
|
20
|
+
{{- range .Values.ingress.tls }}
|
|
21
|
+
- hosts:
|
|
22
|
+
{{- range .hosts }}
|
|
23
|
+
- {{ . | quote }}
|
|
24
|
+
{{- end }}
|
|
25
|
+
secretName: {{ .secretName }}
|
|
26
|
+
{{- end }}
|
|
27
|
+
{{- end }}
|
|
28
|
+
rules:
|
|
29
|
+
{{- range .Values.ingress.hosts }}
|
|
30
|
+
- host: {{ .host | quote }}
|
|
31
|
+
http:
|
|
32
|
+
paths:
|
|
33
|
+
{{- range .paths }}
|
|
34
|
+
- path: {{ .path }}
|
|
35
|
+
pathType: {{ .pathType }}
|
|
36
|
+
backend:
|
|
37
|
+
service:
|
|
38
|
+
name: {{ $.Release.Name }}
|
|
39
|
+
port:
|
|
40
|
+
number: {{ $.Values.service.port }}
|
|
41
|
+
{{- end }}
|
|
42
|
+
{{- end }}
|
|
43
|
+
{{- end }}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
apiVersion: v1
|
|
2
|
+
kind: Service
|
|
3
|
+
metadata:
|
|
4
|
+
name: {{ .Release.Name }}
|
|
5
|
+
labels:
|
|
6
|
+
app: {{ .Release.Name }}
|
|
7
|
+
app.kubernetes.io/name: {{ .Release.Name }}
|
|
8
|
+
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
9
|
+
spec:
|
|
10
|
+
type: {{ .Values.service.type }}
|
|
11
|
+
ports:
|
|
12
|
+
- port: {{ .Values.service.port }}
|
|
13
|
+
targetPort: http
|
|
14
|
+
protocol: TCP
|
|
15
|
+
name: http
|
|
16
|
+
selector:
|
|
17
|
+
app: {{ .Release.Name }}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
replicaCount: 1
|
|
2
|
+
|
|
3
|
+
image:
|
|
4
|
+
repository: registry.digitalocean.com/insureco/{{name}}
|
|
5
|
+
tag: latest
|
|
6
|
+
pullPolicy: IfNotPresent
|
|
7
|
+
|
|
8
|
+
imagePullSecrets:
|
|
9
|
+
- name: insureco
|
|
10
|
+
|
|
11
|
+
service:
|
|
12
|
+
type: ClusterIP
|
|
13
|
+
port: 3000
|
|
14
|
+
|
|
15
|
+
resources:
|
|
16
|
+
limits:
|
|
17
|
+
cpu: 500m
|
|
18
|
+
memory: 512Mi
|
|
19
|
+
requests:
|
|
20
|
+
cpu: 100m
|
|
21
|
+
memory: 128Mi
|
|
22
|
+
|
|
23
|
+
autoscaling:
|
|
24
|
+
enabled: false
|
|
25
|
+
minReplicas: 1
|
|
26
|
+
maxReplicas: 5
|
|
27
|
+
targetCPUUtilizationPercentage: 80
|
|
28
|
+
|
|
29
|
+
nodeSelector: {}
|
|
30
|
+
|
|
31
|
+
tolerations: []
|
|
32
|
+
|
|
33
|
+
affinity: {}
|
|
34
|
+
|
|
35
|
+
env: {}
|
|
36
|
+
# Example:
|
|
37
|
+
# DATABASE_URL: mongodb://mongodb:27017/{{name}}
|
|
38
|
+
|
|
39
|
+
secrets: {}
|
|
40
|
+
# Example:
|
|
41
|
+
# API_KEY: secret-value
|
|
42
|
+
|
|
43
|
+
ingress:
|
|
44
|
+
enabled: false
|
|
45
|
+
className: nginx
|
|
46
|
+
annotations: {}
|
|
47
|
+
hosts: []
|
|
48
|
+
tls: []
|
|
49
|
+
|
|
50
|
+
secretRef: ""
|
|
51
|
+
|
|
52
|
+
livenessProbe:
|
|
53
|
+
httpGet:
|
|
54
|
+
path: /health
|
|
55
|
+
port: 3000
|
|
56
|
+
initialDelaySeconds: 10
|
|
57
|
+
periodSeconds: 10
|
|
58
|
+
|
|
59
|
+
readinessProbe:
|
|
60
|
+
httpGet:
|
|
61
|
+
path: /health
|
|
62
|
+
port: 3000
|
|
63
|
+
initialDelaySeconds: 5
|
|
64
|
+
periodSeconds: 5
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{name}}",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "{{description}}",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "tsc",
|
|
8
|
+
"dev": "tsx watch src/index.ts",
|
|
9
|
+
"start": "node dist/index.js",
|
|
10
|
+
"lint": "eslint src --ext .ts",
|
|
11
|
+
"typecheck": "tsc --noEmit",
|
|
12
|
+
"test": "vitest run",
|
|
13
|
+
"test:watch": "vitest"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"express": "^4.21.0",
|
|
17
|
+
"cors": "^2.8.5",
|
|
18
|
+
"helmet": "^8.0.0",
|
|
19
|
+
"zod": "^3.24.0"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/cors": "^2.8.17",
|
|
23
|
+
"@types/express": "^5.0.0",
|
|
24
|
+
"@types/node": "^22.0.0",
|
|
25
|
+
"eslint": "^9.0.0",
|
|
26
|
+
"tsx": "^4.0.0",
|
|
27
|
+
"typescript": "^5.7.0",
|
|
28
|
+
"vitest": "^2.0.0"
|
|
29
|
+
},
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=20.0.0"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import express, { type Request, type Response, type NextFunction } from 'express'
|
|
2
|
+
import cors from 'cors'
|
|
3
|
+
import helmet from 'helmet'
|
|
4
|
+
import { itemsRouter } from './routes/example.js'
|
|
5
|
+
|
|
6
|
+
const app = express()
|
|
7
|
+
const PORT = process.env.PORT || 3000
|
|
8
|
+
|
|
9
|
+
// Middleware
|
|
10
|
+
app.use(helmet())
|
|
11
|
+
app.use(cors())
|
|
12
|
+
app.use(express.json())
|
|
13
|
+
|
|
14
|
+
// Request logging
|
|
15
|
+
app.use((req: Request, _res: Response, next: NextFunction) => {
|
|
16
|
+
const timestamp = new Date().toISOString()
|
|
17
|
+
process.stdout.write(`[${timestamp}] ${req.method} ${req.path}\n`)
|
|
18
|
+
next()
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
// Health check endpoint
|
|
22
|
+
app.get('/health', (_req: Request, res: Response) => {
|
|
23
|
+
res.json({
|
|
24
|
+
status: 'healthy',
|
|
25
|
+
service: '{{name}}',
|
|
26
|
+
timestamp: new Date().toISOString(),
|
|
27
|
+
uptime: process.uptime(),
|
|
28
|
+
})
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
// API routes
|
|
32
|
+
app.use('/api/items', itemsRouter)
|
|
33
|
+
|
|
34
|
+
// 404 handler
|
|
35
|
+
app.use((_req: Request, res: Response) => {
|
|
36
|
+
res.status(404).json({
|
|
37
|
+
success: false,
|
|
38
|
+
error: {
|
|
39
|
+
code: 'NOT_FOUND',
|
|
40
|
+
message: 'The requested resource was not found',
|
|
41
|
+
},
|
|
42
|
+
})
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
// Error handler
|
|
46
|
+
app.use((err: Error, _req: Request, res: Response, _next: NextFunction) => {
|
|
47
|
+
process.stderr.write(`Error: ${err.message}\n`)
|
|
48
|
+
res.status(500).json({
|
|
49
|
+
success: false,
|
|
50
|
+
error: {
|
|
51
|
+
code: 'INTERNAL_ERROR',
|
|
52
|
+
message: process.env.NODE_ENV === 'production'
|
|
53
|
+
? 'An internal error occurred'
|
|
54
|
+
: err.message,
|
|
55
|
+
},
|
|
56
|
+
})
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
app.listen(PORT, () => {
|
|
60
|
+
process.stdout.write(`{{name}} listening on port ${PORT}\n`)
|
|
61
|
+
})
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { Router, type Request, type Response } from 'express'
|
|
2
|
+
import { z } from 'zod'
|
|
3
|
+
|
|
4
|
+
const router = Router()
|
|
5
|
+
|
|
6
|
+
// In-memory storage for demo purposes
|
|
7
|
+
interface Item {
|
|
8
|
+
id: string
|
|
9
|
+
name: string
|
|
10
|
+
description: string
|
|
11
|
+
createdAt: string
|
|
12
|
+
updatedAt: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const items: Map<string, Item> = new Map()
|
|
16
|
+
|
|
17
|
+
// Validation schemas
|
|
18
|
+
const CreateItemSchema = z.object({
|
|
19
|
+
name: z.string().min(1).max(100),
|
|
20
|
+
description: z.string().max(500).optional().default(''),
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
const UpdateItemSchema = z.object({
|
|
24
|
+
name: z.string().min(1).max(100).optional(),
|
|
25
|
+
description: z.string().max(500).optional(),
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
// Generate unique ID
|
|
29
|
+
function generateId(): string {
|
|
30
|
+
return Date.now().toString(36) + Math.random().toString(36).substring(2)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// List all items
|
|
34
|
+
router.get('/', (_req: Request, res: Response) => {
|
|
35
|
+
const itemList = Array.from(items.values())
|
|
36
|
+
res.json({
|
|
37
|
+
success: true,
|
|
38
|
+
data: itemList,
|
|
39
|
+
meta: {
|
|
40
|
+
total: itemList.length,
|
|
41
|
+
timestamp: new Date().toISOString(),
|
|
42
|
+
},
|
|
43
|
+
})
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
// Get single item
|
|
47
|
+
router.get('/:id', (req: Request, res: Response) => {
|
|
48
|
+
const id = req.params.id as string
|
|
49
|
+
const item = items.get(id)
|
|
50
|
+
|
|
51
|
+
if (!item) {
|
|
52
|
+
res.status(404).json({
|
|
53
|
+
success: false,
|
|
54
|
+
error: {
|
|
55
|
+
code: 'NOT_FOUND',
|
|
56
|
+
message: 'Item not found',
|
|
57
|
+
},
|
|
58
|
+
})
|
|
59
|
+
return
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
res.json({
|
|
63
|
+
success: true,
|
|
64
|
+
data: item,
|
|
65
|
+
})
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
// Create item
|
|
69
|
+
router.post('/', (req: Request, res: Response) => {
|
|
70
|
+
const result = CreateItemSchema.safeParse(req.body)
|
|
71
|
+
|
|
72
|
+
if (!result.success) {
|
|
73
|
+
res.status(400).json({
|
|
74
|
+
success: false,
|
|
75
|
+
error: {
|
|
76
|
+
code: 'VALIDATION_ERROR',
|
|
77
|
+
message: 'Invalid request body',
|
|
78
|
+
details: result.error.flatten(),
|
|
79
|
+
},
|
|
80
|
+
})
|
|
81
|
+
return
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const now = new Date().toISOString()
|
|
85
|
+
const item: Item = {
|
|
86
|
+
id: generateId(),
|
|
87
|
+
name: result.data.name,
|
|
88
|
+
description: result.data.description,
|
|
89
|
+
createdAt: now,
|
|
90
|
+
updatedAt: now,
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
items.set(item.id, item)
|
|
94
|
+
|
|
95
|
+
res.status(201).json({
|
|
96
|
+
success: true,
|
|
97
|
+
data: item,
|
|
98
|
+
})
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
// Update item
|
|
102
|
+
router.put('/:id', (req: Request, res: Response) => {
|
|
103
|
+
const id = req.params.id as string
|
|
104
|
+
const existing = items.get(id)
|
|
105
|
+
|
|
106
|
+
if (!existing) {
|
|
107
|
+
res.status(404).json({
|
|
108
|
+
success: false,
|
|
109
|
+
error: {
|
|
110
|
+
code: 'NOT_FOUND',
|
|
111
|
+
message: 'Item not found',
|
|
112
|
+
},
|
|
113
|
+
})
|
|
114
|
+
return
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const result = UpdateItemSchema.safeParse(req.body)
|
|
118
|
+
|
|
119
|
+
if (!result.success) {
|
|
120
|
+
res.status(400).json({
|
|
121
|
+
success: false,
|
|
122
|
+
error: {
|
|
123
|
+
code: 'VALIDATION_ERROR',
|
|
124
|
+
message: 'Invalid request body',
|
|
125
|
+
details: result.error.flatten(),
|
|
126
|
+
},
|
|
127
|
+
})
|
|
128
|
+
return
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const updated: Item = {
|
|
132
|
+
...existing,
|
|
133
|
+
name: result.data.name ?? existing.name,
|
|
134
|
+
description: result.data.description ?? existing.description,
|
|
135
|
+
updatedAt: new Date().toISOString(),
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
items.set(updated.id, updated)
|
|
139
|
+
|
|
140
|
+
res.json({
|
|
141
|
+
success: true,
|
|
142
|
+
data: updated,
|
|
143
|
+
})
|
|
144
|
+
})
|
|
145
|
+
|
|
146
|
+
// Delete item
|
|
147
|
+
router.delete('/:id', (req: Request, res: Response) => {
|
|
148
|
+
const id = req.params.id as string
|
|
149
|
+
const existed = items.delete(id)
|
|
150
|
+
|
|
151
|
+
if (!existed) {
|
|
152
|
+
res.status(404).json({
|
|
153
|
+
success: false,
|
|
154
|
+
error: {
|
|
155
|
+
code: 'NOT_FOUND',
|
|
156
|
+
message: 'Item not found',
|
|
157
|
+
},
|
|
158
|
+
})
|
|
159
|
+
return
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
res.status(204).send()
|
|
163
|
+
})
|
|
164
|
+
|
|
165
|
+
export { router as itemsRouter }
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "NodeNext",
|
|
5
|
+
"moduleResolution": "NodeNext",
|
|
6
|
+
"outDir": "./dist",
|
|
7
|
+
"rootDir": "./src",
|
|
8
|
+
"strict": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"forceConsistentCasingInFileNames": true,
|
|
12
|
+
"declaration": true,
|
|
13
|
+
"declarationMap": true,
|
|
14
|
+
"sourceMap": true
|
|
15
|
+
},
|
|
16
|
+
"include": ["src/**/*"],
|
|
17
|
+
"exclude": ["node_modules", "dist"]
|
|
18
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# {{name}} - Pod-to-Pod Communication Demo
|
|
2
|
+
|
|
3
|
+
This template demonstrates service-to-service (pod-to-pod) communication within the Tawa platform.
|
|
4
|
+
|
|
5
|
+
## Architecture
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
┌─────────────────┐
|
|
9
|
+
│ Client │
|
|
10
|
+
└────────┬────────┘
|
|
11
|
+
│
|
|
12
|
+
┌────────▼────────┐
|
|
13
|
+
│ Janus API │
|
|
14
|
+
│ Gateway │
|
|
15
|
+
└────────┬────────┘
|
|
16
|
+
│
|
|
17
|
+
┌───────────────────┼───────────────────┐
|
|
18
|
+
│ │ │
|
|
19
|
+
┌────────▼────────┐ ┌────────▼────────┐ │
|
|
20
|
+
│ service-a │ │ service-b │ │
|
|
21
|
+
│ (Provider) │ │ (Consumer) │ │
|
|
22
|
+
│ │ │ │ │
|
|
23
|
+
│ Exposes data │ │ Calls service-a │ │
|
|
24
|
+
│ via REST API │ │ internally │ │
|
|
25
|
+
└─────────────────┘ └────────┬────────┘ │
|
|
26
|
+
│ │
|
|
27
|
+
┌────────▼────────┐ │
|
|
28
|
+
│ Internal K8s │◄────────┘
|
|
29
|
+
│ Service DNS │
|
|
30
|
+
└─────────────────┘
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Services
|
|
34
|
+
|
|
35
|
+
### service-a (Provider)
|
|
36
|
+
|
|
37
|
+
- Exposes data via REST API
|
|
38
|
+
- Routes configured with `auth: service` for internal-only access
|
|
39
|
+
- Accessible at `http://{{name}}-service-a:3000` within the cluster
|
|
40
|
+
|
|
41
|
+
### service-b (Consumer)
|
|
42
|
+
|
|
43
|
+
- Calls service-a to retrieve and process data
|
|
44
|
+
- Uses internal Kubernetes DNS for service discovery
|
|
45
|
+
- Demonstrates service-to-service authentication
|
|
46
|
+
|
|
47
|
+
## Pod-to-Pod Authentication
|
|
48
|
+
|
|
49
|
+
When `auth: service` is set on a route in `catalog-info.yaml`:
|
|
50
|
+
|
|
51
|
+
1. Requests must include service credentials
|
|
52
|
+
2. Janus validates the calling service identity
|
|
53
|
+
3. Only registered services can access protected endpoints
|
|
54
|
+
|
|
55
|
+
### Example catalog-info.yaml configuration:
|
|
56
|
+
|
|
57
|
+
```yaml
|
|
58
|
+
spec:
|
|
59
|
+
routes:
|
|
60
|
+
- path: /api/internal/*
|
|
61
|
+
methods: [GET, POST]
|
|
62
|
+
auth: service # Only other services can call this
|
|
63
|
+
scopes:
|
|
64
|
+
- read:data
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Deployment
|
|
68
|
+
|
|
69
|
+
Deploy both services:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
cd {{name}}/service-a
|
|
73
|
+
iec link && iec deploy
|
|
74
|
+
|
|
75
|
+
cd ../service-b
|
|
76
|
+
iec link && iec deploy
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Testing
|
|
80
|
+
|
|
81
|
+
1. Deploy both services to sandbox
|
|
82
|
+
2. Call service-b's `/api/data` endpoint
|
|
83
|
+
3. service-b will internally call service-a and return combined data
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
curl https://{{name}}-service-b.sandbox.tawa.insureco.io/api/data
|
|
87
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
FROM node:22-alpine AS builder
|
|
2
|
+
WORKDIR /app
|
|
3
|
+
COPY package*.json ./
|
|
4
|
+
RUN npm ci
|
|
5
|
+
COPY . .
|
|
6
|
+
RUN npm run build
|
|
7
|
+
|
|
8
|
+
FROM node:22-alpine
|
|
9
|
+
WORKDIR /app
|
|
10
|
+
COPY package*.json ./
|
|
11
|
+
RUN npm ci --production && npm cache clean --force
|
|
12
|
+
COPY --from=builder /app/dist ./dist
|
|
13
|
+
|
|
14
|
+
ENV NODE_ENV=production
|
|
15
|
+
ENV PORT=3000
|
|
16
|
+
|
|
17
|
+
RUN addgroup -g 1001 -S nodejs && \
|
|
18
|
+
adduser -S nodejs -u 1001 && \
|
|
19
|
+
chown -R nodejs:nodejs /app
|
|
20
|
+
|
|
21
|
+
USER nodejs
|
|
22
|
+
EXPOSE 3000
|
|
23
|
+
|
|
24
|
+
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
25
|
+
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/health || exit 1
|
|
26
|
+
|
|
27
|
+
CMD ["node", "dist/index.js"]
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
apiVersion: backstage.io/v1alpha1
|
|
2
|
+
kind: Component
|
|
3
|
+
metadata:
|
|
4
|
+
name: {{name}}-service-a
|
|
5
|
+
description: Provider service for {{name}} - exposes internal data API
|
|
6
|
+
tags:
|
|
7
|
+
- tawa
|
|
8
|
+
- api
|
|
9
|
+
- provider
|
|
10
|
+
annotations:
|
|
11
|
+
insureco.io/framework: express
|
|
12
|
+
insureco.io/language: typescript
|
|
13
|
+
spec:
|
|
14
|
+
type: service
|
|
15
|
+
lifecycle: experimental
|
|
16
|
+
owner: {{owner}}
|
|
17
|
+
providesApis:
|
|
18
|
+
- {{name}}-service-a-api
|
|
19
|
+
routes:
|
|
20
|
+
- path: /health
|
|
21
|
+
methods: [GET]
|
|
22
|
+
auth: none
|
|
23
|
+
description: Health check endpoint
|
|
24
|
+
- path: /api/internal/*
|
|
25
|
+
methods: [GET, POST]
|
|
26
|
+
auth: service
|
|
27
|
+
scopes:
|
|
28
|
+
- read:data
|
|
29
|
+
- write:data
|
|
30
|
+
description: Internal API - service-to-service only
|
|
31
|
+
---
|
|
32
|
+
apiVersion: backstage.io/v1alpha1
|
|
33
|
+
kind: API
|
|
34
|
+
metadata:
|
|
35
|
+
name: {{name}}-service-a-api
|
|
36
|
+
description: Internal data API for {{name}}
|
|
37
|
+
spec:
|
|
38
|
+
type: openapi
|
|
39
|
+
lifecycle: experimental
|
|
40
|
+
owner: {{owner}}
|
|
41
|
+
definition: |
|
|
42
|
+
openapi: 3.0.0
|
|
43
|
+
info:
|
|
44
|
+
title: {{name}} Service A API
|
|
45
|
+
version: 1.0.0
|
|
46
|
+
paths:
|
|
47
|
+
/api/internal/items:
|
|
48
|
+
get:
|
|
49
|
+
summary: Get all items (service-to-service only)
|
|
50
|
+
security:
|
|
51
|
+
- serviceAuth: []
|
|
52
|
+
responses:
|
|
53
|
+
'200':
|
|
54
|
+
description: List of items
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
apiVersion: apps/v1
|
|
2
|
+
kind: Deployment
|
|
3
|
+
metadata:
|
|
4
|
+
name: {{ .Release.Name }}
|
|
5
|
+
labels:
|
|
6
|
+
app: {{ .Release.Name }}
|
|
7
|
+
app.kubernetes.io/name: {{ .Release.Name }}
|
|
8
|
+
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
9
|
+
spec:
|
|
10
|
+
replicas: {{ .Values.replicaCount }}
|
|
11
|
+
selector:
|
|
12
|
+
matchLabels:
|
|
13
|
+
app: {{ .Release.Name }}
|
|
14
|
+
template:
|
|
15
|
+
metadata:
|
|
16
|
+
labels:
|
|
17
|
+
app: {{ .Release.Name }}
|
|
18
|
+
app.kubernetes.io/name: {{ .Release.Name }}
|
|
19
|
+
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
20
|
+
spec:
|
|
21
|
+
{{- with .Values.imagePullSecrets }}
|
|
22
|
+
imagePullSecrets:
|
|
23
|
+
{{- toYaml . | nindent 8 }}
|
|
24
|
+
{{- end }}
|
|
25
|
+
containers:
|
|
26
|
+
- name: {{ .Chart.Name }}
|
|
27
|
+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
|
28
|
+
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
29
|
+
ports:
|
|
30
|
+
- name: http
|
|
31
|
+
containerPort: {{ .Values.service.port }}
|
|
32
|
+
protocol: TCP
|
|
33
|
+
envFrom:
|
|
34
|
+
- configMapRef:
|
|
35
|
+
name: {{ .Release.Name }}-config
|
|
36
|
+
optional: true
|
|
37
|
+
- secretRef:
|
|
38
|
+
name: {{ .Release.Name }}-secrets
|
|
39
|
+
optional: true
|
|
40
|
+
{{- if .Values.secretRef }}
|
|
41
|
+
- secretRef:
|
|
42
|
+
name: {{ .Values.secretRef }}
|
|
43
|
+
{{- end }}
|
|
44
|
+
{{- with .Values.env }}
|
|
45
|
+
env:
|
|
46
|
+
{{- range $key, $value := . }}
|
|
47
|
+
- name: {{ $key }}
|
|
48
|
+
value: {{ $value | quote }}
|
|
49
|
+
{{- end }}
|
|
50
|
+
{{- end }}
|
|
51
|
+
{{- with .Values.livenessProbe }}
|
|
52
|
+
livenessProbe:
|
|
53
|
+
{{- toYaml . | nindent 12 }}
|
|
54
|
+
{{- end }}
|
|
55
|
+
{{- with .Values.readinessProbe }}
|
|
56
|
+
readinessProbe:
|
|
57
|
+
{{- toYaml . | nindent 12 }}
|
|
58
|
+
{{- end }}
|
|
59
|
+
resources:
|
|
60
|
+
{{- toYaml .Values.resources | nindent 12 }}
|
|
61
|
+
{{- with .Values.nodeSelector }}
|
|
62
|
+
nodeSelector:
|
|
63
|
+
{{- toYaml . | nindent 8 }}
|
|
64
|
+
{{- end }}
|
|
65
|
+
{{- with .Values.affinity }}
|
|
66
|
+
affinity:
|
|
67
|
+
{{- toYaml . | nindent 8 }}
|
|
68
|
+
{{- end }}
|
|
69
|
+
{{- with .Values.tolerations }}
|
|
70
|
+
tolerations:
|
|
71
|
+
{{- toYaml . | nindent 8 }}
|
|
72
|
+
{{- end }}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{{- if .Values.ingress.enabled -}}
|
|
2
|
+
apiVersion: networking.k8s.io/v1
|
|
3
|
+
kind: Ingress
|
|
4
|
+
metadata:
|
|
5
|
+
name: {{ .Release.Name }}
|
|
6
|
+
labels:
|
|
7
|
+
app: {{ .Release.Name }}
|
|
8
|
+
app.kubernetes.io/name: {{ .Release.Name }}
|
|
9
|
+
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
10
|
+
{{- with .Values.ingress.annotations }}
|
|
11
|
+
annotations:
|
|
12
|
+
{{- toYaml . | nindent 4 }}
|
|
13
|
+
{{- end }}
|
|
14
|
+
spec:
|
|
15
|
+
{{- if .Values.ingress.className }}
|
|
16
|
+
ingressClassName: {{ .Values.ingress.className }}
|
|
17
|
+
{{- end }}
|
|
18
|
+
{{- if .Values.ingress.tls }}
|
|
19
|
+
tls:
|
|
20
|
+
{{- range .Values.ingress.tls }}
|
|
21
|
+
- hosts:
|
|
22
|
+
{{- range .hosts }}
|
|
23
|
+
- {{ . | quote }}
|
|
24
|
+
{{- end }}
|
|
25
|
+
secretName: {{ .secretName }}
|
|
26
|
+
{{- end }}
|
|
27
|
+
{{- end }}
|
|
28
|
+
rules:
|
|
29
|
+
{{- range .Values.ingress.hosts }}
|
|
30
|
+
- host: {{ .host | quote }}
|
|
31
|
+
http:
|
|
32
|
+
paths:
|
|
33
|
+
{{- range .paths }}
|
|
34
|
+
- path: {{ .path }}
|
|
35
|
+
pathType: {{ .pathType }}
|
|
36
|
+
backend:
|
|
37
|
+
service:
|
|
38
|
+
name: {{ $.Release.Name }}
|
|
39
|
+
port:
|
|
40
|
+
number: {{ $.Values.service.port }}
|
|
41
|
+
{{- end }}
|
|
42
|
+
{{- end }}
|
|
43
|
+
{{- end }}
|