Skip to content

Commit 458f700

Browse files
committed
edit trivy-operator templates for 2.0.0
1 parent 14528ed commit 458f700

3 files changed

Lines changed: 42 additions & 5 deletions

File tree

charts/trivy-operator/templates/deployment.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ spec:
3232
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
3333
imagePullPolicy: {{ .Values.image.pullPolicy }}
3434
env:
35+
- name: POD_NAMESPACE
36+
valueFrom:
37+
fieldRef:
38+
fieldPath: metadata.namespace
3539
{{- if .Values.githubToken.enabled }}
3640
- name: GITHUB_TOKEN
3741
value: "{{ .Values.githubToken.token }}"
@@ -40,10 +44,15 @@ spec:
4044
- name: cache
4145
mountPath: "/home/trivy-operator/trivy-cache"
4246
ports:
43-
- containerPort: 9115
47+
- name: metric
48+
containerPort: 9115
49+
protocol: TCP
50+
- name: https
51+
containerPort: 8443
52+
protocol: TCP
4453
volumes:
4554
{{- if .Values.storage.enabled }}
4655
- name: cache
4756
persistentVolumeClaim:
4857
claimName: {{ include "trivy-operator.fullname" . }}-trivy-cache
49-
{{- end }}
58+
{{- end }}

charts/trivy-operator/templates/service.yaml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,24 @@ spec:
1010
app: trivy-operator
1111
{{- include "trivy-operator.selectorLabels" . | nindent 4 }}
1212
ports:
13-
- name: metrics
14-
targetPort: TCP
13+
- name: metric
1514
port: {{ .Values.monitoring.port }}
16-
targetPort: 9115
15+
protocol: TCP
16+
targetPort: 9115
17+
---
18+
apiVersion: v1
19+
kind: Service
20+
metadata:
21+
name: trivy-image-validator
22+
labels:
23+
app: trivy-operator
24+
{{- include "trivy-operator.labels" . | nindent 4 }}
25+
spec:
26+
selector:
27+
app: trivy-operator
28+
{{- include "trivy-operator.selectorLabels" . | nindent 4 }}
29+
ports:
30+
- name: webhook
31+
targetPort: 8443
32+
protocol: TCP
33+
port: 443

charts/trivy-operator/templates/serviceaccount.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,17 @@ rules:
3737
- get
3838
- watch
3939
- list
40+
- apiGroups:
41+
- "admissionregistration.k8s.io"
42+
resources:
43+
- mutatingwebhookconfigurations
44+
- validatingwebhookconfigurations
45+
verbs:
46+
- create
47+
- patch
48+
- get
49+
- watch
50+
- list
4051
---
4152
apiVersion: rbac.authorization.k8s.io/v1
4253
kind: ClusterRoleBinding

0 commit comments

Comments
 (0)