Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问如何设置 deepflow-agent 的 nodeSelector ? #21

Open
gotnix opened this issue Dec 22, 2023 · 1 comment
Open

请问如何设置 deepflow-agent 的 nodeSelector ? #21

gotnix opened this issue Dec 22, 2023 · 1 comment

Comments

@gotnix
Copy link

gotnix commented Dec 22, 2023

问题

Q1 生产环境部署 DeepFlow 的时候是否需要分开执行 server 和 agent 的 chart,在使用 helm chart deepflow/deepflow 部署 Server 的时候,是否需要禁用 deepflow-agent,然后通过 helm chart deepflow/deepflow-agent 单独部署 deepflow-agent ?

Q2 如果 All-in-One 部署需要指定 agent 的 nodeSelector,是否需要调整 deepflow-charts/charts/deepflow-agent/templates/daemonset.yaml ?

Q1 关于文档的问题

文档里部署命令都是 All-in-One 的命令,没有介绍单独部署 DeepFlow Agent 的时候,需要调整 DeepFlow Server 的哪些配置。
我参考过的文档:

  1. 安装社区版/All-in-One 快速部署 - 使用 Helm 安装 All-in-One DeepFlow
  2. 最佳实践/生产环境部署建议 - 2.1 安装 LTS 版本 DeepFlow Server
  3. 最佳实践/生产环境部署建议 - 2.2 安装 LTS 版本 DeepFlow Agent

文档 1 和 2 安装的命令没有本质的差别,没有说明单独部署 Agent 如何调整 deepflow/deepflow 的配置。

如果部署 helm chart deepflow/deepflow 的时候没有禁用 deepflow-agent,再使用 helm chart deepflow/deepflow-agent 部署 Agent,会遇到 deepflow-agent 的 Annotations 需要调整,因为 deepflow/deepflow 部署的资源 release-name=deepflow,而 deepflow/deepflow-agent 部署的资源 release-name=deepflow-agent ,我在部署 deepflow-agent 6.3.9 的时候修改的配置如下:

kubectl annotate serviceaccount deepflow-agent meta.helm.sh/release-name=deepflow-agent --overwrite -n deepflow
kubectl annotate configmap deepflow-agent meta.helm.sh/release-name=deepflow-agent --overwrite -n deepflow
kubectl annotate clusterrole deepflow-agent meta.helm.sh/release-name=deepflow-agent --overwrite -n deepflow
kubectl annotate ClusterRoleBinding deepflow-agent meta.helm.sh/release-name=deepflow-agent --overwrite -n deepflow
kubectl annotate Service deepflow-agent meta.helm.sh/release-name=deepflow-agent --overwrite -n deepflow
kubectl annotate DaemonSet deepflow-agent meta.helm.sh/release-name=deepflow-agent --overwrite -n deepflow

除了这些 annotate 需要改,deamonset 的 selector 也需要从修改:

# Helm chart `deepflow/deepflow` 部署的
Selector:       app=deepflow,app.kubernetes.io/instance=deepflow,app.kubernetes.io/name=deepflow-agent,component=deepflow-agent
# Helm chart `deepflow/deepflow-agent` 部署的
Selector:       app=deepflow,app.kubernetes.io/instance=deepflow-agent,app.kubernetes.io/name=deepflow-agent,component=deepflow-agent

这个问题我是先删除 daemonset deepflow-agent,再运行 helm deepflow/deepflow-agent 部署 agent。

Q2 关于 helm chart 的疑问

这问题是需要在 All-in-One 部署的时候指定 Agent nodeSelector 的时候产生的(只是疑问,我没有实际操作)。看了 2 个 helm chart,个人认为 deepflow/deepflow 不能(或者不方便)指定 Agent 的 nodeSelector,deepflow-agent 的 chart 可能用不上 values.yaml 中定义的 deepflow-agent.nodeSelector 。

chart 中的模板使用了 nodeSelector 的地方:

# deepflow-charts/charts/deepflow-agent/templates/daemonset.yaml
# 158 行
      {{- with .Values.nodeSelector }}
      nodeSelector:
        {{- toYaml . | nindent 8 }}
      {{- end }}

# deepflow-charts/charts/deepflow/templates/app-deployment.yaml
# 83 行
      {{- with .Values.app.nodeSelector }}
      nodeSelector:
        {{- toYaml . | nindent 8 }}
      {{- end }}

# deepflow-charts/charts/deepflow/templates/server-deployment.yaml
# 124 行
      {{- with .Values.server.nodeSelector }}
      nodeSelector:
        {{- toYaml . | nindent 8 }}
      {{- end }}

deepflow-charts/charts/deepflow/values.yaml 配置 nodeSelector 的位置,感觉不能适配 deepflow-charts/charts/deepflow-agent/templates/daemonset.yaml

95   server:
198    nodeSelctor: {}

224 app:
279   nodeSelector: {}

385 clickhouse:
512   nodeSelector: {}

546 mysql:
637   nodeSelector: {}

655 deepflow-agent:
754   nodeSelector: {}

但是 charts/deepflow-agent/values.yaml 中 nodeSelector 的位置和 deepflow-charts/charts/deepflow-agent/templates/daemonset.yaml 是一致的,令我感到疑惑的是 All-in-One 部署的时候会使用哪一个值。

@Nick-0314
Copy link

不好意思,刚看到, 方便加一下我微信吗? 在微信中联系,我的微信二维码在 github.com/deepflowio/deepflow 项目README的最下面

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants