/mailerlite-sre-test-assignment

MailerLite SRE Test Assignment (https://gist.github.com/robgordon89/ea290c6f4dec89aab1cd8c2ebb9edfe8)

Primary LanguagePython

About

Solution for the MailerLIte SRE Test Assignment ... but in Python. 😅

Set up

Install minikube.

brew install minikube

Create a local k8s cluster with minikube.

minikube start

Make sure you’re in the proper context.

kubectl config current-context

Clone this repo.

git clone git@github.com:jpdoria/mailerlite-sre-test-assignment.git

Switch to the manifests directory.

cd mailerlite-sre-test-assignment/manifests

Apply the manifests in the following order.

kubectl apply -f crds.yaml
kubectl apply -f rbac.yaml
kubectl apply -f deployment.yaml

Update the data.apiToken in the secret.yaml file with the working MailerSend API token, which should be in base64 format.

echo -n 'mlsn.123...456' | base64 -w0 # to encode the token in base64
vim secret.yaml
kubectl apply -f secret.yaml

Update the email.yaml file with the sender, recipient, and message body.

vim email.yaml
kubectl apply -f email.yaml

Check the operator's logs by running this command: kubectl logs -f -l name=email.operator.

image

Check your mailbox for the email.

image

Delete the local k8s cluster.

minikube delete --all --purge

Links