Service Descriptor reference
Kalix service
A Kalix service resource. This is used by the kalix service apply
command, described in deploying a service with a descriptor.
Field | Type | Description |
---|---|---|
name |
string required |
The name of the service |
service |
KalixServiceSpec required |
Specification for the Kalix service |
KalixServiceSpec
The specification for a Kalix service.
Field | Type | Description |
---|---|---|
image |
string required |
The name of the docker image for the service container |
env |
Environment variables to be set in the service’s container |
|
jwt |
JWT configuration for the Kalix service |
|
resources |
Resource configuration for the Kalix service, including instance size and autoscaling |
|
volumeMounts |
Volume mounts to mount in the service’s container. |
|
telemetry |
Telemetry configuration for the service |
KalixEnvVar
An environment variable declaration.
Field | Type | Description |
---|---|---|
name |
string required |
The name of the environment variable |
value |
string |
The value of the environment variable. Either this must be set, or valueFrom must be set, but not both. |
valueFrom |
Configuration for where to get the value of the environment variable from. Either this must be set, or value must be set, but not both. |
KalixEnvVarSource
The source for an environment variable.
Field | Type | Description |
---|---|---|
secretKeyRef |
KalixSecretKeyRef required |
A reference to a secret. |
KalixSecretKeyRef
A reference to a particular key in a particular secret, used by environment variables.
Field | Type | Description |
---|---|---|
name |
string required |
The name of a configured Kalix secret |
key |
string required |
The name of a key in the specified Kalix secret |
optional |
boolean |
Whether the secret or its key must exist. If true, the service will fail to deploy if the secret or its key doesn’t exist. If false, the service will be deployed with the environment variable unset if the secret doesn’t or its key doesn’t exist. |
KalixServiceJwt
The JWT configuration for a Kalix service.
Field | Type | Description |
---|---|---|
keys |
The JWT keys for the service to use when signing and validating JWTs. The order of this list is important. When signing or validating, the first matching key will be used, according to the following rules. For validating:
For signing:
|
KalixJwtKey
A key that can be used for Kalix’s JWT support.
Field | Type | Description |
---|---|---|
keyId |
string required |
The id of the key. When signing, it will be placed in the key id parameter (kid) of the JWT header. It may be used for matching incoming keys when validating. It is important that, for a given issuer, if two keys have the same id, that those keys must be the same key. Ideally, key ids should be unique across all services. The key id allows JWT keys to be rotated: a new key can be configured with a lower priority on all services that use it. Once that change is pushed out, then the key’s priority, i.e., the order in the list, can be increased so that it is now the key that gets used for signing. Finally, once all JWTs signed by the old key have expired, the old key can be removed. |
issuer |
string |
The issuer of tokens that use this key. If a token being signed or validated contains an issuer (iss) claim, this will be matched against it. This allows multiple keys for different issuers to be provisioned without conflicting. Setting this parameter is also important if you have keys from multiple issuers, but you don’t trust that one of them won’t try and spoof the other. Since it pins a particular set of keys to only be used to validate that issuer’s token, if the other tries to spoof it, validation will fail. |
algorithm |
string required |
The algorithm to use this key for. When validating, this secret may be used if the secret for this algorithm is compatible with the algorithm that the token being validated was signed with. Valid values are:
|
secret |
KalixObjectRef required |
The configured Kalix secret to use for signing or validating. This must be a reference to a Kalix secret. The secret must have the following keys defined, depending on the algorithm used:
|
KalixObjectRef
A reference to a Kalix object, such as a configured secret.
Field | Type | Description |
---|---|---|
name |
string required |
The name of the object. |
KalixServiceResources
The configuration for the resources used by a Kalix service.
Field | Type | Description |
---|---|---|
instanceType |
string |
The type of instance to use. Supported values are:
|
autoscaling |
The autoscaling configuration for a Kalix service. Autoscaling is only supported for non-trial projects. |
KalixServiceAutoscaling
The configuration for how a Kalix service is scaled in response to load.
Field | Type | Description |
---|---|---|
minInstances |
int |
The minimum instances of a service that should be available. Must be at least 1, and no greater than maxInstances. May not be greater than 10. |
maxInstances |
int |
The maximum instances of a service that should be available. Must be at least 1, and no less than minInstances. May not be greater than 10. |
cpuUsageThreshold |
int |
The target CPU usage for autoscaling to achieve. Once CPU usage across all instances exceeds this, the service will be scaled up. Must be at least 1 and no greater than 100. |
KalixVolumeMount
A volume that should be mounted into the services container.
Field | Type | Description |
---|---|---|
mountPath required |
string |
Path within the container at which the volume should be mounted. Must not contain ':'. |
secret |
A secret that should be used to populate this volume. |
KalixSecretVolumeSource
Adapts a secret into a volume that can be mounted into the service’s container.
Field | Type | Description |
---|---|---|
secretName required |
string |
The name of a secret in the Kalix service’s project to mount. |
defaultMode |
int |
Mode bits to set the permissions on created files from the secret by default. Must be an octal value between 0000 and 0777, or a decimal value between 0 and 511. Defaults to 0644. |
optional |
boolean |
Specifies whether the container should fail to start if the secret doesn’t exist. |
Kalix route
A Kalix route describes the way ingress traffic is routed to Kalix services. It is used by the kalix route update
command, described in working with route descriptors.
Field | Type | Description |
---|---|---|
host |
string required |
The host that this route is for. This hostname must be configured as one of the Kalix project hostnames. |
routes |
[]KalixRouteRule required |
The routing rules defined for this route. |
tls |
The TLS configuration for this route. |
|
validation |
Validation, such as authentication, for the route. |
|
corsPolicy |
The CORS policy for this route. If present, will enable CORS support for the route. |
KalixRouteRule
A Kalix route rule is a rule that defines how requests should be matched, and what the destination for those matched requests should be.
Field | Type | Description |
---|---|---|
name |
string |
A name for this rule. Only used for debugging purposes. |
prefix |
string required |
The prefix to match for this route. Must start with a |
route |
KalixRouteDestination required |
The destination for requests matched by this rule. |
KalixRouteDestination
A destination for a routed Kalix requested.
Field | Type | Description |
---|---|---|
service |
string |
The name of a Kalix service in this project that requests should be routed to |
KalixRouteTls
TLS configuration for a Kalix route.
Field | Type | Description |
---|---|---|
clientValidationCa |
The name of a Kalix secret of type CA that should be used to validate client certificates provided to the server. The presence of this configuration will cause any requests that do not provide a client certificate, or do not provide a certificate that is trusted by this CA, to be rejected. |
|
serverCertificate |
The name of a Kalix secret of type TLS that should be used as the servers certificate. Allows a custom TLS certificate to be used for the host, instead of Kalix’s automatic certificate provisioning from Let’s Encrypt. |
KalixRouteValidation
Validation rules for a route. This can be used to configure authentication and authorization rules.
Field | Type | Description |
---|---|---|
clientCertificate |
Validation to be done on the client certificate. This can only be used when a |
|
httpBasic |
HTTP Basic authentication configuration. |
KalixRouteValidationClientCertificate
Client certificate validation rules for a route.
Field | Type | Description |
---|---|---|
subjectMatches |
[]StringMatcher required |
A list of matchers to apply to the client certificate subject. Validation passes if at least one of the matchers matches either the Common Name (CN) in the subject on the client certificate, or one of the DNS Subject Alternative Names of the certificate. |
StringMatcher
A string matcher. Exactly one match rule must be specified.
Field | Type | Description |
---|---|---|
exact |
string |
Perform an exact match on the value. |
hasPrefix |
string |
Matches if the value has the given prefix. |
hasSuffix |
string |
Matches if the value has the given suffix. |
regex |
string |
Matches if the value matches the given regular expression. |
KalixRouteValidationHttpBasic
HTTP Basic authentication configured for a route.
Field | Type | Description |
---|---|---|
realm |
string required |
The name of the realm to return in a |
passwordHashes |
map<string, string> required |
A map of username to password hashes to validate the authentication against. The password hashes must be hashed in the format
For example:
To generate a password hash in the above format, the following command can be used:
Note that the use of unsalted, computationally cheap hash algorithms implies that only passwords that are strong and randomly generated, not reused between accounts or services, should be used. For service to service communication which this feature is intended for use by, where passwords are chosen by system operators rather than end users, this requirement can easily be implemented. |
Kalix observability
A Kalix observability descriptor describes how metrics, logs, and traces are exported to third party services. It is used by the kalix project observability apply
command. Exporters can be optionally defined as default exporter, meaning it will be used for the metrics, logs, and traces, but can then be optionally overridden for each of metrics, logs, and traces.
Field | Type | Description |
---|---|---|
exporter |
The default exporter used for metrics, logs, and traces. Will be used for each unless a respective exporter in |
|
metrics |
The exporter to use for metrics. Overrides the exporter defined in |
|
logs |
The exporter to use for logs. Overrides the exporter defined in |
|
traces |
The exporter to use for traces. Overrides the exporter defined in |
KalixObservabilityDefault
The default exporter configuration for metrics, logs, and traces. At most one default exporter may be configured.
Field | Type | Description |
---|---|---|
kalixConsole |
object |
If defined, metrics will be exported to the Kalix Console. There are no configuration parameters for the Kalix console exporter, it should be declared as an empty object. |
otlp |
If defined, will export metrics, logs, and traces to an OpenTelemetry collector using the OTLP gRPC protocol. |
|
splunkHec |
If defined, will export metrics and logs to a Splunk platform instance, using the Splunk HTTP Event Collector. |
|
googleCloud |
If defined, will export metrics, logs, and traces to Google Cloud. |
KalixObservabilityMetrics
The metrics exporter configuration. At most one metrics exporter may be configured. If a default exporter is configured, the exporter configured here will override that exporter for metrics.
Field | Type | Description |
---|---|---|
kalixConsole |
object |
If defined, metrics will be exported to the Kalix Console. There are no configuration parameters for the Kalix console exporter, it should be declared as an empty object. |
otlp |
If defined, will export metrics to an OpenTelemetry collector using the OTLP gRPC protocol. |
|
prometheuswrite |
If defined, will export metrics using the Prometheus remote write protocol. |
|
splunkHec |
If defined, will export metrics to a Splunk platform instance, using the Splunk HTTP Event Collector. |
|
googleCloud |
If defined, will export metrics to Google Cloud. |
KalixObservabilityTraces
The traces exporter configuration. At most one traces exporter may be configured. If a default exporter is configured, the exporter configured here will override the default exporter for traces.
Field | Type | Description |
---|---|---|
kalixConsole |
object |
If defined, metrics will be exported to the Kalix Console. There are no configuration parameters for the Kalix console exporter, it should be declared as an empty object. |
otlp |
If defined, will export traces to an OpenTelemetry collector using the OTLP gRPC protocol. |
|
googleCloud |
If defined, will export traces to Google Cloud. |
KalixObservabilityLogs
The logs exporter configuration. At most one logs exporter may be configured. If a default exporter is configured, the exporter configured here will override that exporter for logs.
Field | Type | Description |
---|---|---|
otlp |
If defined, will export logs to an OpenTelemetry collector using the OTLP gRPC protocol. |
|
splunkHec |
If defined, will export logs to a Splunk platform instance, using the Splunk HTTP Event Collector. |
|
googleCloud |
If defined, will export logs to Google Cloud. |
KalixObservabilityOtlp
Configuration for an OpenTelemetry exporter using the OTLP gRPC protocol.
Field | Type | Description |
---|---|---|
endpoint |
string required |
The endpoint to export OTLP metrics, logs, or traces to, for example, |
tls |
TLS configuration for connections to the OpenTelemetry collector. |
|
headers |
A list of headers to add to outgoing requests. |
KalixObservabilityPrometheusWrite
Configuration for a Prometheus exporter using the Prometheus remote write protocol.
Field | Type | Description |
---|---|---|
endpoint |
string required |
The URL to export Prometheus remote write metrics to, for example, |
tls |
TLS configuration for connections to the Prometheus remote write endpoint. |
|
headers |
A list of headers to add to outgoing requests. |
KalixObservabilitySplunkHec
Configuration for a Splunk HEC exporter to export to Splunk Platform instance using the Splunk HTTP Event Collector.
Field | Type | Description |
---|---|---|
endpoint |
string required |
The URL to export Prometheus remote write metrics to, for example, |
tokenSecret |
KalixSecretKeyRef required |
A reference to the Kalix secret and key containing the Splunk HTTP Event Collector. |
source |
string |
The Splunk source. Identifies the source of an event, that is, where the event originated. In the case of data monitored from files and directories, the source consists of the full pathname of the file or directory. In the case of a network-based source, the source field consists of the protocol and port, such as UDP:514. |
sourceType |
string |
The Splunk source type. Identifies the data structure of an event. A source type determines how the Splunk platform formats the data during the indexing process. Example source types include |
index |
string |
The splunk index, optional name of the Splunk index targeted. |
tls |
TLS configuration for connections to the Splunk HTTP Event Collector. |
KalixObservabilityGoogleCloud
Configuration for a Google Cloud exporter.
Field | Type | Description |
---|---|---|
serviceAccountSecret |
KalixObjectRef required |
A Kalix secret containing a Google service account JSON key, in a property called The service account used must have the |
KalixObservabilityTls
Configuration for TLS connections to various exporters.
Field | Type | Description |
---|---|---|
insecure |
boolean |
If true, will not use TLS. Defaults to false. |
insecureSkipVerify |
boolean |
If true, will not verify the certificate presented by the server it connects to. Has no effect if |
clientCertSecret |
If configured, will use the Kalix TLS secret as a client certificate to authenticate outgoing connections to the server with. |
|
caSecret |
If configured, will use the certificate chain defined in the Kalix TLS CA secret to verify the server certificate provided by the server. |
KalixObservabilityHeader
Configuration for a header. Only one value field may be defined.
Field | Type | Description |
---|---|---|
name |
string |
The name of the header. |
value |
string |
The value for the header. Either this, or |
valueFrom |
The source of the value for the header. Either this, or |
KalixObservabilityHeaderSource
The source for a header value.
Field | Type | Description |
---|---|---|
secretKeyRef |
KalixSecretKeyRef required |
A reference to a secret. |