Skip to content

Commit

Permalink
Add option for audit to writeToRAMDisk to chart (#1660)
Browse files Browse the repository at this point in the history
Signed-off-by: Rita Zhang <[email protected]>
  • Loading branch information
ritazh authored Nov 11, 2021
1 parent c2119e8 commit f43223e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/build/helmify/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ func (ks *kindSet) Write() error {
obj = strings.Replace(obj, " priorityClassName: system-cluster-critical", " {{- if .Values.audit.priorityClassName }} \n priorityClassName: {{ .Values.audit.priorityClassName }}\n {{- end }}", 1)
}

if name == "gatekeeper-audit" && kind == DeploymentKind {
obj = strings.Replace(obj, " - emptyDir: {}", " {{- if .Values.audit.writeToRAMDisk }} \n - emptyDir:\n medium: Memory\n {{ else }} \n - emptyDir: {}\n {{- end }}", 1)
}

if kind == DeploymentKind {
obj = strings.Replace(obj, " labels:", " labels:\n{{- include \"gatekeeper.podLabels\" . }}", 1)
}
Expand Down
1 change: 1 addition & 0 deletions cmd/build/helmify/static/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ audit:
affinity: {}
tolerations: []
nodeSelector: { kubernetes.io/os: linux }
writeToRAMDisk: false
resources:
limits:
cpu: 1000m
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,10 @@ spec:
tolerations:
{{- toYaml .Values.audit.tolerations | nindent 8 }}
volumes:
{{- if .Values.audit.writeToRAMDisk }}
- emptyDir:
medium: Memory
{{ else }}
- emptyDir: {}
{{- end }}
name: tmp-volume
1 change: 1 addition & 0 deletions manifest_staging/charts/gatekeeper/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ audit:
affinity: {}
tolerations: []
nodeSelector: { kubernetes.io/os: linux }
writeToRAMDisk: false
resources:
limits:
cpu: 1000m
Expand Down

0 comments on commit f43223e

Please sign in to comment.