Skip to content

Commit

Permalink
Moves insights trivy details under insights handler
Browse files Browse the repository at this point in the history
  • Loading branch information
bomoko committed Oct 26, 2023
1 parent 3e23e27 commit 65cb529
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 24 deletions.
4 changes: 2 additions & 2 deletions charts/lagoon-core/templates/insights-handler.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ spec:
value: http://{{ include "lagoon-core.api.fullname" . }}:{{ .Values.api.service.port }}/graphql
- name: HTTP_LISTEN_PORT
value: "3000"
{{- if .Values.insightsTrivy.enabled }}
{{- if .Values.insightsHandler.trivy.enabled }}
- name: PROBLEMS_FROM_SBOM
value: "true"
- name: TRIVY_SERVER_ENDPOINT
value: http://{{ include "lagoon-core.insightsTrivy.fullname" . }}:{{ .Values.insightsTrivy.service.port }}
value: http://{{ include "lagoon-core.insightsTrivy.fullname" . }}:{{ .Values.insightsHandler.trivy.service.port }}
{{- end }}
{{- range $key, $val := .Values.insightsHandler.additionalEnvs }}
- name: {{ $key }}
Expand Down
20 changes: 10 additions & 10 deletions charts/lagoon-core/templates/insights-trivy.deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.insightsTrivy.enabled -}}
{{- if .Values.insightsHandler.trivy.enabled -}}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand All @@ -12,22 +12,22 @@ spec:
template:
metadata:
annotations:
{{- with .Values.insightsTrivy.podAnnotations }}
{{- with .Values.insightsHandler.trivy.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "lagoon-core.insightsTrivy.selectorLabels" . | nindent 8 }}
spec:
securityContext:
{{- toYaml (coalesce .Values.insightsTrivy.podSecurityContext .Values.podSecurityContext) | nindent 8 }}
{{- toYaml (coalesce .Values.insightsHandler.trivy.podSecurityContext .Values.podSecurityContext) | nindent 8 }}
containers:
- name: insights-trivy
securityContext:
{{- toYaml .Values.insightsTrivy.securityContext | nindent 10 }}
image: "{{ .Values.insightsTrivy.image.repository }}:{{ coalesce .Values.insightsTrivy.image.tag .Values.imageTag .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.insightsTrivy.image.pullPolicy }}
{{- toYaml .Values.insightsHandler.trivy.securityContext | nindent 10 }}
image: "{{ .Values.insightsHandler.trivy.image.repository }}:{{ coalesce .Values.insightsHandler.trivy.image.tag .Values.imageTag .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.insightsHandler.trivy.image.pullPolicy }}
resources:
{{- toYaml .Values.insightsTrivy.resources | nindent 10 }}
{{- toYaml .Values.insightsHandler.trivy.resources | nindent 10 }}
command: ["trivy", "server", "--cache-dir=/tmp", "--listen=0.0.0.0:4954", "-d"]
ports:
- containerPort: 4954
Expand All @@ -41,7 +41,7 @@ spec:
httpGet:
path: /healthz
port: 4954
{{- with .Values.insightsTrivy.nodeSelector }}
{{- with .Values.insightsHandler.trivy.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
Expand All @@ -65,10 +65,10 @@ spec:
values:
- {{ .Release.Name }}
topologyKey: kubernetes.io/hostname
{{- with .Values.insightsTrivy.affinity }}
{{- with .Values.insightsHandler.trivy.affinity }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.insightsTrivy.tolerations }}
{{- with .Values.insightsHandler.trivy.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
6 changes: 3 additions & 3 deletions charts/lagoon-core/templates/insights-trivy.service.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{{- if .Values.insightsTrivy.enabled -}}
{{- if .Values.insightsHandler.trivy.enabled -}}
apiVersion: v1
kind: Service
metadata:
name: {{ include "lagoon-core.insightsTrivy.fullname" . }}
labels:
{{- include "lagoon-core.insightsTrivy.labels" . | nindent 4 }}
spec:
type: {{ .Values.insightsTrivy.service.type }}
type: {{ .Values.insightsHandler.trivy.service.type }}
ports:
- port: {{ .Values.insightsTrivy.service.port }}
- port: {{ .Values.insightsHandler.trivy.service.port }}
targetPort: 4954
name: tcp-4954
selector:
Expand Down
17 changes: 8 additions & 9 deletions charts/lagoon-core/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -616,15 +616,14 @@ insightsHandler:
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80

insightsTrivy:
image:
repository: aquasec/trivy
tag: latest
enabled: false
service:
type: ClusterIP
port: 4954
trivy:
enabled: false
image:
repository: aquasec/trivy
tag: latest
service:
type: ClusterIP
port: 4954

logs2notifications:
enabled: true
Expand Down

0 comments on commit 65cb529

Please sign in to comment.