Skip to content

Commit

Permalink
add agent update
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick-0314 committed Apr 17, 2024
1 parent 770645b commit 3fe4506
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 5 deletions.
32 changes: 32 additions & 0 deletions charts/deepflow-agent/templates/RBAC.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,37 @@ subjects:
apiGroup: ""
roleRef:
kind: ClusterRole
name: {{ include "deepflow-agent.fullname" . }}
apiGroup: ""
---
### DeepFlow Agent remote update is used only to update DeepFlow-Agent's daemonset and configmap
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ include "deepflow-agent.fullname" . }}-update
namespace: {{ .Release.Namespace }}
rules:
- apiGroups: [""]
resources:
- configmaps
resourceNames: ['{{ include "deepflow-agent.fullname" . }}-config']
verbs: ["get", "list", "watch", "update", "patch"]
- apiGroups: ["apps"]
resources:
- daemonsets
resourceNames: ['{{ include "deepflow-agent.fullname" . }}']
verbs: ["get", "list", "watch", "update", "patch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ include "deepflow-agent.fullname" . }}-update
namespace: {{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ include "deepflow-agent.fullname" . }}-update
subjects:
- kind: ServiceAccount
name: {{ include "deepflow-agent.fullname" . }}
apiGroup: ""
14 changes: 9 additions & 5 deletions charts/deepflow-agent/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ spec:
env:
- name: TZ
value: {{ tpl .Values.timezone . }}
- name: K8S_NAMESPACE_FOR_DEEPFLOW
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: K8S_NODE_IP_FOR_DEEPFLOW
valueFrom:
fieldRef:
Expand All @@ -93,6 +97,11 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: K8S_MEM_LIMIT_FOR_DEEPFLOW
valueFrom:
resourceFieldRef:
divisor: 1Mi
resource: limits.memory
{{- if .Values.tke_sidecar }}
- name: CTRL_NETWORK_INTERFACE
value: "eth0"
Expand All @@ -105,11 +114,6 @@ spec:
{{- else }}
fieldPath: status.podIP
{{- end }}
- name: K8S_MEM_LIMIT_FOR_DEEPFLOW
valueFrom:
resourceFieldRef:
divisor: 1Mi
resource: limits.memory
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
Expand Down

0 comments on commit 3fe4506

Please sign in to comment.