postee
postee copied to clipboard
How to mount rego templates?
Hi,
We installed postee with the supplied Helm chart, however it doesn't seem to support volume mounting anywhere other than on the host. Is it possible to modify the chart to support the existing volume mount?
Regards
UP :)
I have the same issue, later I use the URL to solve the problem.
@weibo-zhao when you say you use the URL, it's postee-ui?
i have postee also deployed with the helm chart and you can make use of the extra mount vars in the chart to mount a template(s) from a configmap to a sub folder in /server/rego-templates : i'm using version v2.12.0
configmap with template(s):
apiVersion: v1
kind: ConfigMap
metadata:
name: postee-templates
data:
trivy-operator-jira.rego: |
package postee.trivyoperator.jira
with_default(obj, prop, default_value) = default_value{
not obj[prop]
etc...
trivy-operator-custom-slack.rego: |
package postee.trivyoperator.custom.slack
etc
values postee chart:
# Extra Volumes to add to the postee Statefulset
extraVolumes:
- name: custom-templates
configMap:
name: postee-templates
items:
- key: trivy-operator-jira.rego
path: trivy-operator-jira.rego
- key: trivy-operator-custom-slack.rego
path: trivy-operator-custom-slack.rego
# Extra Volumes Mounts to add to the postee Statefulset
extraVolumeMounts:
- name: custom-templates
mountPath: /server/rego-templates/my-custom-templates
and add the template in the values:
# Templates are used to format a message
templates:
- name: trivy-operator-jira
rego-package: postee.trivyoperator.jira
- name: trivy-operator-custom-slack
rego-package: postee.trivyoperator.custom.slack