\documentclass[a4paper]{article} \title{Sensyne Tech Test\\ Notes and explanations} \date{\today} \author{Spike Lampson} \begin{document} \maketitle \tableofcontents \section{Initial design} Requirements are: Simple web app, with back-end and database, deployed on a cluster of nodes via an orchestration layer. Expectation: Couple of hours, which seems very hopeful for setting up a project at all, let alone finishing it to me. Still, what to do. Initial plan: Create in terraform/AWS. Find basic docker webapp container, deploy that onto EKS, with RDS instance as the back-end. Things to check: \begin{enumerate} \item How much VPC/IG/routing etc still needs to be done by hand (turns out, quite a lot) \item Does EKS handle the load balancer? (Yes, delightfully) \item Find basic docker container (Managed to use kubernetes example) \end{enumerate} \section{Cluster} Cluster based on https://learn.hashicorp.com/terraform/aws/eks-intro, with minor tweaks. \section{Kubeconfig} To create the kubectl config, run \texttt{terraform output kubeconfig > ~/.kube/config}. To create the config map, run \texttt{terraform output config\_map\_aws\_auth > config\_map\_aws\_auth.yaml} followed by \texttt{kubectl apply -f config\_map\_aws\_auth.yaml}. This relies on \texttt{aws-iam-authenticator}, which is installed via https://docs.aws.amazon.com/eks/latest/userguide/install-aws-iam-authenticator.html \section{Creating a basic service} Unashamedly copied from step 4 of https://docs.aws.amazon.com/eks/latest/userguide/getting-started.html \begin{verbatim} ./guestbook.sh \end{verbatim} This will create a basic guestbook service via kubectl, with a Redis back-end. Sadly, it appears that the guide is out of date, as the docker container for the redis-slave services (\texttt{kubernetes/redis-slave:v2}) appears to not be working today. Still, the service starts, and displays a nice error message, and the failure in the pods can be seen with \texttt{kubectl get pods} and \texttt{kubectl describe pods redis-slave}. I have chosen not to use a separate service for redis, or another database, due to having spent some time on this already. This doesn't really fulfill the requirements as I initially read them, but I can make the argument that the redis datastore counts as a database store, without needing to be another service such as RDS. \end{document}