mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-06-23 23:08:35 +00:00
✨ Add storageclass
option to config.yaml
This commit is contained in:
parent
2d73b46b44
commit
38d121556c
@ -162,6 +162,7 @@ var frontServiceMappings = serviceAccountMappings
|
|||||||
var persistentVolumeMappings = map[string]interface{}{
|
var persistentVolumeMappings = map[string]interface{}{
|
||||||
"metadata.namespace": "{{ .Values.tap.selfnamespace }}",
|
"metadata.namespace": "{{ .Values.tap.selfnamespace }}",
|
||||||
"spec.resources.requests.storage": "{{ .Values.tap.storagelimit }}",
|
"spec.resources.requests.storage": "{{ .Values.tap.storagelimit }}",
|
||||||
|
"spec.storageClassName": "{{ .Values.tap.storageclass }}",
|
||||||
}
|
}
|
||||||
var workerDaemonSetMappings = map[string]interface{}{
|
var workerDaemonSetMappings = map[string]interface{}{
|
||||||
"metadata.namespace": "{{ .Values.tap.selfnamespace }}",
|
"metadata.namespace": "{{ .Values.tap.selfnamespace }}",
|
||||||
|
@ -52,7 +52,8 @@ func init() {
|
|||||||
tapCmd.Flags().String(configStructs.ProxyHostLabel, defaultTapConfig.Proxy.Host, "Provide a custom host for the proxy/port-forward")
|
tapCmd.Flags().String(configStructs.ProxyHostLabel, defaultTapConfig.Proxy.Host, "Provide a custom host for the proxy/port-forward")
|
||||||
tapCmd.Flags().StringSliceP(configStructs.NamespacesLabel, "n", defaultTapConfig.Namespaces, "Namespaces selector")
|
tapCmd.Flags().StringSliceP(configStructs.NamespacesLabel, "n", defaultTapConfig.Namespaces, "Namespaces selector")
|
||||||
tapCmd.Flags().StringP(configStructs.SelfNamespaceLabel, "s", defaultTapConfig.SelfNamespace, "Self-namespace of Kubeshark")
|
tapCmd.Flags().StringP(configStructs.SelfNamespaceLabel, "s", defaultTapConfig.SelfNamespace, "Self-namespace of Kubeshark")
|
||||||
tapCmd.Flags().String(configStructs.StorageLimitLabel, defaultTapConfig.StorageLimit, "Override the default storage limit. (per node)")
|
tapCmd.Flags().String(configStructs.StorageLimitLabel, defaultTapConfig.StorageLimit, "Override the default storage limit (per node)")
|
||||||
|
tapCmd.Flags().String(configStructs.StorageClassLabel, defaultTapConfig.StorageClass, "Override the default storage class of the PersistentVolumeClaim (per node)")
|
||||||
tapCmd.Flags().Bool(configStructs.DryRunLabel, defaultTapConfig.DryRun, "Preview of all pods matching the regex, without tapping them")
|
tapCmd.Flags().Bool(configStructs.DryRunLabel, defaultTapConfig.DryRun, "Preview of all pods matching the regex, without tapping them")
|
||||||
tapCmd.Flags().StringP(configStructs.PcapLabel, "p", defaultTapConfig.Pcap, fmt.Sprintf("Capture from a PCAP snapshot of %s (.tar.gz) using your Docker Daemon instead of Kubernetes", misc.Software))
|
tapCmd.Flags().StringP(configStructs.PcapLabel, "p", defaultTapConfig.Pcap, fmt.Sprintf("Capture from a PCAP snapshot of %s (.tar.gz) using your Docker Daemon instead of Kubernetes", misc.Software))
|
||||||
tapCmd.Flags().Bool(configStructs.ServiceMeshLabel, defaultTapConfig.ServiceMesh, "Capture the encrypted traffic if the cluster is configured with a service mesh and with mTLS")
|
tapCmd.Flags().Bool(configStructs.ServiceMeshLabel, defaultTapConfig.ServiceMesh, "Capture the encrypted traffic if the cluster is configured with a service mesh and with mTLS")
|
||||||
|
@ -18,6 +18,7 @@ const (
|
|||||||
NamespacesLabel = "namespaces"
|
NamespacesLabel = "namespaces"
|
||||||
SelfNamespaceLabel = "selfnamespace"
|
SelfNamespaceLabel = "selfnamespace"
|
||||||
StorageLimitLabel = "storagelimit"
|
StorageLimitLabel = "storagelimit"
|
||||||
|
StorageClassLabel = "storageclass"
|
||||||
DryRunLabel = "dryrun"
|
DryRunLabel = "dryrun"
|
||||||
PcapLabel = "pcap"
|
PcapLabel = "pcap"
|
||||||
ServiceMeshLabel = "servicemesh"
|
ServiceMeshLabel = "servicemesh"
|
||||||
@ -82,6 +83,7 @@ type TapConfig struct {
|
|||||||
Namespaces []string `yaml:"namespaces"`
|
Namespaces []string `yaml:"namespaces"`
|
||||||
SelfNamespace string `yaml:"selfnamespace" default:"kubeshark"`
|
SelfNamespace string `yaml:"selfnamespace" default:"kubeshark"`
|
||||||
StorageLimit string `yaml:"storagelimit" default:"200Mi"`
|
StorageLimit string `yaml:"storagelimit" default:"200Mi"`
|
||||||
|
StorageClass string `yaml:"storageclass" default:"standard"`
|
||||||
DryRun bool `yaml:"dryrun" default:"false"`
|
DryRun bool `yaml:"dryrun" default:"false"`
|
||||||
Pcap string `yaml:"pcap" default:""`
|
Pcap string `yaml:"pcap" default:""`
|
||||||
Resources ResourcesConfig `yaml:"resources"`
|
Resources ResourcesConfig `yaml:"resources"`
|
||||||
|
@ -16,5 +16,5 @@ spec:
|
|||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
storage: '{{ .Values.tap.storagelimit }}'
|
storage: '{{ .Values.tap.storagelimit }}'
|
||||||
storageClassName: standard
|
storageClassName: '{{ .Values.tap.storageclass }}'
|
||||||
status: {}
|
status: {}
|
||||||
|
@ -19,6 +19,7 @@ tap:
|
|||||||
namespaces: []
|
namespaces: []
|
||||||
selfnamespace: kubeshark
|
selfnamespace: kubeshark
|
||||||
storagelimit: 200Mi
|
storagelimit: 200Mi
|
||||||
|
storageclass: standard
|
||||||
dryrun: false
|
dryrun: false
|
||||||
pcap: ""
|
pcap: ""
|
||||||
resources:
|
resources:
|
||||||
|
@ -715,7 +715,7 @@ func (provider *Provider) BuildPersistentVolumeClaim() (*core.PersistentVolumeCl
|
|||||||
return nil, fmt.Errorf("invalid capacity for the workers: %s", config.Config.Tap.StorageLimit)
|
return nil, fmt.Errorf("invalid capacity for the workers: %s", config.Config.Tap.StorageLimit)
|
||||||
}
|
}
|
||||||
|
|
||||||
storageClassName := "standard"
|
storageClassName := config.Config.Tap.StorageClass
|
||||||
|
|
||||||
return &core.PersistentVolumeClaim{
|
return &core.PersistentVolumeClaim{
|
||||||
TypeMeta: metav1.TypeMeta{
|
TypeMeta: metav1.TypeMeta{
|
||||||
|
Loading…
Reference in New Issue
Block a user