Posts

Install Konga on K8S

Even though when running Kong API Gateway in K8S, It's recommended to use the yaml descriptive files to create the routes and services for your applications, you can use the Kong Admin API [3] and the Konga web interface [2] for those tasks. This tutorial shows you how to install Konga on your K8S cluster using helm (I based on [1] and added support for pod annotations). All source code and the helm chart used in this tutorial are at [0]. Prerequisites: - You have the master role in your K8S cluster to install new applications, create ingresses, etc. - Kong API Gateway (Kong Ingress Controller) has been installed on your K8S cluster and in the kong namespace - You have full privileges to create a new Postgres database for your Konga Install Konga on K8S: 1. Create the Postgres DB for your Konga CREATE USER konga; CREATE DATABASE konga OWNER konga; ALTER USER konga WITH PASSWORD <your secret>; 2. Prepare the values.yaml file Update the values.yaml with these following informat

Running Selenium with chromedriver inside a Windows container

Image
Running Selenium for Web UI testing in a Windows container is a little bit tricky. I spent a week on this and finally could make it to work thanks to the idea in [1]. Woohuu! Let's take a look at this sample Java application that runs Selenium with chromedriver. 1. Make sure your Desktop Docker running with Windows Container mode 2. In your Dockerfile, make sure: Install the needed fonts (googlechrome) => this is the most important thing!   ADD files/fonts.tar /Fonts/ WORKDIR /Fonts/ RUN @powershell -NoProfile -ExecutionPolicy Bypass -Command ".\Add-Font.ps1 Fonts" Enable Web-WebSockets feature using Powershell RUN @powershell -NoProfile -ExecutionPolicy Bypass -Command "Add-WindowsFeature Web-WebSockets" Install chocolatey to install openjdk8, and googlechrome RUN @powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%

Build and run Windows container

Image
Running Windows container... wait what? Windows??? WTF? Okay, take it easy genius! It gonna be alright! Microsoft has been working closely with Docker to add containerized applications for its OS platform. And, it's working nicely even though at first you will feel the pain in the ass. There are a couple of things you need to take into account working with Windows container First of all, you have to use a Windows machine to build and run Windows containers. Containers are using the underlying Operating System resources and drivers, so Windows containers can run on Windows only (Linux containers can run on Windows with WSL enabled). If you're using Docker Desktop on Windows 10, you have to use it with Windows Container enabled. There will be no GUI Windows environment (servercore or nanoserver) [1]. Of course, it's containers! There will be no "latest" tag for your Windows base docker image. Powershell is the King [2]. Just like any Linux container, you have to use

Use BFS algorithm to find the accessible area of a robot in a 2D graph

Image
Recently, I found myself started to love working with algorithms. The funny thing is I was never interested in algorithms back in my university time. Maybe because I'm more attracted to something that has a visual appearance or has real-life applications, something like Physics I thought. After more than 10 years working in the field of cloud computing, networks, and computer system, I realized everything are operating by algorithms. Algorithms to optimize network configurations, algorithms to make the application process faster, algorithms to auto-scale the clusters, etc. It may be a little bit too late but right now I can tell algorithms are beautiful. I tried some HackerRank coding challenges and the problem below caught my eye because it's used in pathfinder, searching, etc. They can be very useful for a cloud architect like myself when optimizing network configurations or building some automation apps. The Problem: There is a robot that can move around on a grid. The robot

Dockerize your development environment

Image
Recently, a friend of mine asked me about how I set up my development so that it's easy to move onto production without many issues such as the differences between the environments, dependencies, etc. Here are a couple of questions. Deploy Dev environment + staging environment in containers? Is deploying a big container and stuffing all packages reasonable? What are the differences between Python container vs Ubuntu container? and which one to use? Can Dockerfile execute commands or scripts (e.g., automatically create users, run an existing script, etc.)? When deploying the application with the container, how are the logs collected? How to handle the versioning process? So your company is on the way to streamline the process of developing, testing, and deploying software to production? But you are confused because there are so many tools out there such as Kubernetes, the "CI/CD universe" and stuff, ain't you? No problem. You just need to get started with

Kong for your microservices

Image
The Kong API Gateway [1] has been around for some time and it has been evolving from an APIs Management solution to an industry-standard tool for the cloud-native environments. People are choosing Kong because it is super easy to set up and operate, as well as its capability to scale and extend with plugins. I have been a Kong user and administrator for a while as a DevOps engineer, and I think I should write down my experience with it before too many new things take over my head. This article will focus on a deployment strategy for Kong in a microservice architecture [2]. CONTENTS Introduction Kong's architecture Kong for microservices Common issues & what we can improve INTRODUCTION A quick introduction of Kong and Microservice Architecture could be a great way to get started. Kong We can summarize Kong as follows. Open-source cloud-native, fast, scalable, and distributed Microservice Abstraction Layer. It means that Kong can be deployed in containerized e

Delete all Kong targets using bash

Some times I just want to delete all the Kong targets and redeploy all the APIs to troubleshoot some issues. So, I wrote the below bash script: Usage ./clean_all_kong_targets.sh kong.dangtrinh.com:8001