Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions charts/pdp/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
apiVersion: v2
name: pdp
description: An official Helm chart for Permit.io PDP (Policy Decision Point)
version: 0.0.4
description: An official Helm chart for Permit.io PDP (Policy Decision Point) with OpenShift support
version: 0.0.5
keywords:
- policy
- authorization
- security
- permit
- openshift
maintainers:
- name: Permit.io
url: https://permit.io
33 changes: 31 additions & 2 deletions charts/pdp/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,27 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- if .Values.openshift.enabled }}
serviceAccountName: {{ .Values.openshift.serviceAccount.name }}
securityContext:
runAsNonRoot: {{ .Values.openshift.securityContext.runAsNonRoot }}
seccompProfile:
type: RuntimeDefault
{{- end }}
containers:
- name: permitio-pdp
image: "{{ .Values.pdp.image.repository }}:{{ .Values.pdp.image.tag }}"
imagePullPolicy: {{ .Values.pdp.image.pullPolicy }}
{{- if .Values.openshift.enabled }}
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
runAsNonRoot: {{ .Values.openshift.securityContext.runAsNonRoot }}
seccompProfile:
type: RuntimeDefault
{{- end }}
ports:
- containerPort: {{ .Values.pdp.port }}
env:
Expand Down Expand Up @@ -90,10 +107,16 @@ spec:
port: 7000
initialDelaySeconds: 10
periodSeconds: 10
{{- if .Values.pdp.logs_forwarder.enabled }}
volumeMounts:
{{- if .Values.pdp.logs_forwarder.enabled }}
- name: logs
mountPath: /tmp/
{{- else if .Values.openshift.enabled }}
# OpenShift requires explicit writable volumes
- name: tmp-volume
mountPath: /tmp
- name: opa-volume
mountPath: /opa
{{- end }}
{{- if .Values.pdp.logs_forwarder.enabled }}
- name: fluentbit
Expand All @@ -110,11 +133,17 @@ spec:
fieldRef:
fieldPath: metadata.labels['app']
{{- end }}
{{- if .Values.pdp.logs_forwarder.enabled }}
volumes:
{{- if .Values.pdp.logs_forwarder.enabled }}
- name: fluent-bit-config
configMap:
name: fluentbit-config
- name: logs
emptyDir: {}
{{- else if .Values.openshift.enabled }}
# OpenShift writable volumes
- name: tmp-volume
emptyDir: {}
- name: opa-volume
emptyDir: {}
{{- end }}
29 changes: 29 additions & 0 deletions charts/pdp/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{{- if and .Values.openshift.enabled .Values.openshift.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.openshift.serviceAccount.name }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "pdp.labels" . | nindent 4 }}
{{- end }}

{{- if and .Values.openshift.enabled .Values.openshift.serviceAccount.create }}
---
# RoleBinding to allow the ServiceAccount to use the specified SCC
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ .Values.openshift.serviceAccount.name }}-scc-binding
namespace: {{ .Release.Namespace }}
labels:
{{- include "pdp.labels" . | nindent 4 }}
subjects:
- kind: ServiceAccount
name: {{ .Values.openshift.serviceAccount.name }}
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
name: system:openshift:scc:{{ .Values.openshift.serviceAccount.sccName }}
apiGroup: rbac.authorization.k8s.io
{{- end }}
15 changes: 15 additions & 0 deletions charts/pdp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pdp:
# - name: custom_env
# value: "custom_env"
ApiKey: "<your PDP API Key>"

# Use an existing secret for the API key instead of creating one
# If defined, the chart will not create a secret and will use this existing secret
# existingApiKeySecret:
Expand Down Expand Up @@ -41,3 +42,17 @@ resources:
memory: "512Mi"
limits:
memory: "1Gi"

# OpenShift configuration
openshift:
enabled: false # Set to true for OpenShift deployments
serviceAccount:
create: true
name: "permitio-pdp-sa"
sccName: "restricted-v2" # OpenShift Security Context Constraint
# Security context (SCC will override user/group settings automatically)
securityContext:
runAsNonRoot: true
runAsUser: 1001
runAsGroup: 1001
fsGroup: 1001
Loading