Allow setting security context from chart (#2647)

Closes #2615

Signed-off-by: Sergio Castaño Arteaga <tegioz@icloud.com>
This commit is contained in:
Sergio Castaño Arteaga 2023-01-03 13:11:39 +01:00 committed by GitHub
parent 777677271c
commit 83b694b23a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 27 additions and 5 deletions

View File

@ -2,7 +2,7 @@ apiVersion: v2
name: artifact-hub
description: Artifact Hub is a web-based application that enables finding, installing, and publishing Kubernetes packages.
type: application
version: 1.11.1-2
version: 1.11.1-3
appVersion: 1.11.0
kubeVersion: ">= 1.19.0-0"
home: https://artifacthub.io

View File

@ -21,14 +21,18 @@ spec:
app.kubernetes.io/component: hub
{{- include "chart.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.hub.deploy.readinessGates }}
{{- with .Values.hub.deploy.readinessGates }}
readinessGates:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.imagePullSecrets }}
{{- end }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- with .Values.hub.deploy.securityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Release.IsInstall }}
serviceAccountName: {{ include "chart.serviceAccountName" . }}
{{- end }}

View File

@ -20,6 +20,10 @@ spec:
app.kubernetes.io/component: trivy
{{- include "chart.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.trivy.deploy.securityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: trivy
image: {{ .Values.trivy.deploy.image }}

View File

@ -331,6 +331,12 @@
"type": "object",
"default": {},
"$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.19.0/_definitions.json#/definitions/io.k8s.api.core.v1.ResourceRequirements"
},
"securityContext": {
"title": "Hub pod security context",
"type": "object",
"default": {},
"$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.19.0/_definitions.json#/definitions/io.k8s.api.core.v1.SecurityContext"
}
},
"required": [
@ -1111,6 +1117,12 @@
"type": "object",
"default": {},
"$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.19.0/_definitions.json#/definitions/io.k8s.api.core.v1.ResourceRequirements"
},
"securityContext": {
"title": "Trivy pod security context",
"type": "object",
"default": {},
"$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.19.0/_definitions.json#/definitions/io.k8s.api.core.v1.SecurityContext"
}
},
"required": [

View File

@ -129,6 +129,7 @@ hub:
image:
# Hub image repository (without the tag)
repository: artifacthub/hub
securityContext: {}
resources: {}
# If you do want to specify resources, uncomment the following
# lines and adjust them as necessary.
@ -353,6 +354,7 @@ trivy:
enabled: true
deploy:
image: aquasec/trivy:0.35.0
securityContext: {}
resources: {}
# If you do want to specify resources, uncomment the following
# lines and adjust them as necessary.