fix: Chart audit

This commit is contained in:
Dries De Peuter 2023-03-11 23:41:11 +01:00
parent a371807f55
commit 3d389b1052
No known key found for this signature in database
4 changed files with 25 additions and 3 deletions

View file

@ -0,0 +1,5 @@
ingress:
enabled: true
autoscaling:
enabled: true

View file

@ -42,7 +42,9 @@ spec:
mountPath: /etc/nginx/conf.d/default.conf
subPath: default.conf
- name: data
mountPath: /usr/share/nginx/html
mountPath: /usr/share/nginx/html/.well-known
- mountPath: /tmp
name: tmp-volume
resources:
{{- toYaml .Values.webserver.resources | nindent 12 }}
- name: {{ .Chart.Name }}
@ -51,7 +53,8 @@ spec:
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args: [
"-namespace", "{{ .Release.Namespace }}"
"-namespace", "{{ .Release.Namespace }}",
"-configmap", "{{ include "well-known.fullname" . }}-data"
]
env:
- name: POD_NAME
@ -81,3 +84,5 @@ spec:
configMap:
name: {{ include "well-known.fullname" . }}-data
optional: true
- name: tmp-volume
emptyDir: {}

View file

@ -1,5 +1,9 @@
{{- if .Values.autoscaling.enabled }}
{{- if semverCompare ">=1.20-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: autoscaling/v2
{{- else -}}
apiVersion: autoscaling/v2beta1
{{- end }}
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "well-known.fullname" . }}
@ -17,12 +21,20 @@ spec:
- type: Resource
resource:
name: cpu
{{- if semverCompare ">=1.20-0" .Capabilities.KubeVersion.GitVersion }}
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- else -}}
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- end }}
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
{{- if semverCompare ">=1.20-0" .Capabilities.KubeVersion.GitVersion }}
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- else -}}
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
{{- end }}

View file

@ -75,7 +75,7 @@ ingress:
hosts:
- host: chart-example.local
paths:
- path: /
- path: /.well-known/
pathType: ImplementationSpecific
tls: []
# - secretName: chart-example-tls