mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-04-27 19:47:31 +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"
|
||||
"regexp"
|
||||
|
||||
"github.com/kubeshark/base/pkg/models"
|
||||
"github.com/kubeshark/kubeshark/kubernetes"
|
||||
"github.com/kubeshark/kubeshark/utils"
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
@ -54,8 +54,8 @@ type DockerConfig struct {
|
||||
}
|
||||
|
||||
type ResourcesConfig struct {
|
||||
Worker models.Resources `yaml:"worker"`
|
||||
Hub models.Resources `yaml:"hub"`
|
||||
Worker kubernetes.Resources `yaml:"worker"`
|
||||
Hub kubernetes.Resources `yaml:"hub"`
|
||||
}
|
||||
|
||||
type TapConfig struct {
|
||||
|
@ -10,7 +10,6 @@ import (
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
|
||||
"github.com/kubeshark/base/pkg/models"
|
||||
"github.com/kubeshark/kubeshark/docker"
|
||||
"github.com/kubeshark/kubeshark/semver"
|
||||
"github.com/rs/zerolog/log"
|
||||
@ -175,7 +174,7 @@ type PodOptions struct {
|
||||
PodName string
|
||||
PodImage string
|
||||
ServiceAccountName string
|
||||
Resources models.Resources
|
||||
Resources Resources
|
||||
ImagePullPolicy core.PullPolicy
|
||||
Debug bool
|
||||
}
|
||||
@ -665,7 +664,7 @@ func (provider *Provider) ApplyWorkerDaemonSet(
|
||||
workerPodName string,
|
||||
nodeNames []string,
|
||||
serviceAccountName string,
|
||||
resources models.Resources,
|
||||
resources Resources,
|
||||
imagePullPolicy core.PullPolicy,
|
||||
serviceMesh 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
|
||||
PodFilterRegex regexp.Regexp
|
||||
SelfNamespace string
|
||||
WorkerResources models.Resources
|
||||
WorkerResources Resources
|
||||
ImagePullPolicy v1.PullPolicy
|
||||
KubesharkServiceAccountExists bool
|
||||
ServiceMesh bool
|
||||
|
@ -3,7 +3,6 @@ package resources
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/kubeshark/base/pkg/models"
|
||||
"github.com/kubeshark/kubeshark/config"
|
||||
"github.com/kubeshark/kubeshark/docker"
|
||||
"github.com/kubeshark/kubeshark/errormessage"
|
||||
@ -13,7 +12,7 @@ import (
|
||||
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 err := createSelfNamespace(ctx, kubernetesProvider, selfNamespace); err != nil {
|
||||
return false, err
|
||||
|
Loading…
Reference in New Issue
Block a user