mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-07-20 11:10:54 +00:00
⚡ Fix the issues in worker DaemonSet
This commit is contained in:
parent
f19db77228
commit
39d1b77045
@ -87,8 +87,8 @@ func runManifests() {
|
|||||||
frontService := kubernetesProvider.BuildFrontService(config.Config.Tap.SelfNamespace)
|
frontService := kubernetesProvider.BuildFrontService(config.Config.Tap.SelfNamespace)
|
||||||
|
|
||||||
workerDaemonSet, err := kubernetesProvider.BuildWorkerDaemonSet(
|
workerDaemonSet, err := kubernetesProvider.BuildWorkerDaemonSet(
|
||||||
|
docker.GetWorkerImage(),
|
||||||
kubernetes.WorkerDaemonSetName,
|
kubernetes.WorkerDaemonSetName,
|
||||||
kubernetes.WorkerPodName,
|
|
||||||
kubernetes.ServiceAccountName,
|
kubernetes.ServiceAccountName,
|
||||||
config.Config.Tap.Resources.Worker,
|
config.Config.Tap.Resources.Worker,
|
||||||
config.Config.ImagePullPolicy(),
|
config.Config.ImagePullPolicy(),
|
||||||
|
@ -809,10 +809,7 @@ func (provider *Provider) BuildWorkerDaemonSet(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Pod
|
// Pod
|
||||||
pod := core.Pod{
|
pod := DaemonSetPod{
|
||||||
TypeMeta: metav1.TypeMeta{
|
|
||||||
Kind: "Pod",
|
|
||||||
},
|
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: podName,
|
Name: podName,
|
||||||
Namespace: config.Config.Tap.SelfNamespace,
|
Namespace: config.Config.Tap.SelfNamespace,
|
||||||
@ -847,6 +844,13 @@ func (provider *Provider) BuildWorkerDaemonSet(
|
|||||||
Kind: "DaemonSet",
|
Kind: "DaemonSet",
|
||||||
APIVersion: "apps/v1",
|
APIVersion: "apps/v1",
|
||||||
},
|
},
|
||||||
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
|
Name: podName,
|
||||||
|
Namespace: config.Config.Tap.SelfNamespace,
|
||||||
|
Labels: buildWithDefaultLabels(map[string]string{
|
||||||
|
"app": podName,
|
||||||
|
}, provider),
|
||||||
|
},
|
||||||
Spec: DaemonSetSpec{
|
Spec: DaemonSetSpec{
|
||||||
Selector: metav1.LabelSelector{
|
Selector: metav1.LabelSelector{
|
||||||
MatchLabels: buildWithDefaultLabels(map[string]string{
|
MatchLabels: buildWithDefaultLabels(map[string]string{
|
||||||
|
@ -9,9 +9,14 @@ import (
|
|||||||
applyconfmeta "k8s.io/client-go/applyconfigurations/meta/v1"
|
applyconfmeta "k8s.io/client-go/applyconfigurations/meta/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type DaemonSetPod struct {
|
||||||
|
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
|
||||||
|
Spec core.PodSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
|
||||||
|
}
|
||||||
|
|
||||||
type DaemonSetSpec struct {
|
type DaemonSetSpec struct {
|
||||||
Selector metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,1,opt,name=selector"`
|
Selector metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,1,opt,name=selector"`
|
||||||
Template core.Pod `json:"template,omitempty" protobuf:"bytes,2,opt,name=template"`
|
Template DaemonSetPod `json:"template,omitempty" protobuf:"bytes,2,opt,name=template"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type DaemonSet struct {
|
type DaemonSet struct {
|
||||||
|
@ -2,21 +2,26 @@ apiVersion: apps/v1
|
|||||||
kind: DaemonSet
|
kind: DaemonSet
|
||||||
metadata:
|
metadata:
|
||||||
creationTimestamp: null
|
creationTimestamp: null
|
||||||
|
labels:
|
||||||
|
app: kubeshark-worker-daemon-set
|
||||||
|
kubeshark-created-by: kubeshark
|
||||||
|
kubeshark-managed-by: kubeshark
|
||||||
|
name: kubeshark-worker-daemon-set
|
||||||
|
namespace: kubeshark
|
||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: kubeshark-worker
|
app: kubeshark-worker-daemon-set
|
||||||
kubeshark-created-by: kubeshark
|
kubeshark-created-by: kubeshark
|
||||||
kubeshark-managed-by: kubeshark
|
kubeshark-managed-by: kubeshark
|
||||||
template:
|
template:
|
||||||
kind: Pod
|
|
||||||
metadata:
|
metadata:
|
||||||
creationTimestamp: null
|
creationTimestamp: null
|
||||||
labels:
|
labels:
|
||||||
app: kubeshark-worker
|
app: kubeshark-worker-daemon-set
|
||||||
kubeshark-created-by: kubeshark
|
kubeshark-created-by: kubeshark
|
||||||
kubeshark-managed-by: kubeshark
|
kubeshark-managed-by: kubeshark
|
||||||
name: kubeshark-worker
|
name: kubeshark-worker-daemon-set
|
||||||
namespace: kubeshark
|
namespace: kubeshark
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
@ -30,9 +35,9 @@ spec:
|
|||||||
- -tls
|
- -tls
|
||||||
- -procfs
|
- -procfs
|
||||||
- /hostproc
|
- /hostproc
|
||||||
image: kubeshark-worker-daemon-set
|
image: docker.io/kubeshark/worker:latest
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
name: kubeshark-worker
|
name: kubeshark-worker-daemon-set
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
cpu: 750m
|
cpu: 750m
|
||||||
@ -74,4 +79,3 @@ spec:
|
|||||||
- hostPath:
|
- hostPath:
|
||||||
path: /sys
|
path: /sys
|
||||||
name: sys
|
name: sys
|
||||||
status: {}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user