Module :
knative
Module Overview
This module offers an annotation based Knative extension implementation for Ballerina.
For examples on the usage of the operations, see the AWS Lambda Deployment Example.
Annotation Usage Sample:
import ballerina/http;
import ballerina/log;
import ballerina/knative;
@knative:Service {
name:"hello"
}
listener http:Listener helloEP = new(9090);
@http:ServiceConfig {
basePath: "/helloWorld"
}
service helloWorld on helloEP {
resource function sayHello(http:Caller caller, http:Request request) {
var responseResult = caller->respond("Hello, World from service helloWorld ! ");
if (responseResult is error) {
log:printError("error responding", responseResult);
}
}
}
| ConfigMap |
Knative Config Map volume mount. |
| ConfigMapKeyRef |
Value from config map key. |
| ConfigMapKeyValue |
Value for config map key. |
| ConfigMapMount |
Secret volume mount configurations for knative. |
| FieldRef |
Value from field. |
| FieldValue |
Value for a field. |
| FileConfig |
External file type for docker. |
| Metadata |
Knative annotation configuration. |
| PodAutoscalerConfig |
Knative Horizontal Pod Autoscaler configuration. |
| PodTolerationConfiguration |
Pod toleration configuration. |
| ProbeConfiguration |
Probing configuration. |
| ResourceFieldRef |
Value from resource field. |
| ResourceFieldValue |
Value for resource field. |
| Secret |
Knative secret volume mount. |
| SecretKeyRef |
Value from secret key. |
| SecretKeyValue |
Value for a secret key. |
| SecretMount |
Secret volume mount configurations for knative. |
| ServiceConfiguration |
Knative service configuration. |
| IMAGE_PULL_POLICY_IF_NOT_PRESENT |
Pull image if it is not present for knative service. |
| IMAGE_PULL_POLICY_ALWAYS |
Always pull the image for knative service. |
| IMAGE_PULL_POLICY_NEVER |
Never pull the image for knative service. |
| EXISTS_OPERATION | |
| EQUAL_OPERATION | |
| TOLERATION_EFFECT_NO_SCHEDULE | |
| TOLERATION_EFFECT_PREFER_NO_SCHEDULE | |
| TOLERATION_EFFECT_NO_EXECUTE |
| ConfigMap |
@knative:ConfigMap annotation to configure config maps. |
| HPA |
@knative:HPA annotation to configure horizontal pod autoscaler yaml. |
| Secret |
@knative:Secret annotation to configure secrets. |
| Service |
| ImagePullPolicy |
Image pull policy type field for kubernetes deployment and jobs. |
| TolerationEffect |
Types of toleration effects for pods. |
| TolerationOperator |
Type of operations between key and value of a toleration. |