mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-07-05 04:18:50 +00:00
✨ Do more Helm templating
This commit is contained in:
parent
3ebf816a68
commit
d2b9bddf78
@ -126,7 +126,7 @@ var hubPodMappings = map[string]interface{}{
|
||||
},
|
||||
{
|
||||
"name": "NAMESPACES",
|
||||
"value": "{{ .Values.tap.namespaces }}",
|
||||
"value": "{{ .Values.tap.allnamespaces | ternary \"\" .Values.tap.namespaces | quote }}",
|
||||
},
|
||||
{
|
||||
"name": "STORAGE_LIMIT",
|
||||
@ -139,26 +139,32 @@ var hubPodMappings = map[string]interface{}{
|
||||
},
|
||||
"spec.containers[0].image": "{{ .Values.tap.docker.registry }}/hub:{{ .Values.tap.docker.tag }}",
|
||||
"spec.containers[0].imagePullPolicy": "{{ .Values.tap.docker.imagePullPolicy }}",
|
||||
"spec.imagePullSecrets": "{{ .Values.tap.docker.imagepullsecrets }}",
|
||||
"spec.containers[0].resources.limits.cpu": "{{ .Values.tap.resources.hub.cpu-limit }}",
|
||||
"spec.containers[0].resources.limits.memory": "{{ .Values.tap.resources.hub.memory-limit }}",
|
||||
"spec.containers[0].resources.requests.cpu": "{{ .Values.tap.resources.hub.cpu-requests }}",
|
||||
"spec.containers[0].resources.requests.memory": "{{ .Values.tap.resources.hub.memory-requests }}",
|
||||
"spec.containers[0].command[0]": "{{ .Values.tap.debug | ternary \"./hub -debug\" \"./hub\" }}",
|
||||
}
|
||||
var hubServiceMappings = namespaceMappings
|
||||
var frontPodMappings = map[string]interface{}{
|
||||
"metadata.name": "{{ .Values.tap.selfnamespace }}",
|
||||
"spec.containers[0].image": "{{ .Values.tap.docker.registry }}/front:{{ .Values.tap.docker.tag }}",
|
||||
"spec.containers[0].imagePullPolicy": "{{ .Values.tap.docker.imagePullPolicy }}",
|
||||
"spec.imagePullSecrets": "{{ .Values.tap.docker.imagepullsecrets }}",
|
||||
}
|
||||
var frontServiceMappings = namespaceMappings
|
||||
var workerDaemonSetMappings = map[string]interface{}{
|
||||
"metadata.name": "{{ .Values.tap.selfnamespace }}",
|
||||
"spec.template.spec.containers[0].image": "{{ .Values.tap.docker.registry }}/worker:{{ .Values.tap.docker.tag }}",
|
||||
"spec.template.spec.containers[0].imagePullPolicy": "{{ .Values.tap.docker.imagePullPolicy }}",
|
||||
"spec.imagePullSecrets": "{{ .Values.tap.docker.imagepullsecrets }}",
|
||||
"spec.template.spec.containers[0].resources.limits.cpu": "{{ .Values.tap.resources.worker.cpu-limit }}",
|
||||
"spec.template.spec.containers[0].resources.limits.memory": "{{ .Values.tap.resources.worker.memory-limit }}",
|
||||
"spec.template.spec.containers[0].resources.requests.cpu": "{{ .Values.tap.resources.worker.cpu-requests }}",
|
||||
"spec.template.spec.containers[0].resources.requests.memory": "{{ .Values.tap.resources.worker.memory-requests }}",
|
||||
"spec.template.spec.containers[0].command[0]": "{{ .Values.tap.debug | ternary \"./worker -debug\" \"./worker\" }}",
|
||||
"spec.template.spec.containers[0].command[6]": "{{ .Values.tap.packetcapture }}",
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
@ -11,12 +11,12 @@ metadata:
|
||||
spec:
|
||||
containers:
|
||||
- command:
|
||||
- ./hub
|
||||
- '{{ .Values.tap.debug | ternary "./hub -debug" "./hub" }}'
|
||||
env:
|
||||
- name: POD_REGEX
|
||||
value: '{{ .Values.tap.regex }}'
|
||||
- name: NAMESPACES
|
||||
value: '{{ .Values.tap.namespaces }}'
|
||||
value: '{{ .Values.tap.allnamespaces | ternary "" .Values.tap.namespaces | quote }}'
|
||||
- name: STORAGE_LIMIT
|
||||
value: '{{ .Values.tap.storagelimit }}'
|
||||
- name: LICENSE
|
||||
@ -32,6 +32,7 @@ spec:
|
||||
cpu: '{{ .Values.tap.resources.hub.cpu-requests }}'
|
||||
memory: '{{ .Values.tap.resources.hub.memory-requests }}'
|
||||
dnsPolicy: ClusterFirstWithHostNet
|
||||
imagePullSecrets: '{{ .Values.tap.docker.imagepullsecrets }}'
|
||||
serviceAccountName: kubeshark-service-account
|
||||
terminationGracePeriodSeconds: 0
|
||||
tolerations:
|
||||
|
@ -35,6 +35,7 @@ spec:
|
||||
cpu: 50m
|
||||
memory: 50Mi
|
||||
dnsPolicy: ClusterFirstWithHostNet
|
||||
imagePullSecrets: '{{ .Values.tap.docker.imagepullsecrets }}'
|
||||
serviceAccountName: kubeshark-service-account
|
||||
terminationGracePeriodSeconds: 0
|
||||
tolerations:
|
||||
|
@ -9,6 +9,7 @@ metadata:
|
||||
name: '{{ .Values.tap.selfnamespace }}'
|
||||
namespace: kubeshark
|
||||
spec:
|
||||
imagePullSecrets: '{{ .Values.tap.docker.imagepullsecrets }}'
|
||||
selector:
|
||||
matchLabels:
|
||||
app: kubeshark-worker-daemon-set
|
||||
@ -26,11 +27,13 @@ spec:
|
||||
spec:
|
||||
containers:
|
||||
- command:
|
||||
- ./worker
|
||||
- '{{ .Values.tap.debug | ternary "./worker -debug" "./worker" }}'
|
||||
- -i
|
||||
- any
|
||||
- -port
|
||||
- "8897"
|
||||
- -packet-capture
|
||||
- '{{ .Values.tap.packetcapture }}'
|
||||
- -servicemesh
|
||||
- -tls
|
||||
- -procfs
|
||||
|
@ -706,7 +706,15 @@ func (provider *Provider) BuildWorkerDaemonSet(
|
||||
}
|
||||
|
||||
// Command
|
||||
command := []string{"./worker", "-i", "any", "-port", "8897"}
|
||||
command := []string{
|
||||
"./worker",
|
||||
"-i",
|
||||
"any",
|
||||
"-port",
|
||||
"8897",
|
||||
"-packet-capture",
|
||||
config.Config.Tap.PacketCapture,
|
||||
}
|
||||
if debug {
|
||||
command = append(command, "-debug")
|
||||
}
|
||||
|
@ -31,6 +31,8 @@ spec:
|
||||
- any
|
||||
- -port
|
||||
- "8897"
|
||||
- -packet-capture
|
||||
- libpcap
|
||||
- -servicemesh
|
||||
- -tls
|
||||
- -procfs
|
||||
|
Loading…
Reference in New Issue
Block a user