glamorous-mouse-45555
07/10/2024, 9:33 PMmagnificent-energy-493
glamorous-mouse-45555
07/11/2024, 4:06 PM"services": {
"identity": {},
"oauth2": {},
"permission": {
"config": { }
}
},
Looking for documentation for the config: {}
objectcrooked-father-49084
10/07/2024, 3:12 PMcrooked-father-49084
10/07/2024, 8:30 PM$ORY_NAMESPACE
is your k8s ory namespace.
Generate a Configmap from your directory of OPL files. This command assumes you have one or more in a folder called "./policies", it does not apply anything to your cluster, just loads the files into a configmap and dumps it to yaml:
kubectl create configmap typescript-files-configmap --from-file=./policies/ -n $ORY_NAMESPACE --dry-run=client -o yaml > typescript-files-configmap.yaml
(If you are not doing gitops with your manifests, you can go ahead and apply this configmap before continuing)
Assuming you are using the helm chart, you need to add an extra volume and volume mount to your values overrides and make sure your namespace location is referencing the files mounted. Like so:
keto:
config:
namespaces:
location: file:///etc/config/opl_dir/
deployment:
extraVolumes:
- name: opl-dir-volume
configMap:
name: typescript-files-configmap
extraVolumeMounts:
- name: opl-dir-volume
mountPath: /etc/config/opl_dir/
readOnly: true
Now when you render your chart, it'll generate deployments with this volume and volume mount defined, allowing the location of your policies to be resolved/loaded by keto.
This approach does seem to mean a restart of the pods (at least) is necessary when the policies change, meaning it may not be a good approach if some of your policies are dynamically derived (say from customer-configured rules).