在Ubuntu20.04上部署社区版本的deepflow,主要参考https://deepflow.yunshan.net/docs/zh/install/all-in-one/?from=github,出于简化的目的,只部署all-in-one

部署k8s

文档推荐用sealos部署k8s,但是实测下来,速度直接劝退

root@mypc:~# sealos run labring/kubernetes:v1.24.0 labring/calico:v3.22.1 
2022-10-27 09:27:18 [INFO] start to install app in this cluster
Resolving "labring/kubernetes" using unqualified-search registries (/etc/containers/registries.conf)
Trying to pull docker.io/labring/kubernetes:v1.24.0...
Getting image source signatures
Copying blob 181ce8e33082 [--------------------------------------] 1007.3KiB / 422.7MiB

转而使用KubeKey部署

root@mypc:~# export KKZONE=cn
root@mypc:~# curl -sfL https://get-kk.kubesphere.io | VERSION=v2.0.0 sh -

Downloading kubekey v2.0.0 from https://kubernetes.pek3b.qingstor.com/kubekey/releases/download/v2.0.0/kubekey-v2.0.0-linux-amd64.tar.gz ...


Kubekey v2.0.0 Download Complete!

root@mypc:~# 
root@mypc:~# 
root@mypc:~# ls -lt
total 68472
-rw-r--r-- 1 root root   16348932 10月 27 09:50 kubekey-v2.0.0-linux-amd64.tar.gz
-rwxr-xr-x 1 1001 docker 53764096 3月   8  2022 kk
root@mypc:~# 

root@mypc:~# chmod +x kk
root@mypc:~# 

root@mypc:~# ./kk create cluster --with-kubernetes v1.21.5


 _   __      _          _   __           
| | / /     | |        | | / /           
| |/ / _   _| |__   ___| |/ /  ___ _   _ 
|    \| | | | '_ \ / _ \    \ / _ \ | | |
| |\  \ |_| | |_) |  __/ |\  \  __/ |_| |
\_| \_/\__,_|_.__/ \___\_| \_/\___|\__, |
                                    __/ |
                                   |___/

10:06:43 CST [NodePreCheckModule] A pre-check on nodes
10:06:43 CST success: [mypc]
10:06:43 CST [ConfirmModule] Display confirmation form
+------+------+------+---------+----------+-------+-------+-----------+--------+----------+------------+-------------+------------------+--------------+
| name | sudo | curl | openssl | ebtables | socat | ipset | conntrack | chrony | docker   | nfs client | ceph client | glusterfs client | time         |
+------+------+------+---------+----------+-------+-------+-----------+--------+----------+------------+-------------+------------------+--------------+
| mypc | y    | y    | y       | y        | y     | y     | y         |        | 20.10.12 |            |             |                  | CST 10:06:43 |
+------+------+------+---------+----------+-------+-------+-----------+--------+----------+------------+-------------+------------------+--------------+

This is a simple check of your environment.
Before installation, you should ensure that your machines meet all requirements specified at
https://github.com/kubesphere/kubekey#requirements-and-recommendations

Continue this installation? [yes/no]: yes

#省略若干log
Installation is complete.

Please check the result using the command:

        kubectl get pod -A

root@mypc:~# 

root@mypc:~# kubectl get pod -A
NAMESPACE     NAME                                       READY   STATUS    RESTARTS   AGE
kube-system   calico-kube-controllers-846b5f484d-vz9sh   1/1     Running   0          48s
kube-system   calico-node-p6qhj                          1/1     Running   0          60s
kube-system   coredns-5495dd7c88-dvjn8                   1/1     Running   0          4m30s
kube-system   coredns-5495dd7c88-frfcz                   1/1     Running   0          4m30s
kube-system   kube-apiserver-mypc                        1/1     Running   0          4m38s
kube-system   kube-controller-manager-mypc               1/1     Running   0          4m38s
kube-system   kube-proxy-cfhc8                           1/1     Running   0          4m30s
kube-system   kube-scheduler-mypc                        1/1     Running   0          4m38s
kube-system   nodelocaldns-8ndf7                         1/1     Running   0          63s
root@mypc:~# 

部署deepflow

粘贴下面的命令到终端

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
grafana:
  image:
    repository: registry.cn-beijing.aliyuncs.com/deepflow-ce/grafana
EOF
helm install deepflow -n deepflow deepflow/deepflow --create-namespace \
  -f values-custom.yaml

终端最后显示

NAME: deepflow
LAST DEPLOYED: Thu Oct 27 10:13:37 2022
NAMESPACE: deepflow
STATUS: deployed
REVISION: 1
NOTES:
██████╗ ███████╗███████╗██████╗ ███████╗██╗      ██████╗ ██╗    ██╗
██╔══██╗██╔════╝██╔════╝██╔══██╗██╔════╝██║     ██╔═══██╗██║    ██║
██║  ██║█████╗  █████╗  ██████╔╝█████╗  ██║     ██║   ██║██║ █╗ ██║
██║  ██║██╔══╝  ██╔══╝  ██╔═══╝ ██╔══╝  ██║     ██║   ██║██║███╗██║
██████╔╝███████╗███████╗██║     ██║     ███████╗╚██████╔╝╚███╔███╔╝
╚═════╝ ╚══════╝╚══════╝╚═╝     ╚═╝     ╚══════╝ ╚═════╝  ╚══╝╚══╝ 

An automated observability platform for cloud-native developers.

# deepflow-agent Port for receiving trace, metrics, and log

deepflow-agent service: deepflow-agent.deepflow
deepflow-agent Host listening port: 38086

# Get the Grafana URL to visit by running these commands in the same shell

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"
root@mypc:~# 

获取登录信息(url/username/password)

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

打开页面,是grafana
在这里插入图片描述
已经提供了很多的模板,可以直接使用
在这里插入图片描述
随便选一个点进去
在这里插入图片描述

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐