Monitoring Serverless Pod

Created:2023-10-04 Last Modified:2025-08-29

This document was translated by ChatGPT

#1. Introduction

DeepFlow Agent can be deployed as a Sidecar inside a Serverless Pod. Assuming you have already deployed DeepFlow Server in a K8s cluster, this chapter describes how to monitor applications inside a Serverless Pod.

#2. Deployment Topology

#3. Deploy deepflow-agent

Modify the value file to deploy deepflow-agent as a daemonset and inject it as a sidecar, and obtain clusterNAME via deepflow-ctl domain list:

cat << EOF > values-custom.yaml
deployComponent:
- "watcher"
- "daemonset"
tkeSidecar: true
daemonsetWatchDisabled: true
clusterNAME: $clusterNAME  # FIXME: domain name
EOF

helm install deepflow-agent -n deepflow deepflow/deepflow-agent --version 6.6.018 --create-namespace -f values-custom.yaml
1
2
3
4
5
6
7
8
9
10

The above command will deploy two sets of deepflow-agent:

  • watcher: A deepflow-agent deployment used to synchronize K8s resources.
    • During deployment, the environment variable K8S_WATCH_POLICY=watch-only will be automatically injected. In this case, deepflow-agent will only synchronize K8s resources and will not collect observability data.
  • daemonset: Injects deepflow-agent as a sidecar into each serverless pod to collect observability data.
    • Note: When there is no watcher-type deepflow-agent running, deepflow-server will elect a daemonset-type deepflow-agent to synchronize K8s resources.
    • Therefore, to ensure that such deepflow-agents do not consume more resources due to being elected for K8s resource synchronization, the environment variable K8S_WATCH_POLICY=watch-disabled is automatically injected for them.

#4. Next Steps