Skip to main content Link Search Menu Expand Document (external link)

Built-in trait types

The platform provides built-in support for the following trait definitions. You may use any of the trait definitions to modify aspects of the defined components. This enables customization of the components without altering their structure. For example, adding an ingress to a component can be done with traits instead of changing the component definition.

Exposing services

Trait type Description
napptive-ingress Expose a component to the outside with a K8s ingress.
gateway Expose a component to the outside with a K8s ingress.

Modifying generated resources

Trait type Description
annotations Add annotations to the generated K8s pods.
labels Add labels to the generated K8s pods.
env Add environments variables to the container
resource Add resource requests a limits to manage the quota.
container-image Set the container image to be used.
command Modify the command that will be launched by the container.
json-merge-patch Patch the generated component using JSON with a merge patch strategy.
json-patch Patch the generated component using JSON
lifecycle Add lifecycle hooks to every container in the component.
service-binding Bind secrets and configmaps to a component.
storage Add storage to a component

Adding containers

Trait type Description
init-container Add an init-container to the component using a shared volume.
sidecar Attach a sidecar to a component

Scaling components

Trait type Description
cpuscaler Automatically scale the component based on CPU usage
scaler Set a fixed number of replicas for a component.

What’s next