Set up customized Jwt Grant Handler when using Helm installation of WSO2 Api Manager 3.x - wso2

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?

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

Related

Wso2 mi dashboard create docker image

I am able to run my mi dashboard, (i'm using v4.0.1.17 as it allows me to replace the default H2 database), successfully on Windows. I now want to create a docker image for the same version, but I cannot find it's release in the official GitHub repositories. I tried vainly to build an image for provided version 4.0.1.2 and then replaced the zipped directory with my own 4.0.1.17 one, but it didn't work. Any suggestions would be welcome. Thanks.
You can get the updated docker image for MI Dashboard from the WSO2 Private Docker registry. The page wso2mi-dashboard contains a list of all the docker images released with the update tag.
In your case to pull the v4.0.1.17 you can use the following command,
docker pull docker.wso2.com/wso2mi-dashboard:4.0.1.17
Note that you need to log in to docker.wso2.com with the WSO2 subscription credentials before pulling the image
docker login docker.wso2.com

Update the Web-Front-End of a Google Kubernetes Engine Webapplication

i used this https://cloud.google.com/kubernetes-engine/docs/tutorials/guestbook?hl=de to bulid a Guestbook with Google Kubernetes Engine.
I applyed this an everything works.
Now i wanted to change the index.html for a better Look.
How can i upload or update the changed file?
I tried to apply the frontend service again with this
kubectl apply -f frontend-service.yaml
But it did not work.
You will have to rebuild the containers if you make changes to the source code. I suggest you:
Download docker and run docker build to rebuild the containers locally.
Push the containers to your own Artifact Registry(AR) following this guide https://cloud.google.com/artifact-registry/docs/docker/pushing-and-pulling.
Update the yaml files to point to your own AR.
Redeploy the application to GKE

Should I use docker in order to be able to run ChomeDriver on Azure Web App Services in Django Server?

Recently I have started a Django server on Azure Web App Service, now I want to add a usage of "ChromoDriver" for web scraping, I have noticed that for that I need to install some additional Linux packages (not python) on the machine. the problem is that it gets erased on every deployment, does it mean that I should switch to Docker ?
Container works, but you can also try to pull down the additional packages in the custom start up file without messing around the machine after the deployment
https://learn.microsoft.com/en-us/azure/developer/python/tutorial-deploy-app-service-on-linux-04

How to add config file while pushing default docker image to cloud foundry

As announced the Swisscom logstash buildpack is not supported any longer.
The proposed solution is to push the default docker image.
I am trying to figure out the way to attach the curator configuration without "baking" it inside the docker image. Any ideas?
thanks
There are two articles in the support forum that discuss some aspects of your question here:
https://docs.developer.swisscom.com/service-offerings/logstash-docker.html
https://docs.developer.swisscom.com/service-offerings/kibana-docker.html
They do in fact recommend:
If you wish to use configuration files instead, you can fork the official Docker image and ADD your configuration files in your own Dockerfile.
I assume that is exactly what you did not want to do, but you can pass in most of the config via environment variables as far as I understand.
If you are ok with creating a separate Docker image, you could also host the config somewhere (let's say on S3) and then dynamically retrieve it on start-up of your Docker container.
You could also build the config setup into your deployment setup, although I haven't tried this with the docker build-pack, you can "stack" multiple build-packs in CloudFoundry and pre-load your configuration files into the virtual server as part of an initial build-pack step. There is more information on how to do that here: https://docs.cloudfoundry.org/buildpacks/use-multiple-buildpacks.html

How do I make a django project compatible with AWS Beanstalk?

I want to make a Django project compatible with AWS Beanstalk.
I dont want this to be like in AWS tutorial, since they use git and need to setup the whole project as they tell.
I just want to know if there is a way of converting an already created Python-Django project to be AWS Beanstalk compatible. I mean, isn't there a standard project layout to download or a plugin or command-line tool that creates the .ebsettings folder for me? I want to convert my project and upload it throw the AWS web gui, dont need all the git stuff.
You can do this without using git route. You just need to zip your source bundle and upload to the Beanstalk Web Console. The code structure can be kept the way you want.
Key configurations are:
1. WSGIPath : This should point to the .py file which you need to start the app (WSGI app)
2. static: This should point to the path containing the static files
You can add the configurations in the .ebextensions folder, which should at the root of your app zip. You can read more details here: Customizing and Configuring a Python Container - AWS Elastic Beanstalk