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

View file

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

View file

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