Skip to content
Open
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
Binary file added chart/charts/postgres-0.14.4.tgz
Binary file not shown.
9 changes: 9 additions & 0 deletions chart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,12 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
True when the pvc-group plugin is enabled in values. Used to gate the
PVC RBAC role/rolebinding so clusters without the plugin don't get the
extra permissions.
*/}}
{{- define "ldap-sync.pvcGroupEnabled" -}}
{{- ((((.Values.config).plugins).pvcGroup).enabled) | ternary "true" "" -}}
{{- end }}
14 changes: 14 additions & 0 deletions chart/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,17 @@ data:
database:
enabled: false
{{- end }}
plugins:
enabled:
{{- with .Values.config.plugins.pvcGroup }}
{{- if .enabled }}
- name: pvc-group
enabled: true
options:
namespace: {{ $.Release.Namespace | quote }}
storageClass: {{ .storageClass | quote }}
size: {{ .size | quote }}
accessModes:
{{- toYaml .accessModes | nindent 14 }}
{{- end }}
{{- end }}
27 changes: 27 additions & 0 deletions chart/templates/rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{- if eq (include "ldap-sync.pvcGroupEnabled" .) "true" }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ include "ldap-sync.fullname" . }}-pvc-group
labels:
{{- include "ldap-sync.labels" . | nindent 4 }}
rules:
- apiGroups: [""]
resources: ["persistentvolumeclaims"]
verbs: ["get", "list", "create"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ include "ldap-sync.fullname" . }}-pvc-group
labels:
{{- include "ldap-sync.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ include "ldap-sync.fullname" . }}-pvc-group
subjects:
- kind: ServiceAccount
name: {{ include "ldap-sync.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}
10 changes: 10 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ config:
bindDN: "cn=admin,dc=example,dc=org"
bindPassword: ""
baseDN: "dc=example,dc=org"
plugins:
# Creates a PVC in the release namespace for every synced group
# entry. When enabled, the chart also installs a Role/RoleBinding
# granting the service account get/list/create on PVCs.
pvcGroup:
enabled: true
storageClass: ""
size: 10Gi
accessModes:
- ReadWriteMany

# PostgreSQL configuration
postgres:
Expand Down
29 changes: 29 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,60 @@ require (
github.com/swaggo/echo-swagger v1.4.1
github.com/swaggo/swag v1.16.4
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.31.0
k8s.io/apimachinery v0.31.0
k8s.io/client-go v0.31.0
)

require (
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 // indirect
github.com/KyleBanks/depth v1.2.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-asn1-ber/asn1-ber v1.5.7 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-openapi/jsonpointer v0.21.1 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/spec v0.21.0 // indirect
github.com/go-openapi/swag v0.23.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/labstack/gommon v0.4.2 // indirect
github.com/mailru/easyjson v0.9.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/swaggo/files/v2 v2.0.0 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
github.com/x448/float16 v0.8.4 // indirect
golang.org/x/crypto v0.36.0 // indirect
golang.org/x/net v0.37.0 // indirect
golang.org/x/oauth2 v0.21.0 // indirect
golang.org/x/sys v0.31.0 // indirect
golang.org/x/term v0.30.0 // indirect
golang.org/x/text v0.23.0 // indirect
golang.org/x/time v0.8.0 // indirect
golang.org/x/tools v0.31.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)
Loading