Deploying custom Kong plugin in GKE deployed Kong API Gateway - kubernetes

I'm looking up on the Kong API gateway and deployed a Kong instance on GKE via Google Cloud Marketplace. I want to add a custom Kong plugin to this instance and enable it for my services. How could I do it? are there any resources I could follow to get an idea on this? thank you.

if you are using docker
you can install any plugin in kong using luarocks
For example here is one sample docker file
FROM kong
ENV LUA_PATH /usr/local/share/lua/5.1/?.lua;/usr/local/kong-oidc/?.lua;;
# For lua-cjson
ENV LUA_CPATH /usr/local/lib/lua/5.1/?.so;;
# Install unzip for luarocks, gcc for lua-cjson
RUN yum install -y unzip gcc
RUN luarocks install luacov
here one example of oidc plugin : https://github.com/nokia/kong-oidc
we can install plugin using : luarocks install <plugin name>
build your own custom docker image and use kong image as base docker image.
here whole example working Dockerfile
FROM kong:latest
USER root
RUN apk update && apk add git unzip luarocks
RUN luarocks install kong-oidc
USER kong
by this way also you can add some of the community plugin and enterprise plugin in docker.

You could either bake the custom plugin into your container image, or modify your Deployment manifest to download and run the plugin with command and arguments in the configuration.
For the first option, you only need to add the commands to install and run the plugin to your Dockerfile, then build an image with docker build. Once you have the new image, you can perform a rolling update by using kubectl set image deployment or modify the workload in the Cloud Console.
Modifying the Deployment YAML would have a similar result, but you would need to add command and arguments to download and run the custom plugin whenever the container starts.
The google-marketplace-kong-app and kong-dist-kubernetes repo has instructions on how to build and deploy Kong manually. I'd recommend checking them and include your custom plugin.

Related

Install geoip2 python library for Odoo 15 on Kubernetes

Hi I have installed Odoo 15 on Kubernetes (using Bitnami chart) and I would like to use the geoip database functionality. To do so, I need to install the geoip2 python library in my Odoo containners before the Odoo server starts.
Installing the geoip2 library is as simple as running pip install geoip2 (or pip3). The problem is that this needs to be done before the Odoo server starts and without ssh-ing into the container (we would like deployments to be entirely automated - no manual interaction).
I've tried InitContainers but they're not a solution because they run in their own container and any library installed in the InitContainer will not be installed in the Odoo container (I am guessing that sidecars would be the same).
Using Lifecyle -> poststart in the deployment yaml does not work either and I suspect that this is because the poststart is executed after the Odoo server is started.
I've tried to use the command: element of the deployment yaml file to first run the install of geoip2 and then the entrypoint of the Odoo image but for some reason this does not seem to work. Maybe this could be a solution if someone can get this to work?
Would anyone have a simple solution, ideally that does not require creating our own image for installing Odoo.
Thanks
Like what David Maze suggested, the simplest and easiest way to get this done is creating a new container image or editing your current container image because all solutions like kubectl or kube jobs or CICD will execute commands inside the container only once the container is brought up. One more option is that you can install geoip2 package and then restart the dependent odoo service but you are saying that this is not working. So, you can edit the existing container image and install geoip2, input your config and commit the image to the registry for creating your deployment.

Install Custom Connector To Kafka Connect on Kubernetes

I'm running the kafka kubenetes helm deployment, however I am unsure about how to install a custom plugin.
When running custom plugin on my local version of kafka I mount the volume /myplugin to the Docker image, and then set the plugin path environment variable.
I am unsure about how to apply this workflow to the helm charts / kubernetes deployment, mainly how to go about mounting the plugin to the Kafka Connect pod such that it can be found in the default plugin.path=/usr/share/java.
Have a look at the last few slides of https://talks.rmoff.net/QZ5nsS/from-zero-to-hero-with-kafka-connect. You can mount your plugins but the best way is to either build a new image to extend the cp-kafka-connect-base, or to install the plugin at runtime - both using Confluent Hub.

We are deploying Open Loyalty on to Google Cloud and we are receiving a Yarn error?

We are installing Open Loyalty Program on to the Google Cloud. Please Google Open Loyalty by Divante Ltd.
We have been trying to deploy this application on google cloud using Kubernetes.
The instance used to deploy this application contains Debian v4.9 as its OS. And we installed Docker, GCloud, Kubernetes and Kompose as the tools for deployment. We built two docker images for the frontend and backend and linked them to the docker-compose file. Now in frontend image, we used (node:5) image from docker hub in Dockerfile of the frontend.
We also changed the docker-compose file as seen below:
enter image description here
After changing the docker-compose file, we ran “kompose up” within the same directory.
which created the deployment and service ‘yaml’ file and then proceeded to run it.
We have pods as given below, but the frontend pod shows some error and some logs.enter image description here
It says yarn not found. When we execute the same process on a local machine, it works as expected.
We are also trying to seek help from Google Support but your help and suggestions will also be highly appreciated.
Yarn is available from node:6. Your front-end image is too old.

How to deploy a Scala/Akka application?

I'm developing an application which subscribes to Instagram real times updates(Users). I need to provide an urlcallback in order to receive the users updates.
Curl -F 'client_id=CLIENT-ID' \
-F 'client_secret=CLIENT-SECRET' \
-F 'object=user' \
-F 'aspect=media' \
-F 'verify_token=myVerifyToken' \
-F 'callback_url=http://YOUR-CALLBACK/URL' \
https://api.instagram.com/v1/subscriptions/
Now my application is running on localhost.
How can I deploy a Scala application in order to have a real urlcallback?
Configure sbt-native-packager at your project by modifying build.sbt and project/plugins.sbt files.
Build your application using sbt-native-packager, either on your local machine or on a build server like Jenkins. This creates a zip, docker image, rpm or Debian. In case you run an Debian type server like Ubuntu, the Debian file would be the easiest choice.
Upload the just created file to your server, using for example scp or rsync. The files created by the build are located in the target directory of your project.
Install your app on your server. In case you are running a Debian type server like Ubuntu and created a Debian file at the build process, a simple dpkg -i will install your app.
In your case you should install a proxy like nginx and configure your app as an nginx backend. See: http://nginx.org/en/docs/http/ngx_http_upstream_module.html
you could use sbt-assembly plugin, make a fat jar with "sbt assembly" in the console and then do java -jar aplication.jar.
There are a couple of ways to deploy your Scala application. If it is a web application, then you can package that application in a .war file and deploy on any machine which has a web server.The another option is you can use an AWS EC2 instance or AWS Elasticbeanstalk service to deploy your .war file.In any case,your urlCallback would be "http://:/"

how to download the applications from my cloudbees account to local directory for modification

I am trying to create and deploy a grails application on the cloud bees i tried using both, cloud-bees sdk and as well as the eclipse sdk . I don't no much how to use the cloud bees sdk so I tried using the eclipse sdk.
In eclipse SDK the command is being executed but only thing fails is that it throws an error, now I want to create and deploy the application on the cloud.
Can you please help me?
You should use the CloudBees SDK to deploy a Grails application on CloudBees platform.
You can find the documentation here.
Basically, you can see on the doc these are the steps in the case you don't need database binding:
Create your application
bees app:create -a my-app jvmPermSize=128
Setting the Grails Environment of the Tomcat server
bees config:set -a my-app -P grails.env=production
Deploy your application
bees app:deploy -a my-app target/my-app-0.1.war
You can generate the war file of your application using the command below:
grails war