SubscriptionProvider
2 minute read
SubscriptionProvider resources are fully managed by CAP Operator. They are automatically created and kept in sync by the controller whenever a CAPApplication is reconciled. Do not create, modify, or delete them manually.
A SubscriptionProvider is created by the controller in the same namespace as its owning CAPApplication, with the same name. It stores pre-computed subscription credentials and dependency information derived from the CAPApplication spec. The subscription server uses it to:
- Authorize incoming subscription requests (using the referenced BTP service secrets)
- Return the pre-computed dependency list from the
getDependenciesendpoint of the SaaS Provisioning service
Because all subscription-related lookups happen at CAPApplication reconciliation time rather than at HTTP request time, the subscription server can serve requests efficiently without directly parsing the CAPApplication spec.
apiVersion: sme.sap.com/v1alpha2
kind: SubscriptionProvider
metadata:
name: cap-app-01
namespace: cap-app-01
spec:
appName: cap-app-01
providerSubaccountId: aa2bae55d7b5-1279-456564-a7b0-aa2bae55d7b5
subscriptionInfo:
type: saas-registry
subscriptionSecret: my-saas-registry-secret
authSecret: my-xsuaa-secret
dependencies: '[{"xsappname":"my-destination-service!b42"},{"xsappname":"my-auditlog-service!b7"}]'
Spec
| Field | Description |
|---|---|
appName | Name of the CAP application. Derived from CAPApplication.spec.btpAppName. |
providerSubaccountId | Provider subaccount ID. Derived from CAPApplication.spec.providerSubaccountId. |
subscriptionInfo.type | Type of subscription service: saas-registry or subscription-manager, depending on which BTP service is configured in the CAPApplication. |
subscriptionInfo.subscriptionSecret | Name of the Kubernetes Secret containing the BTP subscription service credentials (used for request authorization). |
subscriptionInfo.authSecret | (Optional) Name of the Kubernetes Secret containing the XSUAA credentials. Only set for saas-registry type. |
dependencies | Pre-computed JSON array of subscription dependencies (for example, [{"xsappname":"..."}]). Computed from BTP service secrets at CAPApplication reconciliation time and returned verbatim by the subscription server’s getDependencies endpoint. See Service Qualification for how dependencies are determined. |
maxSubscriptions | (Optional) Upper bound on the number of active subscriptions allowed for this application. Derived from CAPApplication.spec.maxSubscriptions. See Subscription Limit below. |
Subscription Limit
Setting maxSubscriptions on a CAPApplication causes the subscription server to reject any provisioning request that would push the active subscription count above the configured limit. The rejected request receives HTTP 422 (SubscriptionLimitReached).
apiVersion: sme.sap.com/v1alpha2
kind: CAPApplication
metadata:
name: cap-app-01
namespace: cap-app-01
spec:
# ...
maxSubscriptions: 500
Known limitation: multiple subscription server replicas
The subscription limit is enforced using an in-process lock, which serializes the check-then-create operation within a single subscription server pod. This means the limit is reliably enforced when the subscription server runs as a single replica (the default: subscriptionServer.replicas: 1).
When the subscription server is scaled to multiple replicas, each pod serializes requests independently. Concurrent provisioning requests handled by different pods can still interleave the count check and the create operation, potentially allowing the subscription count to briefly exceed the configured limit. This limitation may be addressed in a future release.