Files
java21-template/java-service-template-deploy/README.md
T
Bruno GaoandQwen-Coder eefe2c5b34 M2: Add complete Java21 template with Clean Architecture implementation
- Add four-layer modular structure (domain, application, infrastructure, api)
- Implement complete CRUD example with Order entity
- Add ArchUnit architecture compliance tests
- Add Maven configuration with proper dependency management
- Add Dockerfile for containerization
- Add Kustomize deployment templates
- Add initialization script (init.sh)
- Add CI/CD workflow configuration
- Add comprehensive documentation and configuration files

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-11 23:54:21 +08:00

1.3 KiB

tmpl-service-deploy

Kubernetes 部署清单模板

目录结构

.
├── base/                 # 基础部署配置
│   ├── kustomization.yaml
│   ├── deployment.yaml
│   ├── service.yaml
│   ├── configmap.yaml
│   └── hpa.yaml
└── overlays/             # 环境覆盖配置
    ├── dev/
    │   ├── kustomization.yaml
    │   └── patch-resources.yaml
    ├── staging/
    │   ├── kustomization.yaml
    │   └── patch-resources.yaml
    └── prod/
        ├── kustomization.yaml
        ├── patch-resources.yaml
        └── patch-replicas.yaml

使用方法

构建特定环境的配置

# 开发环境
kubectl kustomize overlays/dev

# 预发布环境
kubectl kustomize overlays/staging

# 生产环境
kubectl kustomize overlays/prod

应用到集群

# 开发环境
kubectl apply -k overlays/dev

# 预发布环境
kubectl apply -k overlays/staging

# 生产环境
kubectl apply -k overlays/prod

自定义

根据实际需要修改以下内容:

  1. base/deployment.yaml - 容器镜像名称和资源配置
  2. base/configmap.yaml - 应用配置
  3. 各环境的 kustomization.yaml - 镜像标签
  4. 各环境的 patch-*.yaml - 资源和副本数量配置