Application
An application represents a streaming app or data pipeline that’s responsible for producing, consuming or processing data in Kafka. In Self-service, it’s used as a method to organize and re-group multiple deployments of the same application (dev, prod) or different microservices that belong to the same team under one umbrella.- API key(s): AdminToken
- Managed with: API, CLI, TF
- Labels support: Full
- CLI
- Terraform
spec.owneris a valid Console group- Delete has to fail if there are associated
ApplicationInstance
- None, deploying this object will only create the application in Console that can be managed on the Application Catalog page.
ApplicationInstance
Application instance represents an actual deployment of an application on a Kafka cluster for a service account. This is the core concept of Self-service, as it ties everything together: Kafka cluster, service account, ownership of resources and policies.- API key(s): AdminToken
- Managed with: API, CLI, TF
- Labels support: Full
- CLI
- Terraform
metadata.applicationis a valid application.spec.clusteris a valid Console cluster technical Id.spec.clusteris immutable (can’t be updated after creation).spec.serviceAccount(optional). If already used by another AppInstance on the the samespec.cluster, it can’t be set.spec.applicationManagedServiceAccount(optional), default isfalse. If set totrue, the service account ACLs will be managed by the application owners directly instead of being synchronized by the ApplicationInstance. Find out more about managed service account.spec.topicPolicyRef(optional), if defined, has to be a valid list of TopicPolicy.spec.policyRef(optional), if set, has to be a valid list of ResourcePolicy.spec.defaultCatalogVisibility(optional), default isPUBLIC. Can bePUBLICorPRIVATE.spec.resources[].typecan beTOPIC,CONSUMER_GROUP,SUBJECTorCONNECTOR:spec.resources[].connectClusteris only mandatory whentypeisCONNECTOR;spec.resources[].connectClusteris a valid Connect cluster linked to the Kafka clusterspec.cluster.
spec.resources[].patternTypecan bePREFIXEDorLITERAL.spec.resources[].namehas to not overlap with any other ApplicationInstance on the same cluster. I.e.: if there’s already an owner forclick, this is forbidden:click.orders.: resource is a child-resource ofclickcli: resource is a parent-resource ofclick
spec.resources[].ownershipMode(optional), default isALL. Can beALLorLIMITED.
- Console
- Members of the owner group can create application API keys from the UI.
- Resources with
ownershipModeset toALL: ApplicationInstance is given all permissions in the UI and the CLI over the owned resources. - Resources with
ownershipModeset toLIMITED: ApplicationInstance is restricted the create/update/delete permissions in the UI and the CLI over the owned resources:- can’t use the CLI
applycommand - can’t create/delete the resource in the UI
- everything else (restart connector, browse and produce from topic, etc.) is still available. Find out more about ownership.
- can’t use the CLI
- Kafka
- Service account is granted the following ACLs over the declared resources depending on the type:
- Topic:
READ,WRITEandDESCRIBE_CONFIGS - ConsumerGroup:
READ
- Topic:
- For Confluent Cloud clusters with their provider settings set to have role bindings enabled, the following Confluent Cloud RBAC role bindings will be created for the service account instead:
- Topic:
DeveloperRead,DeveloperWrite- There’s also an implicit permission granted for subjects that share the same topic prefix. If there’s
writeaccess to a topic, the service account will also receivewriteaccess over the subject.
- There’s also an implicit permission granted for subjects that share the same topic prefix. If there’s
- Subject:
DeveloperRead,DeveloperWrite - ConsumerGroup:
DeveloperRead
- Topic:
- Service account is granted the following ACLs over the declared resources depending on the type:
ApplicationInstancePermission
Define permissions for the application instance to enable collaboration between teams.- API key(s): AdminToken, AppToken
- Managed with: API, CLI, TF
- Labels support: Missing
- CLI
- Terraform
specis immutable:- once created, you’ll only be able to update its metadata. This is to protect you from making a change that could impact an external application.
- this resource affects target ApplicationInstance’s Kafka service account ACLs.
- to edit this resource, delete and re-create it.
spec.resource.typecan beTOPIC.spec.resource.patternTypecan bePREFIXEDorLITERAL.spec.resource.namehas to reference any ‘sub-resource’ ofmetadata.appInstance. For example, if you’re the owner of theclick.prefix, you can grantREADorWRITEaccess to:- the whole
click.prefix, - a sub prefix
click.orders., - a literal topic name
click.orders.france.
- the whole
spec.userPermissioncan beREAD,WRITEorNONE.spec.serviceAccountPermissioncan beREAD,WRITEorNONE.spec.userPermissioncan beREADorWRITE.spec.serviceAccountPermissioncan beREADorWRITE.spec.grantedTohas to be an ApplicationInstance on the same Kafka cluster asmetadata.appInstance.
- Console
- Members of the
grantedToApplicationInstance are given the associated permissions (Read/Write) in the UI over the resources.
- Members of the
- Kafka
- Service account of the
grantedToApplicationInstance is granted to the following ACLs over theresource, depending on thespec.permission:READ: READ, DESCRIBE_CONFIGSWRITE: READ, WRITE, DESCRIBE_CONFIGS
- For Confluent Cloud clusters with their provider settings set to have role bindings enabled, the following Confluent Cloud RBAC role bindings will be created for the service account instead:
READ:DeveloperReadWRITE:DeveloperRead,DeveloperWrite- There’s also an implicit permission granted for subjects when a topic permission is given. If there’s
writeaccess to a topic called example, the service account will also receivewriteaccess to the subject example.
- Service account of the
ApplicationGroup
Creates an application group to directly reflect how your application operates. You can create as many application groups as required - to restrict or enable the different teams that use Console. For example:-
the support team can only have
Readaccess in production environment, - the devOps team has extended access across all environments,
- the engineering team is granted higher permissions in dev environment only.
- API key(s): “AdminToken”, “AppToken”
- Managed with: API, CLI, UI, TF
- Labels support: “MissingLabelSupport”
- CLI
- Terraform
Example
spec.permissions[].appInstancehas to be an application instance associated with this application (metadata.application).spec.permissions[].resourceTypecan beTOPIC,SUBJECT,CONSUMER_GROUPorCONNECTOR. When set toCONNECTOR, an additional fieldspec.permissions[].connectClusteris mandatory and has to be a valid KafkaConnectCluster name.spec.permissions[].patternTypecan bePREFIXEDorLITERAL.spec.permissions[].namehas to reference any ‘sub-resource’ ofmetadata.appInstanceor any subscribed topic. Use*to include to all owned and subscribed resources associated to this appInstance.spec.permissions[].permissionsare valid permissions.spec.membershas to be an email addresses of members that you want to add to this group.spec.externalGroupsa list of LDAP or OIDC groups to sync with this Console group. Members added this way will not appear inspec.memberslist.spec.externalGroupRegexa list of regex patterns that can match to a series of LDAP or OIDC groups to sync with this Console group. Members added this way will not appear inspec.memberslist.
- Console
- Members of the ApplicationGroup are given the associated permissions in the UI over the resources.
- Members of the LDAP or OIDC groups will be automatically added or removed upon login.
Application-managed service account
The Self-service service account is not configured by the central team at theApplicationInstance level.
Instead, the central platform team decides to delegate this responsibility to the application team, which needs to declare their own service account(s) and associated ACLs within the limits of what the ApplicationInstance is allowed to do.
- API key(s): AppToken
- Managed with: API, CLI
- Labels support: Missing
- a service account is claimed by the first application team declaring it.
- ACL operations that are not aligned with Self-service approach or would prevent configured policies to apply, are not allowed on service account:
- Topic: topic name has to refer to a topic owned by ApplicationInstance or allowed by granted ApplicationInstancePermission:
Describe,DescribeConfigs,Read,Write. - Consumer group: resource name has to refer to a consumer group owned by ApplicationInstance with
DescribeandRead. - Cluster:
DescribeandDescribeConfigs. - Delegation token and Transactional Id: both are out of scope, have to be assigned by a central team.
- Topic: topic name has to refer to a topic owned by ApplicationInstance or allowed by granted ApplicationInstancePermission:
- When an ApplicationInstancePermission is removed, we don’t drop the ACLs on the ServiceAccount. Instead, consecutive CLI calls to apply the resource will fail.
TopicPolicy
Topic policies force application teams to conform to topic rules, set at theirApplicationInstance level. Typical use cases include:
- safeguarding from invalid or risky topic configuration
- enforcing a naming convention
- enforcing metadata
Topic policies are not applied automatically. You have to explicitly link them to an ApplicationInstance with
spec.topicPolicyRef.- API key(s): AdminToken
- Managed with: API, CLI, TF
- Labels support: Partial
- CLI
- Terraform
spec.policiesrequire YAML paths that are paths to the topic resource YAML. For example:metadata.nameto create constraints on topic namemetadata.labels.<key>to create constraints on topic label<key>spec.partitionsto create constraints on partitions numberspec.replicationFactorto create constraints on replication factorspec.configs.<key>to create constraints on topic config<key>
spec.policies.<key>.constraintcan beRange,OneOforMatch
Topic policy constraints
There are currently five available constraints:Rangevalidates a range of numbersOneOfvalidates against a list of predefined optionsNoneOfrejects a value if it matches any item in the listMatchvalidates using a regex (regular expression)AllowedKeyslimits a set of keys in the dictionaries
Range
Validates whether the property belongs to a range of numbers (inclusive):- 3600000 (min)
- 36000000 (between min and max)
- 604800000 (max)
- 60000 (below min)
- 999999999 (above max)
OneOf
Validates whether the property is one of the expected values:deletecompact
delete, compact(valid in Kafka but not allowed by policy)deleet(typo)
Match
Validates the property against a regex:wikipedia.links.avrowikipedia.products.json
notwikipedia.products.avro2:^and$prevents anything before and after the patternwikipedia.all-products.avro:(?<event>[a-z0-9]+)prevents anything else than lowercase letters and digits
AllowedKeys
Validates whether the keys are within an allowed key list. Applies to dictionary type (Key/Value maps). Can be used onspec.configs and metadata.labels.
min.insync.replicas is not an allowed key in spec.configs):
Optional flag
Constraints can be marked as optional. In this scenario, the constraint will only be validated if the field exists. E.g.:insync.replicas:
ResourcePolicy
Resource policies enforce rules on theApplicationInstance level. Typical use case include:
- safeguarding from invalid or risky topic or connector configuration
- enforcing naming conventions
- enforcing metadata
Resource policies are not applied automatically. You have to explicitly link them to an ApplicationInstance or Application with
spec.policyRef.- API key(s): AdminToken
- Managed with: API, CLI, TF
- Labels support: Partial
- CLI
- Terraform
spec.targetKindcan beTopic,Connector,SubjectorApplicationGroup.spec.rules[].conditionis a valid CEL expression and will be evaluated against the resource.spec.rules[].errorMessageis a string that will be displayed when the condition is not met.
Moving from TopicPolicy
To replicate the behavior of the TopicPolicy with theResourcePolicy, here’s how you can transform the different policies:
Range constraint
Before:Value constraint
Before:In list constraint
Before:Regex constraint
Before:Tips for CEL expressions
There are multiple things to should consider when writing CEL expressions in the context of resource policies:-
For field-like configuration value/label (that you don’t know the type of) and want to compare to a number, convert it to a string and then to an int like this:
int(string(spec.configs["retention.ms"])). -
For field key that contains dots
.or dashes-, you have to access them with the[]operator:metadata.labels["data-criticality"]. -
For field-like label key/config that can be absent, we recommend adding a check to see if the field is present:
has(metadata.labels.criticality) && {your condition}. If the field has a dot or dash, use"retention.ms" in spec.configs && {your condition}.