Skip to content

Commit

Permalink
Add emptyDir for client-go discovery cache in /.kube
Browse files Browse the repository at this point in the history
  • Loading branch information
manno committed Jul 5, 2024
1 parent b14ff2c commit 1bd104b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions charts/fleet-agent/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ spec:
drop:
- ALL
{{- end }}
volumeMounts:
- mountPath: /.kube
name: kube
- env:
- name: NAMESPACE
valueFrom:
Expand All @@ -82,6 +85,9 @@ spec:
drop:
- ALL
{{- end }}
volumes:
- name: kube
emptyDir: {}
serviceAccountName: fleet-agent
nodeSelector: {{ include "linux-node-selector" . | nindent 8 }}
{{- if .Values.fleetAgent.nodeSelector }}
Expand Down
14 changes: 14 additions & 0 deletions internal/cmd/controller/agentmanagement/agent/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,12 @@ func agentApp(namespace string, agentScope string, opts ManifestOptions) *appsv1
Command: []string{
"fleetagent",
},
VolumeMounts: []corev1.VolumeMount{
{
Name: "kube",
MountPath: "/.kube",
},
},
},
{
Name: name + "-clusterstatus",
Expand All @@ -235,6 +241,14 @@ func agentApp(namespace string, agentScope string, opts ManifestOptions) *appsv1
},
},
},
Volumes: []corev1.Volume{
{
Name: "kube",
VolumeSource: corev1.VolumeSource{
EmptyDir: &corev1.EmptyDirVolumeSource{},
},
},
},
NodeSelector: map[string]string{"kubernetes.io/os": "linux"},
Affinity: &corev1.Affinity{
NodeAffinity: &corev1.NodeAffinity{
Expand Down

0 comments on commit 1bd104b

Please sign in to comment.