Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhancement(helm): Upgrade to HPA v2 API #1548

Merged
merged 2 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion deploy/charts/cerbos/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: cerbos
home: https://cerbos.dev
icon: https://download.cerbos.dev/helm-charts/cerbie.png
description: |-
A Helm chart to deploy Cerbos. Cerbos is an open core, language agnostic, scalable solution that makes user permissions and authorization simple to implement and manage by writing context-aware access control policies for your application resources.
A Helm chart to deploy Cerbos. Cerbos is an open core, language agnostic, scalable solution that makes user permissions and authorization simple to implement and manage by writing context-aware access control policies for your application resources.
type: application
maintainers:
- name: Cerbos authors
Expand All @@ -18,3 +18,4 @@ keywords:
- security
version: "0.27.0"
appVersion: "0.27.0"
kubeVersion: ">=1.23.0-0"
10 changes: 7 additions & 3 deletions deploy/charts/cerbos/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2beta1
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "cerbos.fullname" . }}
Expand All @@ -17,12 +17,16 @@ spec:
- type: Resource
resource:
name: cpu
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
17 changes: 12 additions & 5 deletions deploy/charts/cerbos/values-audit-log.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# Illustrates how to deploy Cerbos with an SQLite3 backend and audit logs.
# Illustrates how to deploy Cerbos with an SQLite3 backend and audit logs.

cerbos:
config:
# Configure the SQLite3 storage driver
storage:
driver: "sqlite3"
sqlite3:
dsn: "file:/data/cerbos.sqlite?mode=rwc&_fk=true"
dsn: "file:/data/cerbos.sqlite?mode=rwc&_fk=true"
# Configure audit logging
audit:
enabled: true
accessLogsEnabled: true
decisionLogsEnabled: true
backend: local
local:
local:
storagePath: /audit/cerbos

# Create volumes to hold the SQLite3 database and the audit log.
# Create volumes to hold the SQLite3 database and the audit log.
# Note that this example uses emptyDir volumes that lose data when the pod or node is killed.
# Use persistent volumes in production to preserve the data between pod restarts.
# Use persistent volumes in production to preserve the data between pod restarts.

volumes:
- name: cerbos-policies
Expand All @@ -31,3 +31,10 @@ volumeMounts:
mountPath: /data
- name: cerbos-auditlog
mountPath: /audit

# Optional: Autoscale the Cerbos deployment using CPU and memory utilization.
autoscaling:
enabled: true
targetCPUUtilizationPercentage: 80
targetMemoryUtilizationPercentage: 80