The Express custom kubernetes controller is written primarily in go lang. This controller explicitly keeps a watch on newly created Deployments in all Namespaces,
And as soon as a new Deployment is created, our controller will create a Service and an Ingress for it and expose it to the outer world.
These instructions will get you the project up and running on your local machine for development and testing purposes. See Running the Code for notes on how to deploy the project on a Local System or on a Kubernetes Server.
To run the Express Controller on Local System, first we need to install following Software Dependencies.
Once above Dependencies are installed we can move with further steps
A step by step series of examples that tell you how to get a development env running.
minikube start --nodes 2 -p k8s-cluster
minikube addons enable ingress -p k8s-cluster
Set up the Environmental variables according to your needs. The Application will run with defaults as mentioned in the following table
Environmental Variable | Usage | Default Values |
---|---|---|
EXPRESS_QUEUE | Queue for holding interface objects | EXPRESS |
To Run the Express Controller on local machine, Open a terminal in the Project and run following command
go build
./express
To Run the Express Controller inside k8s cluster, follow the below steps
- Create the Role having permissions to list, create, edit and delete the resources in all namespaces
kubectl create role allowAll --resource deployments,pods,services,ingresses --verb list,create,delete
- Create Role Binding of above role with the default service account
kubectl create rolebinding allowAll --role allowAll --serviceaccount default:default
- Create Namespace
kubectl create namespace express
- Deploy the Controller with the Manifest File
kubectl create -f express.yaml
- @r4rajat - Implementation