mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-07-12 15:48:45 +00:00
🔨 Bring in models.Resources
dependency to kubernetes
package
This commit is contained in:
parent
5e269831e4
commit
6d06c53ebf
@ -4,7 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
|
||||||
"github.com/kubeshark/base/pkg/models"
|
"github.com/kubeshark/kubeshark/kubernetes"
|
||||||
"github.com/kubeshark/kubeshark/utils"
|
"github.com/kubeshark/kubeshark/utils"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
)
|
)
|
||||||
@ -54,8 +54,8 @@ type DockerConfig struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ResourcesConfig struct {
|
type ResourcesConfig struct {
|
||||||
Worker models.Resources `yaml:"worker"`
|
Worker kubernetes.Resources `yaml:"worker"`
|
||||||
Hub models.Resources `yaml:"hub"`
|
Hub kubernetes.Resources `yaml:"hub"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type TapConfig struct {
|
type TapConfig struct {
|
||||||
|
@ -10,7 +10,6 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
|
||||||
"github.com/kubeshark/base/pkg/models"
|
|
||||||
"github.com/kubeshark/kubeshark/docker"
|
"github.com/kubeshark/kubeshark/docker"
|
||||||
"github.com/kubeshark/kubeshark/semver"
|
"github.com/kubeshark/kubeshark/semver"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
@ -175,7 +174,7 @@ type PodOptions struct {
|
|||||||
PodName string
|
PodName string
|
||||||
PodImage string
|
PodImage string
|
||||||
ServiceAccountName string
|
ServiceAccountName string
|
||||||
Resources models.Resources
|
Resources Resources
|
||||||
ImagePullPolicy core.PullPolicy
|
ImagePullPolicy core.PullPolicy
|
||||||
Debug bool
|
Debug bool
|
||||||
}
|
}
|
||||||
@ -665,7 +664,7 @@ func (provider *Provider) ApplyWorkerDaemonSet(
|
|||||||
workerPodName string,
|
workerPodName string,
|
||||||
nodeNames []string,
|
nodeNames []string,
|
||||||
serviceAccountName string,
|
serviceAccountName string,
|
||||||
resources models.Resources,
|
resources Resources,
|
||||||
imagePullPolicy core.PullPolicy,
|
imagePullPolicy core.PullPolicy,
|
||||||
serviceMesh bool,
|
serviceMesh bool,
|
||||||
tls bool,
|
tls bool,
|
||||||
|
8
kubernetes/structs.go
Normal file
8
kubernetes/structs.go
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
package kubernetes
|
||||||
|
|
||||||
|
type Resources struct {
|
||||||
|
CpuLimit string `yaml:"cpu-limit" default:"750m"`
|
||||||
|
MemoryLimit string `yaml:"memory-limit" default:"1Gi"`
|
||||||
|
CpuRequests string `yaml:"cpu-requests" default:"50m"`
|
||||||
|
MemoryRequests string `yaml:"memory-requests" default:"50Mi"`
|
||||||
|
}
|
@ -39,7 +39,7 @@ type WorkerSyncerConfig struct {
|
|||||||
TargetNamespaces []string
|
TargetNamespaces []string
|
||||||
PodFilterRegex regexp.Regexp
|
PodFilterRegex regexp.Regexp
|
||||||
SelfNamespace string
|
SelfNamespace string
|
||||||
WorkerResources models.Resources
|
WorkerResources Resources
|
||||||
ImagePullPolicy v1.PullPolicy
|
ImagePullPolicy v1.PullPolicy
|
||||||
KubesharkServiceAccountExists bool
|
KubesharkServiceAccountExists bool
|
||||||
ServiceMesh bool
|
ServiceMesh bool
|
||||||
|
@ -3,7 +3,6 @@ package resources
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/kubeshark/base/pkg/models"
|
|
||||||
"github.com/kubeshark/kubeshark/config"
|
"github.com/kubeshark/kubeshark/config"
|
||||||
"github.com/kubeshark/kubeshark/docker"
|
"github.com/kubeshark/kubeshark/docker"
|
||||||
"github.com/kubeshark/kubeshark/errormessage"
|
"github.com/kubeshark/kubeshark/errormessage"
|
||||||
@ -13,7 +12,7 @@ import (
|
|||||||
core "k8s.io/api/core/v1"
|
core "k8s.io/api/core/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
func CreateHubResources(ctx context.Context, kubernetesProvider *kubernetes.Provider, isNsRestrictedMode bool, selfNamespace string, hubResources models.Resources, imagePullPolicy core.PullPolicy, debug bool) (bool, error) {
|
func CreateHubResources(ctx context.Context, kubernetesProvider *kubernetes.Provider, isNsRestrictedMode bool, selfNamespace string, hubResources kubernetes.Resources, imagePullPolicy core.PullPolicy, debug bool) (bool, error) {
|
||||||
if !isNsRestrictedMode {
|
if !isNsRestrictedMode {
|
||||||
if err := createSelfNamespace(ctx, kubernetesProvider, selfNamespace); err != nil {
|
if err := createSelfNamespace(ctx, kubernetesProvider, selfNamespace); err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
|
Loading…
Reference in New Issue
Block a user