When mariadb.enabled=true, references the in-cluster MariaDB this chart deploys. When false, references an external CR via mariadb.externalRef. Privileges scoped to the website's database only — no global ALL PRIVILEGES. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
20 lines
586 B
YAML
20 lines
586 B
YAML
apiVersion: k8s.mariadb.com/v1alpha1
|
|
kind: Grant
|
|
metadata:
|
|
name: {{ include "ezscale-website.fullname" . }}-grant
|
|
labels: {{- include "ezscale-website.labels" . | nindent 4 }}
|
|
spec:
|
|
mariaDbRef:
|
|
{{- if .Values.mariadb.enabled }}
|
|
name: {{ include "ezscale-website.fullname" . }}-mariadb
|
|
{{- else }}
|
|
name: {{ .Values.mariadb.externalRef.name }}
|
|
namespace: {{ .Values.mariadb.externalRef.namespace }}
|
|
{{- end }}
|
|
username: {{ .Values.mariadb.username }}
|
|
host: "%"
|
|
privileges:
|
|
- "ALL PRIVILEGES"
|
|
database: {{ .Values.mariadb.database }}
|
|
table: "*"
|