mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-07-22 20:13:48 +00:00
✨ Generate values.yaml
out of config.yaml
This commit is contained in:
parent
562dff0d6c
commit
504ecc4f83
@ -6,6 +6,7 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"sort"
|
"sort"
|
||||||
|
|
||||||
|
"github.com/kubeshark/kubeshark/config"
|
||||||
"github.com/kubeshark/kubeshark/kubernetes"
|
"github.com/kubeshark/kubeshark/kubernetes"
|
||||||
"github.com/kubeshark/kubeshark/misc"
|
"github.com/kubeshark/kubeshark/misc"
|
||||||
"github.com/kubeshark/kubeshark/utils"
|
"github.com/kubeshark/kubeshark/utils"
|
||||||
@ -156,6 +157,7 @@ func dumpHelmChart(objects map[string]interface{}) error {
|
|||||||
}
|
}
|
||||||
sort.Strings(filenames)
|
sort.Strings(filenames)
|
||||||
|
|
||||||
|
// Generate templates
|
||||||
for _, filename := range filenames {
|
for _, filename := range filenames {
|
||||||
manifest, err := utils.PrettyYamlOmitEmpty(objects[filename])
|
manifest, err := utils.PrettyYamlOmitEmpty(objects[filename])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -170,6 +172,7 @@ func dumpHelmChart(objects map[string]interface{}) error {
|
|||||||
log.Info().Msgf("Helm chart template generated: %s", path)
|
log.Info().Msgf("Helm chart template generated: %s", path)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Copy LICENSE
|
||||||
licenseSrcPath := filepath.Join(".", "LICENSE")
|
licenseSrcPath := filepath.Join(".", "LICENSE")
|
||||||
licenseDstPath := filepath.Join(folder, "LICENSE")
|
licenseDstPath := filepath.Join(folder, "LICENSE")
|
||||||
err = copy.Copy(licenseSrcPath, licenseDstPath)
|
err = copy.Copy(licenseSrcPath, licenseDstPath)
|
||||||
@ -179,6 +182,7 @@ func dumpHelmChart(objects map[string]interface{}) error {
|
|||||||
log.Info().Msgf("Helm chart license copied: %s", licenseDstPath)
|
log.Info().Msgf("Helm chart license copied: %s", licenseDstPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Generate Chart.yaml
|
||||||
chartMetadata := Metadata{
|
chartMetadata := Metadata{
|
||||||
APIVersion: "v2",
|
APIVersion: "v2",
|
||||||
Name: misc.Program,
|
Name: misc.Program,
|
||||||
@ -222,5 +226,17 @@ func dumpHelmChart(objects map[string]interface{}) error {
|
|||||||
}
|
}
|
||||||
log.Info().Msgf("Helm chart Chart.yaml generated: %s", path)
|
log.Info().Msgf("Helm chart Chart.yaml generated: %s", path)
|
||||||
|
|
||||||
|
// Generate values.yaml
|
||||||
|
values, err := utils.PrettyYaml(config.Config)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
path = filepath.Join(folder, "values.yaml")
|
||||||
|
err = os.WriteFile(path, []byte(values), 0644)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
log.Info().Msgf("Helm chart values.yaml generated: %s", path)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
54
helm-chart/values.yaml
Normal file
54
helm-chart/values.yaml
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
tap:
|
||||||
|
docker:
|
||||||
|
registry: docker.io/kubeshark
|
||||||
|
tag: latest
|
||||||
|
imagepullpolicy: Always
|
||||||
|
imagepullsecrets: []
|
||||||
|
proxy:
|
||||||
|
worker:
|
||||||
|
port: 8897
|
||||||
|
srvport: 8897
|
||||||
|
hub:
|
||||||
|
port: 8898
|
||||||
|
srvport: 80
|
||||||
|
front:
|
||||||
|
port: 8899
|
||||||
|
srvport: 80
|
||||||
|
host: 127.0.0.1
|
||||||
|
regex: .*
|
||||||
|
namespaces: []
|
||||||
|
allnamespaces: true
|
||||||
|
selfnamespace: kubeshark
|
||||||
|
storagelimit: 200MB
|
||||||
|
dryrun: false
|
||||||
|
pcap: ""
|
||||||
|
resources:
|
||||||
|
worker:
|
||||||
|
cpu-limit: 750m
|
||||||
|
memory-limit: 1Gi
|
||||||
|
cpu-requests: 50m
|
||||||
|
memory-requests: 50Mi
|
||||||
|
hub:
|
||||||
|
cpu-limit: 750m
|
||||||
|
memory-limit: 1Gi
|
||||||
|
cpu-requests: 50m
|
||||||
|
memory-requests: 50Mi
|
||||||
|
servicemesh: true
|
||||||
|
tls: true
|
||||||
|
packetcapture: libpcap
|
||||||
|
ignoreTainted: false
|
||||||
|
resourceLabels: {}
|
||||||
|
nodeSelectorTerms: []
|
||||||
|
debug: false
|
||||||
|
logs:
|
||||||
|
file: ""
|
||||||
|
kube:
|
||||||
|
configpath: ""
|
||||||
|
context: ""
|
||||||
|
dumplogs: false
|
||||||
|
headless: false
|
||||||
|
license: ""
|
||||||
|
scripting:
|
||||||
|
env: {}
|
||||||
|
source: ""
|
||||||
|
watchScripts: true
|
Loading…
Reference in New Issue
Block a user