Uploaded image for project: 'Red Hat 3scale API Management'
  1. Red Hat 3scale API Management
  2. THREESCALE-6141

Consider whether the workaround can be included as an alternative way to add a custom policy.

    XMLWordPrintable

Details

    • Task
    • Resolution: Not a Bug
    • Minor
    • None
    • 2.11.0 CR1
    • Documentation
    • False
    • False
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Undefined

    Description

      In THREESCALE-5515, I introduced this workaround. Please consider whether the workaround can be included as an alternative way to add a custom policy.

      Users can register a policy as a configmap.

      Here is an example of registering apicast-example-policy.
      1) fork the repository
      2) $ git clone <forked repository>
      3) $ cd apicast-example-policy
      4) $ oc login <OpenShift URL>
      5) $ oc project <3scale Porject>
      6) $ oc create configmap example-policy --from-file=policies/example/0.1

      This configmap will include apicast-policy.json, example.lua and init.lua files.

      7)
      $ oc set volumes dc/apicast-staging --add --overwrite --name=example-policy \
      --mount-path=/opt/app-root/src/policies/example/0.1 --source='{"configMap":{"name":"example-policy"}}'

      The default policy load path is /opt/app-root/src/policies. To change the path, set a path as APICAST_POLICY_LOAD_PATH environment variables.

      When compared to the procedure in the document,
      pros:

      • this doesn't require building container

      cons:

      • users have to configure all APIcast to enable a policy. If a customer uses an embedded apicast-staging, embedded apicast-prodcution and self-managed apicast, they have to configure it on each apicast.
      • configmap doens't keep directories. so this only applicable when a policy files are in one directory.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rhn-support-tkonishi Takayuki Konishi
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: