We're really happy that you're considering to join us! Here's a challenge that will help us understand your skills and serve as a starting discussion point for the interview.
We're not expecting that everything will be done perfectly as we value your time. You're encouraged to point out possible improvements during the interview though!
Have fun!
Pleo runs most of its infrastructure in Kubernetes. It's a bunch of microservices talking to each other and performing various tasks like verifying card transactions, moving money around, paying invoices ...
We would like to see that you both:
- Know how to create a small microservice
- Know how to wire it together with other services running in Kubernetes
We're providing you with a small service (Antaeus) written in Kotlin that's used to charge a monthly subscription to our customers. The trick is, this service needs to call an external payment provider to make a charge and this is where you come in.
You're expected to create a small payment microservice that Antaeus can call to pay the invoices. You can use the language of your choice. Your service should randomly succeed/fail to pay the invoice.
On top of that, we would like to see Kubernetes scripts for deploying both Antaeus and your service into the cluster. This is how we will test that the solution works.
Start by forking this repository. :)
- Build and test Antaeus to make sure you know how the API works. We're providing a
docker-compose.yml
file that should help you run the app locally. - Create your own service that Antaeus will use to pay the invoices. Use the
PAYMENT_PROVIDER_ENDPOINT
env variable to point Antaeus to your service. - Your service will be called if you invoke
/rest/v1/invoices/pay
call on Antaeus. You can probably figure out which call returns the current status invoices by looking at the code ;) - Kubernetes: Provide deployment scripts for both Antaeus and your service. Don't forget about Service resources so we can call Antaeus from outside the cluster and check the results.
- Bonus points if your scripts use liveness/readiness probes.
- Discussion bonus points: Use the README file to discuss how this setup could be improved for production environments. We're especially interested in:
- How would a new deployment look like for these services? What kind of tools would you use?
- If a developers needs to push updates to just one of the services, how can we grant that permission without allowing the same developer to deploy any other services running in K8s?
- How do we prevent other services running in the cluster to talk to your service. Only Antaeus should be able to do it.
If you want to run Antaeus locally, we've prepared a docker compose file that should help you do it. Just run:
docker-compose up
and the app should build and start running (after a few minutes when gradle does its job)
- We will use your scripts to deploy both services to our Kubernetes cluster.
- Run the pay endpoint on Antaeus to try and pay the invoices using your service.
- Fetch all the invoices from Antaeus and confirm that roughly 50% (remember, your app should randomly fail on some of the invoices) of them will have status "PAID".
- Terminal with bash
- git
- kubectl command line configured to point to your kubernetes cluster(i used minikube in my setup)
- docker
git clone git@github.com:viallikavoo/tinjis.git
git clone git@github.com:viallikavoo/backend-vendor-payments.git
- Run inside each repository
./build.sh <your_kubernetes_namespace>
- How would a new deployment look like for these services? What kind of tools would you use?
-
If a developers needs to push updates to just one of the services, how can we grant that permission without allowing the same developer to deploy any other services running in K8s?
- Use access control in your source control , for ex github. Only those having push access to the source code of this service would be able make changes and jenkins would deploy the changes to K8s
-
How do we prevent other services running in the cluster to talk to your service. Only Antaeus should be able to do it.
- Implemented in this solution using API Keys