For a detailed description of this function example, you can refer to the following blogs:
OpenFunction 应用系列之一: 以 Serverless 的方式实现 Kubernetes 日志告警
or
Serverless Use Case: Elastic Kubernetes Log Alerts with OpenFunction and Kafka
Follow this guide to install OpenFunction.
Follow this guide to install a Kafka server named kafka-logs-receiver
and a Topic named logs
.
Follow this guide to create a registry credential.
Create logs handler function:
kubectl apply -f logs-handler-function.yaml
The logs handler function is then driven by messages from the logs topic in Kafka.