Configuring user-defined policies on the API Gateway in a Kubernetes deployment
For a Kubernetes deployment that uses the DataPower API Gateway, user-defined Policies are externally configured. To distribute the user-defined policies on the DataPower API Gateway, you create a Kubernetes ConfigMap that is installed using the extra values file. The ConfigMap ensures the policies are available to the Management server.
About this task
- When to use the instructions in this task
-
Use the instructions in this topic for distributing user-defined policies when both of the following two conditions are met:
- Your Gateway services is deployed on Kubernetes. The Management service is also usually deployed on Kubernetes.
- Your topology uses the DataPower API Gateway, not the DataPower Gateway (v5 Compatible).
For an explanation of gateway types, see API Connect gateway types.
For a Kubernetes deployment with the DataPower® API Gateway, you can configure user-defined policies on the Gateway subsystem for distribution to API Manager as part of the deployment process, or you can configure user-defined policies at any time, on any platform, after the deployment process is complete. With the DataPower Gateway (v5 compatible) you can configure user-defined policies only after the deployment process is complete. For details of how to configure user-defined policies after deployment with either gateway type, see Authoring policies.
To configure user-defined policies on the Gateway subsystem for distribution to API Manager during deployment, you create a Kubernetes ConfigMap containing the code for the policy and then add an entry in the extra values file to point to the ConfigMap. When the APICUP installation command is executed, the externally-configured policies will be loaded into the DataPower configuration at start-up and then shared with the API Manager, which makes them available in the assembly palette. A Kubernetes ConfigMap ensures that the externally configured user-defined policies are available when the Gateway is started, across upgrades and restarts of the Gateway, and when scaling the number of pods in a cluster. The policies are uploaded directly to the
apic-gw-service
object, which was installed using the APICUP installer. See Installing the Gateway subsystem in a Kubernetes environment for instructions on installing the Gateway, including how to install the extra values file.In cases where non-standard charts or other types of virtual or physical deployments, these policies must be mounted or placed on all the members of the Gateway service.
- For topologies using a virtual or physical gateway with the DataPower API Gateway
-
If your topology uses a virtual (OVA) or physical DataPower Gateway and the DataPower API Gateway, then refer to the DataPower documentation for configuring an assembly function available here: Configuring an assembly function.