Here, you will find information to use the Core extensions.
More information:
This is the multi-page printable view of this section. Click here to print.
Here, you will find information to use the Core extensions.
More information:
Here, you will find the list of core Resource Repositories
supported for Jikkou.
More information:
The GithubResourceRepository
can be used to load resources from a public or private GitHub repository.
jikkou {
repositories = [
{
# Name of your local repositories
name = "<string>"
# The fully qualified class name (FQCN) of the repository
type = io.streamthoughts.jikkou.core.repository.GithubResourceRepository
config {
# Specify the GitHub repository in the format 'owner/repo'
repository = "<string>"
# Specify the branch or ref to load resources from
branch = main
# Specify the paths/directories in the repository containing the resource definitions
paths = [] # Default: **/*.{yaml,yml}
# Specify the pattern used to match YAML file paths.
# Pattern should be passed in the form of 'syntax:pattern'. The "glob" and "regex" syntaxes are supported (e.g.: **/*.{yaml,yml}).
# If no syntax is specified the 'glob' syntax is used.
file-pattern = "**/*.{yaml,yml}"
# Specify the locations of the values-files containing the variables to pass into the template engine built-in object 'Values'.
values-files = []
# Specify the pattern used to match YAML file paths when one or multiple directories are given through the `values-files` property.
# Pattern should be passed in the form of 'syntax:pattern'. The "glob" and "regex" syntaxes are supported (e.g.: **/*.{yaml,yml}).
# If no syntax is specified the 'glob' syntax is used.
values-file-name = "<string>" # Default: **/*.{yaml,yml}
# The labels to be added to all resources loaded from the repository
labels {
<label_key> = <label_value>
}
}
}
]
}
The LocalResourceRepository
can be used to load resources from local files or directories.
jikkou {
repositories = [
{
# Name of your local repositories
name = "<string>"
# The fully qualified class name (FQCN) of the repository
type = io.streamthoughts.jikkou.core.repository.LocalResourceRepository
config {
# Specify the locations containing the definitions for resources in a YAML file, a directory.
files = []
# Specify the pattern used to match YAML file paths when one or multiple directories are given through the `files` property.
# Pattern should be passed in the form of 'syntax:pattern'. The "glob" and "regex" syntaxes are supported (e.g.: **/*.{yaml,yml}).
# If no syntax is specified the 'glob' syntax is used.
file-name = "<string>" # Default: **/*.{yaml,yml}
# Specify the locations of the values-files containing the variables to pass into the template engine built-in object 'Values'.
values-files = []
# Specify the pattern used to match YAML file paths when one or multiple directories are given through the `values-files` property.
# Pattern should be passed in the form of 'syntax:pattern'. The "glob" and "regex" syntaxes are supported (e.g.: **/*.{yaml,yml}).
# If no syntax is specified the 'glob' syntax is used.
values-file-name = "<string>" # Default: **/*.{yaml,yml}
# The labels to add to all resources loaded from the repository
labels {
<label_key> = <label_value>
}
}
}
]
}
Here, you will find the list of core resources supported for Jikkou.
More information:
You can use a ConfigMap
to define reusable data in the form of key/value pairs that can then be referenced and used by
other resources.
---
apiVersion: "core.jikkou.io/v1beta2"
kind: ConfigMap
metadata:
name: '<CONFIG-MAP-NAME>' # Name of the ConfigMap (required)
data: # Map of key-value pairs (required)
<KEY_1>: "<VALUE_1>"
For example, the below ConfigMap
show how to define default config properties namedcKafkaTopicConfig
that can then
reference and used to define multiple KafkaTopic. resources.
---
apiVersion: "core.jikkou.io/v1beta2"
kind: ConfigMap
metadata:
name: 'KafkaTopicConfig'
data:
cleanup.policy: 'delete'
min.insync.replicas: 2
retention.ms: 86400000 # (1 day)
The ValidatingResourcePolicy
resource is used to define validation rules applied to resources or resource changes before they are applied by Jikkou.
It allows enforcing organizational policies, validating constraints, or filtering out undesired operations.
Each policy can select one or more resource kinds and define rules expressed in Google CEL (Common Expression Language).
Rules can either fail the execution or filter the invalid resources, depending on the configured failurePolicy
.
apiVersion: core.jikkou.io/v1
kind: ValidatingResourcePolicy
metadata:
name: <string> # Required. Unique policy name.
spec:
failurePolicy: <string> # Required. One of: FAIL | FILTER
selector:
matchingStrategy: <string> # Optional. One of: ALL | ANY (default: ALL)
matchResources:
- apiVersion: <string> # Optional. API version to match (e.g., core.jikkou.io/v1)
kind: <string> # Required. Resource kind (e.g., KafkaTopic)
matchLabels:
- key: <string> # Label key to match
operator: <string> # One of: In | NotIn | Exists | DoesNotExist
values: [<string>] # Optional list of values
matchExpressions:
- <string> # CEL expression
rules:
- name: <string> # Required. Rule identifier.
expression: <string> # Required. A CEL expression evaluated against the resource.
message: <string> # Optional. Static message returned when the rule fails.
messageExpression: <string> # Optional. CEL expression to generate a dynamic error message.
Field | Type | Required | Description |
---|---|---|---|
spec.failurePolicy | string | Yes | Defines the policy behavior when validation fails. Possible values: • FAIL → stop execution with an error.• FILTER → skip the invalid resource(s) but continue processing others. |
spec.selector.matchingStrategy | string | No | Strategy for combining multiple selectors. Possible values: • ALL → resource must match all conditions.• ANY → resource must match at least one condition.Default: ALL . |
spec.selector.matchResources | list | No | Selects resources by API version and kind. |
spec.selector.matchLabels | list | No | Selects resources based on labels, using operators (In , NotIn , Exists , DoesNotExist ). |
spec.selector.matchExpressions | list | No | Selects resources using CEL expressions for advanced filtering. |
spec.rules | list | Yes | A list of validation rules. |
spec.rules[].name | string | Yes | A unique identifier for the rule. |
spec.rules[].expression | string | Yes | A CEL expression evaluated against the resource. The rule fails when the expression evaluates to true . |
spec.rules[].message | string | No | Static error message returned when validation fails. |
spec.rules[].messageExpression | string | No | CEL expression returning a dynamic error message string. |
Policies define which resources they apply to using a selector.
A selector can combine multiple strategies to target resources based on:
In
, NotIn
, Exists
, DoesNotExist
).Strategy | Description |
---|---|
ALL | The resource must match all specified selectors (matchResources , matchLabels , and matchExpressions ). |
ANY | The resource is selected if it matches at least one of the specified selectors. |
Default: ALL
matchResources
Selects resources by API version and/or kind.
matchResources:
- apiVersion: core.jikkou.io/v1
kind: KafkaTopic
apiVersion
→ Optional. Restricts matching to a specific API group/version.kind
→ Required. Matches the resource kind (e.g. KafkaTopic
, KafkaTopicChange
).matchLabels
Selects resources based on their metadata labels using operators.
matchLabels:
- key: environment
operator: In
values: ["prod", "staging"]
- key: team
operator: NotIn
values: ["test"]
- key: critical
operator: Exists
Supported operators:
Operator | Description |
---|---|
In | Matches if the label value is in the list of values. |
NotIn | Matches if the label value is not in the list of values. |
Exists | Matches if the label key is defined (value doesn’t matter). |
DoesNotExist | Matches if the label key is not defined. |
matchExpressions
Selects resources using CEL expressions for maximum flexibility.
matchExpressions:
- "resource.metadata.name.startsWith('topic-')"
- "resource.spec.partitions > 10"
Examples:
topic-
.DELETE
operations on KafkaTopic
resourcesapiVersion: core.jikkou.io/v1
kind: ValidatingResourcePolicy
metadata:
name: KafkaTopicPolicy
spec:
failurePolicy: FILTER
selector:
matchResources:
- kind: KafkaTopicChange
rules:
- name: FilterDeleteOperation
expression: "size(resource.spec.changes) > 0 && resource.spec.op == 'DELETE'"
messageExpression: "'Operation ' + resource.spec.op + ' on topics is not authorized'"
This policy prevents delete operations on Kafka topics from being executed by filtering them out.
KafkaTopic
apiVersion: core.jikkou.io/v1
kind: ValidatingResourcePolicy
metadata:
name: KafkaTopicPolicy
spec:
failurePolicy: FAIL
selector:
matchResources:
- kind: KafkaTopic
rules:
- name: MaxTopicPartitions
expression: "resource.spec.partitions >= 50"
messageExpression: "'Topic partition MUST be inferior to 50, but was: ' + string(resource.spec.partitions)"
- name: MinTopicPartitions
expression: "resource.spec.partitions < 3"
message: "Topic must have at-least 3 partitions"
This policy enforces a minimum of 3 partitions and a maximum of 49 partitions for Kafka topics.
prod
environmentselector:
matchingStrategy: ALL
matchResources:
- kind: KafkaTopic
matchLabels:
- key: environment
operator: In
values: ["prod"]
critical=true
selector:
matchingStrategy: ANY
matchResources:
- kind: KafkaTopic
matchLabels:
- key: critical
operator: In
values: ["true"]
selector:
matchExpressions:
- "resource.spec.replicationFactor < 3"