Welcome to the Smingate infrastructure challenge! A new team needs your expertise to containerize their .NET Web API and a PostgreSQL database, both running in Kubernetes. Additionally, they require you to automate the build, test, and deploy process using your CI/CD skills. The application will be deployed in different environments in the future, so it's important to use Helm templating to keep it easily extendable without duplicating manifests.
- Create a Dockerfile to containerize the existing .NET Web API (Asset.API).
- Deploy a PostgreSQL database using a Helm chart.
- The PostgreSQL instance should have a database called
asset
with a userasset_admin
and passwordadmin
. - Deploy the PostgreSQL instance in the
database
namespace.
- Use Helm templating to create YAML manifests for the .NET Web API (Asset.API).
- Ensure the application is exposed and reachable on your local machine using an ingress.
- The API should be reachable on http://asset-api.local/api.
- After deployment, add a new asset to the database using the POST endpoint.
- Confirm the new asset has been added to the database by retrieving it using the GET endpoint.
- Create a gitlab-ci.yml file for basic CI/CD steps:
- Build: Build the Docker image for the .NET Web API.
- Test: Run unit tests for the application.
- Deploy: Deploy the application to Kubernetes using Helm, ensuring the correct image version is used.
Before starting the task, ensure you have the following set up on your local machine:
- Docker: To build and run Docker images.
- Minikube: To create a local Kubernetes cluster.
- Kubectl: To interact with the Kubernetes cluster.
- Helm: To manage Kubernetes applications with Helm charts.
- .NET SDK: To build and run the .NET Web API.
- Git: To clone repositories and manage version control.
- GitHub Account: To store and manage your code repository.
- Postman (optional): To test the API endpoints.
- Install Docker: Follow the installation guide on the Docker website.
- Create a Docker Hub Account: Follow the signup process on the Docker Hub website.
- Install Minikube: Follow the installation guide on the Minikube website.
- Install Kubectl: Follow the installation guide on the Kubernetes website.
- Install Helm: Follow the installation guide on the Helm website.
- Install .NET SDK: Follow the installation guide on the .NET website.
- Install VS Code (optional): Follow the installation guide on the VS Code website
- Start Minikube: Run minikube start to create a local Kubernetes cluster.
- Ensure that the solution is easily extendable to different environments without duplicating manifests.
- Use best practices for containerization, deployment, and CI/CD.
Good luck, and we look forward to seeing your solution!