0
votes

I have developed a custom JWTBearerGrantHandler which is packaged as a jar. In a bare metal WSO2 deployment I would add that jar into repository/components/lib and setup the relevant class in repository/resources/conf/default.json:

  "oauth.grant_type.jwt_bearer.grant_handler": "xxx.MyJWTBearerGrantHandler",

However I want to deploy WSO2 API Manager in Kubernetes using the provided Helm chart (https://github.com/wso2/kubernetes-apim/tree/master/advanced/am-pattern-1). In this case, how can I add my custom handler?

1

1 Answers

0
votes

Both changes, adding JAR and configuration(repository/resources/conf/default.json) can be done by building a Docker image. In this case, the base image would be the WSO2 provided Docker image for WSO2 API Manager and you can use Docker COPY Dockerfile instruction to add JAR + configuration file into the Docker image. Once the image is built and pushed to a private registry, please refer to the image via values.yaml.

Another way of adding the JAR file, assuming the JAR file is remotely accessible, is downloading the JAR using an Init container. Please have a look at how the MySQL connector is getting downloaded using init container.

If the given configuration is changing often, it is best to apply it via a K8s Configmap. To add repository/resources/conf/default.json as a Configmap, please have a look at an existing configuration mount