Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to mount rego templates? #532

Open
HW-Jeremy opened this issue Feb 23, 2023 · 4 comments
Open

How to mount rego templates? #532

HW-Jeremy opened this issue Feb 23, 2023 · 4 comments

Comments

@HW-Jeremy
Copy link

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

@HW-Jeremy
Copy link
Author

UP :)

@weibo-zhao
Copy link

I have the same issue, later I use the URL to solve the problem.

@HW-Jeremy
Copy link
Author

@weibo-zhao when you say you use the URL, it's postee-ui?

@martijnvdp
Copy link
Contributor

martijnvdp commented Aug 1, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants