All-in-One Quick Deployment

Created:2023-10-04 Last Modified:2024-08-26

This document was translated by ChatGPT

#1. Introduction

To facilitate installation and deployment, we provide two deployment methods for deepflow-server: Kubernetes and Docker Compose. In this chapter, we will start with an All-in-One DeepFlow and introduce how to deploy a DeepFlow experience environment.

#2. Deploying with Kubernetes

#2.1 Preparation

#2.1.1 Resource Requirements

  • It is recommended that the minimum specifications for the virtual machine used for deployment are 4C8G.

#2.1.2 Deploy All-in-One K8s

Use sealos (opens new window) to quickly deploy a K8s cluster:

# install sealos
curl -o /usr/bin/sealos https://deepflow-ce.oss-cn-beijing.aliyuncs.com/sealos/sealos && \
    chmod +x /usr/bin/sealos

# install All-in-One kubernetes cluster
IP_ADDR="1.2.3.4"  # FIXME: Your IP address
PASSWORD="x"       # FIXME: Your SSH root password
sealos run labring/kubernetes:v1.24.0 labring/calico:v3.22.1 --masters $IP_ADDR -p $PASSWORD

# remove kubernetes node taint
kubectl taint node node-role.kubernetes.io/master- node-role.kubernetes.io/control-plane- --all
1
2
3
4
5
6
7
8
9
10
11

#2.1.3 Install Helm

DeepFlow uses Helm (opens new window) for deployment. The installation method is:

curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
1
2
3

You can also use sealos to install helm:

sealos run labring/helm:v3.8.2
1

#2.2 Deploy All-in-One DeepFlow

Use Helm to install All-in-One DeepFlow:

helm repo add deepflow https://deepflowio.github.io/deepflow
helm repo update deepflow # use `helm repo update` when helm < 3.7.0
cat << EOF > values-custom.yaml
global:
  allInOneLocalStorage: true
EOF
helm install deepflow -n deepflow deepflow/deepflow --create-namespace \
  -f values-custom.yaml
1
2
3
4
5
6
7
8
helm repo add deepflow https://deepflow-ce.oss-cn-beijing.aliyuncs.com/chart/stable
helm repo update deepflow # use `helm repo update` when helm < 3.7.0
cat << EOF > values-custom.yaml
global:
  allInOneLocalStorage: true
  image:
      repository: registry.cn-beijing.aliyuncs.com/deepflow-ce
EOF
helm install deepflow -n deepflow deepflow/deepflow --create-namespace \
  -f values-custom.yaml
1
2
3
4
5
6
7
8
9
10

Note:

  • We recommend saving the contents of the helm --set parameter in a separate yaml file, refer to the Advanced Configuration section.

#2.3 Access Grafana Page

The output of the helm deployment of DeepFlow provides commands to get the URL and password for accessing Grafana. Example output:

NODE_PORT=$(kubectl get --namespace deepflow -o jsonpath="{.spec.ports[0].nodePort}" services deepflow-grafana)
NODE_IP=$(kubectl get nodes -o jsonpath="{.items[0].status.addresses[0].address}")
echo -e "Grafana URL: http://$NODE_IP:$NODE_PORT  \nGrafana auth: admin:deepflow"
1
2
3

Example output after executing the above command:

Grafana URL: http://10.1.2.3:31999
Grafana auth: admin:deepflow
1
2

#3. Deploying with Docker Compose

#3.1 Preparation

#3.1.1 Resource Requirements

  • It is recommended that the minimum specifications for the virtual machine used for deployment are 4C8G.

#3.1.2 Deploy Docker

Refer to the Docker (opens new window) documentation to deploy Docker:

curl -fsSL https://get.docker.com -o install-docker.sh
sudo sh install-docker.sh
1
2

#3.1.3 Deploy Docker Compose

Refer to the Docker Compose (opens new window) documentation to deploy Docker:

DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p $DOCKER_CONFIG/cli-plugins
curl -SL https://github.com/docker/compose/releases/download/v2.24.0/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
1
2
3
4

#3.2 Deploy All-in-One DeepFlow

Set the environment variable DOCKER_HOST_IP to the IP of the physical network card of the machine

unset DOCKER_HOST_IP
DOCKER_HOST_IP="10.1.2.3"  # FIXME: Deploy the environment machine IP
1
2

Download and install All-in-One DeepFlow

wget  https://deepflow-ce.oss-cn-beijing.aliyuncs.com/pkg/docker-compose/latest/linux/deepflow-docker-compose.tar
tar -zxf deepflow-docker-compose.tar
sed -i "s|FIX_ME_ALLINONE_HOST_IP|$DOCKER_HOST_IP|g" deepflow-docker-compose/docker-compose.yaml
docker compose -f deepflow-docker-compose/docker-compose.yaml up -d
1
2
3
4

#3.3 Deploy DeepFlow Agent

Refer to Monitoring Traditional Servers to deploy deepflow-agent for this server.

#3.4 Access Grafana Page

The port for DeepFlow Grafana deployed using Docker Compose is 3000, and the user password is admin:deepflow.

For example, if the machine's IP is 10.1.2.3, the Grafana access URL is http://10.1.2.3:3000

#3.5 Limitations

  • In this deployment mode, both deepflow-server and clickhouse do not support horizontal scaling.
  • Since some capabilities of deepflow-server rely on Kubernetes, the docker-compose deployment mode cannot monitor cloud servers. You can refer to Monitoring Traditional Servers to monitor cloud hosts.

#4. Download deepflow-ctl

deepflow-ctl is a command-line tool for managing DeepFlow. It is recommended to download it to the K8s Node where deepflow-server is located for subsequent use:

curl -o /usr/bin/deepflow-ctl https://deepflow-ce.oss-cn-beijing.aliyuncs.com/bin/ctl/stable/linux/$(arch | sed 's|x86_64|amd64|' | sed 's|aarch64|arm64|')/deepflow-ctl
chmod a+x /usr/bin/deepflow-ctl
1
2

#5. Next Steps