nwarila-platform/rancher-terraform-framework
GitHub: nwarila-platform/rancher-terraform-framework
面向 Rancher 托管 Kubernetes 的 Terraform 多租户 PaaS 框架,通过分层安全模型和质量门禁实现租户工作负载的安全交付与管理。
Stars: 0 | Forks: 0
# rancher-terraform-framework
适用于 NWarila 托管 Kubernetes 的可重用 Rancher PaaS 框架。一个租户
仓库派生自 `deploy-tenant-template`,保留了仓库内的 Helm chart
源码以及一个 `terraform.tfvars`,并使用 `all_workloads` 定义一个或
多个能够通过平台安全基线的 workload release。此
仓库是框架源码,而非部署根目录:它将提供
用于 Rancher 租户项目的 platform-run envelope module、每个 workload 的
namespace、quota、PSA label,以及受限的 reconcile identity,外加
一个供租户使用的部署模块,该模块仅使用
平台颁发的 scoped credential 来运行 `helm_release`。该安全模型构建于
租户仓库渲染检查、集群内 Pod Security Admission Restricted、
Kyverno 以及匹配的最小权限 RBAC 之上。
Rancher 专用的 Terraform 模块、golden chart starter、policy manifest、
tenant template 和 ephemeral-Rancher CI harness 正在从当前存在于该仓库中的脚手架出发,
通过经过审查的小步骤逐步构建。
## 快速开始
在更改框架源码之前运行本地质量门禁:
```
make ci
```
CI 流程会运行 Terraform 格式化、初始化、验证、测试、TFLint、Helm
chart schema 验证、terraform-docs 偏差检测、文档布局
检查,以及仓库的 OPA 策略目标。Rancher 专用的集成覆盖率
将通过一次性的、由 CI 管理的 Rancher 环境来添加,而不是
长期存在的外部凭据。
## 文档
- [快速开始](docs/how-to/develop-this-module.md)
- [架构](docs/explanation/architecture.md)
- [威胁模型](docs/explanation/threat-model.md)
- [质量门禁](docs/reference/quality-gates.md)
- [发布门禁](docs/reference/release-gates.md)
- [架构决策](docs/decision-records/README.md)
## 当前架构决策
- [ADR-repo/0001](docs/decision-records/repo/0001-adopt-rancher2-envelope-and-helm-release-local-chart.md) 采用了 Rancher envelope 加上本地仓库内 Helm chart 的交付模型。
- [ADR-repo/0002](docs/decision-records/repo/0002-use-two-layer-tenant-security.md) 定义了租户仓库渲染门禁以及集群内权威的 admission boundary。
- [ADR-repo/0003](docs/decision-records/repo/0003-define-tenant-repo-contract.md) 定义了租户仓库契约以及三个经过审计的逃生舱。
- [ADR-repo/0004](docs/decision-records/repo/0004-use-vault-references-and-vault-secrets-operator.md) 将敏感值排除在 Terraform 和 Helm 输入之外。
- [ADR-repo/0005](docs/decision-records/repo/0005-validate-with-ephemeral-rancher-ci.md) 将验证工作委托给一次性的完整 Rancher CI 环境。
- [ADR-repo/0006](docs/decision-records/repo/0006-use-all-workloads-tenant-contract.md) 将租户契约更新为一个租户项目下的 `all_workloads`。
- [ADR-repo/0007](docs/decision-records/repo/0007-adopt-packer-limited-hcl-style.md) 为未来的 Terraform 实施工作采用了 packer-limited HCL 风格。
- [ADR-repo/0008](docs/decision-records/repo/0008-retire-static-terraform-plan-opa.md) 停用了此 Rancher 框架的静态 OPA-on-plan。
- [ADR-repo/0009](docs/decision-records/repo/0009-split-platform-envelope-from-tenant-deploy-and-scope-the-reconcile-identity.md) 将 platform envelope 与租户部署分离,并限定了 reconcile identity 的范围。
标签:ECS, Helm, Rancher, Terraform, 子域名突变