Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: ci

on:
push:
branches: ["main"]
branches: ["main", "master"]
pull_request:
workflow_dispatch:

Expand Down
40 changes: 40 additions & 0 deletions sre/IMPLEMENTATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Solution - David Schwartz

# Implementation Notes
- Backend containerization lives in `../backend/Dockerfile`.
- CI/CD pipeline is in `../.github/workflows/ci.yml` and pushes to Docker Hub.
- Helm chart is located at `./charts/backend`.
- Observability is provided via application logs to stdout and a health endpoint at `/actuator/health`.

# Prerequisites (Local Kubernetes via Docker Desktop)
- Docker Desktop with Kubernetes enabled
- NGINX Ingress Controller enabled (Docker Desktop: Settings -> Kubernetes -> Enable Kubernetes, then enable the built-in ingress or install NGINX ingress)
- kubectl
- Helm 3
- Docker Hub account (for pushing/pulling images)

# Build and Run (Local)
## Option A: Build locally and deploy (no registry push needed for Docker Desktop)
- From repository root:
- `docker build -t interview-backend:local ./backend`
- `helm install interview-backend ./sre/charts/backend --set image.repository=interview-backend --set image.tag=local`
- Add a hosts entry: `127.0.0.1 interview-backend.local`
- `curl http://interview-backend.local/api/welcome`
- `curl http://interview-backend.local/actuator/health`

## Option B: Push to Docker Hub and deploy
- `docker login`
- `docker build -t <dockerhub-username>/interview-backend:dev ./backend`
- `docker push <dockerhub-username>/interview-backend:dev`
- `helm install interview-backend ./sre/charts/backend --set image.repository=<dockerhub-username>/interview-backend --set image.tag=dev`
- Add a hosts entry: `127.0.0.1 interview-backend.local`
- `curl http://interview-backend.local/api/welcome`
- `curl http://interview-backend.local/actuator/health`

# CI/CD (Docker Hub)
- Set repository secrets:
- `DOCKERHUB_USERNAME`
- `DOCKERHUB_TOKEN`
- On push to `main`, the pipeline builds and pushes tags:
- `sha-<git-sha>`
- `latest`
41 changes: 1 addition & 40 deletions sre/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,43 +44,4 @@ For the interview, make sure you have the following ready:
- An IDE with your submission code
- A running K8s or K3s cluster (local or cloud-based) to demonstrate your Helm chart deployment
- Make sure you can explain your design choices and answer any questions related to the exercise.
- You will have only 10 minutes to showcase your submission during the interview, so please be concise and focus on the key aspects of your implementation.

# Implementation Notes
- Backend containerization lives in `../backend/Dockerfile`.
- CI/CD pipeline is in `../.github/workflows/ci.yml` and pushes to Docker Hub.
- Helm chart is located at `./charts/backend`.
- Observability is provided via application logs to stdout and a health endpoint at `/actuator/health`.

# Prerequisites (Local Kubernetes via Docker Desktop)
- Docker Desktop with Kubernetes enabled
- NGINX Ingress Controller enabled (Docker Desktop: Settings -> Kubernetes -> Enable Kubernetes, then enable the built-in ingress or install NGINX ingress)
- kubectl
- Helm 3
- Docker Hub account (for pushing/pulling images)

# Build and Run (Local)
## Option A: Build locally and deploy (no registry push needed for Docker Desktop)
- From repository root:
- `docker build -t interview-backend:local ./backend`
- `helm install interview-backend ./sre/charts/backend --set image.repository=interview-backend --set image.tag=local`
- Add a hosts entry: `127.0.0.1 interview-backend.local`
- `curl http://interview-backend.local/api/welcome`
- `curl http://interview-backend.local/actuator/health`

## Option B: Push to Docker Hub and deploy
- `docker login`
- `docker build -t <dockerhub-username>/interview-backend:dev ./backend`
- `docker push <dockerhub-username>/interview-backend:dev`
- `helm install interview-backend ./sre/charts/backend --set image.repository=<dockerhub-username>/interview-backend --set image.tag=dev`
- Add a hosts entry: `127.0.0.1 interview-backend.local`
- `curl http://interview-backend.local/api/welcome`
- `curl http://interview-backend.local/actuator/health`

# CI/CD (Docker Hub)
- Set repository secrets:
- `DOCKERHUB_USERNAME`
- `DOCKERHUB_TOKEN`
- On push to `main`, the pipeline builds and pushes tags:
- `sha-<git-sha>`
- `latest`
- You will have only 10 minutes to showcase your submission during the interview, so please be concise and focus on the key aspects of your implementation.