cap-operator
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCAP Operator Skill
CAP Operator Skill
Manages the lifecycle of multi-tenant SAP Cloud Application Programming Model (CAP) applications on Kubernetes via the CAP Operator controller.
Response rule: Always include a link to the relevant page on https://sap.github.io/cap-operator/docs/ when answering any question. Match the topic to the most specific page available (resource reference, usage guide, troubleshooting, configuration, etc.).
Full docs & API reference: | https://sap.github.io/cap-operator/docs/
website/content/en/docs/通过 CAP Operator controller 管理 Kubernetes 上多租户 SAP Cloud Application Programming Model (CAP) 应用程序的生命周期。
响应规则: 回答任何问题时,始终包含指向 https://sap.github.io/cap-operator/docs/ 上相关页面的链接。将主题匹配到可用的最具体页面(资源参考、使用指南、故障排查、配置等)。
完整文档与 API 参考: | https://sap.github.io/cap-operator/docs/
website/content/en/docs/Custom Resources
自定义资源
| Resource | Scope | Purpose |
|---|---|---|
| Namespaced | High-level app: BTP services, domain refs, provider subaccount |
| Namespaced | Immutable version: images, workloads, tenant operation steps |
| Namespaced | A subscribed consumer tenant — controller-managed only |
| Namespaced | Orchestrates provisioning/upgrade/deprovisioning — auto-created |
| Namespaced | Represents one consumer subscription — created by subscription server |
| Namespaced | Caches subscription credentials and dependency info — auto-created by controller |
| Namespaced | Istio Gateway + TLS + DNS for one application |
| Cluster | Shared domain config across applications |
Critical rules:
- is immutable after creation. To upgrade, create a new resource with a higher semantic version.
CAPApplicationVersion - must never be created or deleted manually — managed exclusively by the subscription server in response to SaaS Provisioning service callbacks.
Subscription - must never be created or deleted manually — created by the controller as a child of
CAPTenant.Subscription - is auto-created by the controller — do not create or delete manually.
CAPTenantOperation - is auto-created and kept in sync by the controller for each
SubscriptionProvider— do not create, modify, or delete manually.CAPApplication - Never remove finalizers from CAP Operator resources manually.
- is deprecated. It previously caused the controller to auto-create a provider
CAPApplication.spec.provider, but that behavior has been removed. All tenants (including the provider) must now be subscribed to explicitly. IfCAPTenantreturns empty, this is expected for apps with no active subscriptions.kubectl get captenant -n <namespace>
| 资源 | 作用域 | 用途 |
|---|---|---|
| 命名空间级 | 高级别应用:BTP 服务、域引用、provider 子账户 |
| 命名空间级 | 不可变版本:镜像、工作负载、租户操作步骤 |
| 命名空间级 | 已订阅的消费者租户——仅由 controller 管理 |
| 命名空间级 | 编排开通/升级/取消开通——自动创建 |
| 命名空间级 | 表示一个消费者订阅——由 subscription server 创建 |
| 命名空间级 | 缓存订阅凭据和依赖信息——由 controller 自动创建 |
| 命名空间级 | 为单个应用提供 Istio Gateway + TLS + DNS |
| 集群级 | 跨应用共享的域配置 |
关键规则:
- 创建后不可变。要升级,请创建一个 semantic version 更高的新资源。
CAPApplicationVersion - 绝不能手动创建或删除——完全由 subscription server 响应 SaaS Provisioning service 回调来管理。
Subscription - 绝不能手动创建或删除——由 controller 作为
CAPTenant的子资源创建。Subscription - 由 controller 自动创建——不要手动创建或删除。
CAPTenantOperation - 由 controller 为每个
SubscriptionProvider自动创建并保持同步——不要手动创建、修改或删除。CAPApplication - 绝不要手动移除 CAP Operator 资源上的 finalizers。
- 已弃用。它过去曾导致 controller 自动创建 provider
CAPApplication.spec.provider,但该行为已被移除。现在所有租户(包括 provider)都必须显式订阅。如果CAPTenant返回为空,对于没有活跃订阅的应用来说这是预期结果。kubectl get captenant -n <namespace>
Common Operations
常见操作
Deploy a new application
部署新应用
- Create or
DomainClusterDomain - Create (references BTP services + domain)
CAPApplication - Create (images + workloads)
CAPApplicationVersion
See deploy reference for full YAML examples.
- 创建 或
DomainClusterDomain - 创建 (引用 BTP 服务 + 域)
CAPApplication - 创建 (镜像 + 工作负载)
CAPApplicationVersion
有关完整的 YAML 示例,请参阅部署参考。
Upgrade to a new version
升级到新版本
Create a new with a higher semantic version — do not edit the existing one.
The controller automatically upgrades all tenants and updates Istio routing.
CAPApplicationVersionVirtualServiceSee upgrade reference for details and / configuration.
tenantOperationscontentJobs创建一个 semantic version 更高的新 ——不要编辑现有的那个。
CAPApplicationVersionController 会自动升级所有租户并更新 Istio 路由。
VirtualService有关详细信息以及 / 配置,请参阅升级参考。
tenantOperationscontentJobsCheck status
检查状态
bash
kubectl get capapplication,capapplicationversion,captenant,captenantoperation,subscription -n <namespace>
kubectl describe capapplication <name> -n <namespace>
kubectl get domain,clusterdomain -AStatus flows:
- :
CAPApplicationVersion→Processing|ReadyError - :
CAPTenant→Provisioning|Ready→Upgrading|ReadyDeleting - :
CAPTenantOperation→Processing|CompletedFailed - :
Subscription→Processing|Ready(retryable) |ProcessingError(terminal) |ErrorDeleting
bash
kubectl get capapplication,capapplicationversion,captenant,captenantoperation,subscription -n <namespace>
kubectl describe capapplication <name> -n <namespace>
kubectl get domain,clusterdomain -A状态流转:
- :
CAPApplicationVersion→Processing|ReadyError - :
CAPTenant→Provisioning|Ready→Upgrading|ReadyDeleting - :
CAPTenantOperation→Processing|CompletedFailed - :
Subscription→Processing|Ready(可重试) |ProcessingError(终止状态) |ErrorDeleting
Domain management
域管理
- — namespace-scoped, one application.
Domain— cluster-scoped, shared.ClusterDomain - TLS modes: (default),
Simple,MutualOptionalMutual - DNS modes: (default),
None,Wildcard,SubdomainCustom - First entry in is the primary domain.
domainRefs - inline section in
domainswas removed in v0.26.0; useCAPApplicationinstead.domainRefs
See domain reference.
- ——命名空间级,面向单个应用。
Domain——集群级,共享使用。ClusterDomain - TLS 模式:(默认)、
Simple、MutualOptionalMutual - DNS 模式:(默认)、
None、Wildcard、SubdomainCustom - 中的第一项是主域。
domainRefs - 中的内联
CAPApplication部分已在 v0.26.0 中移除;请改用domains。domainRefs
请参阅域参考。
Service exposures (tenant-agnostic)
服务暴露(租户无关)
Use in to expose workloads at fixed subdomains independent of tenant routing. Order routes most-specific-first.
serviceExposuresCAPApplicationVersionSee service exposure reference.
在 中使用 ,以固定子域名暴露工作负载,与租户路由无关。路由按从最具体到最不具体的顺序排列。
CAPApplicationVersionserviceExposures请参阅服务暴露参考。
Credential rotation rollout
凭据轮换发布
Set on to auto-restart workloads when BTP service credential Secrets change. Uses rolling restart (zero downtime). Keep old credentials valid for at least 24 hours after issuing new ones.
rolloutOnCredentialUpdate: trueCAPApplicationSee credential rotation reference.
在 上设置 ,以便在 BTP service credential Secrets 发生变化时自动重启工作负载。采用滚动重启(零停机)。签发新凭据后,旧凭据至少保持有效 24 小时。
CAPApplicationrolloutOnCredentialUpdate: true请参阅凭据轮换参考。
Version cleanup (monitoring-based)
版本清理(基于监控)
Enable with annotation on . Configure (PromQL) on a workload's section; when the expression evaluates to the version is eligible for deletion.
sme.sap.com/enable-cleanup-monitoring: "true"CAPApplicationdeletionRules.expressionmonitoringtrueSee Version monitoring ().
website/content/en/docs/usage/version-monitoring.md通过在 上添加注解 来启用。在工作负载的 部分配置 (PromQL);当该表达式求值为 时,该版本即可删除。
CAPApplicationsme.sap.com/enable-cleanup-monitoring: "true"monitoringdeletionRules.expressiontrue请参阅版本监控()。
website/content/en/docs/usage/version-monitoring.mdKey Annotations
关键注解
| Annotation | Resource | Effect |
|---|---|---|
| | Enable monitoring-based version cleanup |
| | Keep users on current version until logout (experimental) |
| | Custom logout path for version affinity |
| 注解 | 资源 | 效果 |
|---|---|---|
| | 启用基于监控的版本清理 |
| | 在用户退出前保持用户使用当前版本(实验性) |
| | 为版本亲和性指定自定义退出路径 |
Troubleshooting
故障排查
Common symptoms and fixes — / stuck, , finalizers, security context, Approuter destination/timeout issues, credential injection, SAP HANA connection errors, and controller memory limits.
CAPApplicationVersionCAPTenantWaitingForSecrets@sap/cds-mtxsSee troubleshooting reference | | https://sap.github.io/cap-operator/docs/troubleshoot/
website/content/en/docs/troubleshoot/_index.md常见症状及修复方法——/ 卡住、、finalizers、 security context、Approuter destination/timeout 问题、凭据注入、SAP HANA 连接错误以及 controller 内存限制。
CAPApplicationVersionCAPTenantWaitingForSecrets@sap/cds-mtxs请参阅故障排查参考 | | https://sap.github.io/cap-operator/docs/troubleshoot/
website/content/en/docs/troubleshoot/_index.mdController Configuration
Controller 配置
Tuned via env vars on the controller deployment. Key variables:
| Variable | Purpose |
|---|---|
| |
| |
| CAPApplication reconciliation concurrency |
| CAPApplicationVersion reconciliation concurrency |
| CAPTenant reconciliation concurrency |
| CAPTenantOperation reconciliation concurrency |
| Subscription reconciliation concurrency |
Full list: | https://sap.github.io/cap-operator/docs/configuration/
website/content/en/docs/configuration/_index.md通过 controller 部署上的环境变量进行调优。主要变量:
| 变量 | 用途 |
|---|---|
| |
| |
| |
| |
| |
| |
| |
完整列表: | https://sap.github.io/cap-operator/docs/configuration/
website/content/en/docs/configuration/_index.mdCAP Operator Plugin (Helm Chart Generation)
CAP Operator Plugin(Helm Chart 生成)
The CDS plugin scaffolds the Helm chart for a CAP application, generates runtime values, and builds the final deployable chart.
@cap-js/cap-operator-pluginDo not run any of these steps on skill invocation. Only start when the user explicitly asks to generate a Helm chart or deploy the app. Merely loading this skill (e.g. via ) is not a request — describe the skill's capabilities and wait.
/cap-operatorChart generation and deployment are two separate phases with a gate between them — create just the chart; let the user decide if/when to deploy.
- Scaffold the chart. Pick the variant by checking for a populated MTX sidecar folder (with contents): sidecar present → multitenant →
mtx/sidecar; no sidecar → service-only →--with-templates.--with-service-only - Ask whether they want to deploy.
- Only after a yes, collect the runtime inputs (,
appName,capOperatorSubdomain,clusterDomain) and generateproviderSubaccountId.runtime-values.yaml - Validate before deploying — run with
helm lintpassed in and confirm no required values are missing.runtime-values.yaml - Deploy with .
helm upgrade -i
See CAP Operator Plugin reference for more details on plugin usage and configuration.
@cap-js/cap-operator-plugin在调用 skill 时不要执行以下任何步骤。 只有当用户明确要求生成 Helm chart 或部署应用时才开始。仅仅加载此 skill(例如通过 )并不构成请求——请描述该 skill 的能力并等待。
/cap-operatorChart 生成与部署是两个独立阶段,两者之间设有一道关卡——先生成 chart;由用户决定是否以及何时部署。
- 搭建 chart 脚手架。 通过检查是否存在已填充的 MTX sidecar 文件夹(且包含内容)来选择变体:存在 sidecar → 多租户 →
mtx/sidecar;不存在 sidecar → 仅服务 →--with-templates。--with-service-only - 询问用户是否希望部署。
- **只有在用户确认“是”之后,**才收集运行时输入(、
appName、capOperatorSubdomain、clusterDomain)并生成providerSubaccountId。runtime-values.yaml - 部署前进行验证——传入 运行
runtime-values.yaml,并确认没有缺少必需值。helm lint - 使用 部署。
helm upgrade -i
有关插件使用和配置的更多详细信息,请参阅 CAP Operator Plugin 参考。