Skip to content
Snippets Groups Projects
Commit 72cdba60 authored by Martin Schmollinger's avatar Martin Schmollinger
Browse files

Simple REST-Service with K3S configuration.

parent b4a9e068
No related branches found
No related tags found
No related merge requests found
# mytodo-msa
An example implementation of a msa running of the base architecture https://gitlab.reutlingen-university.de/poegel/microservice-architecture
## Current State of Implementation
* Service mytodo manages todo items consisting of an ID and a description.
* Items can be added or retrieves (all or by a certain ID)
* IDs are set at the server side.
* Items are stored in a slice (main memory - no data base yet in use).
* Path-Prefix ist /mytodo, each service method extends this to a full path.
* The service is exposed on port 10000.
## Dockerfile/CI/CD
* Image is tagged with schmolli/mytodo and uploaded to DockerHub.
* Current version is 0.0.2.
* No pipline to build and push the image automatically.
## Current State of the K8S Configuration
* Everybody can read all items or one item with a certain ID.
* Only authorized users can add new items.
## Issues/Findings
* Why does service respond with 501 if we try to add an item without authentication?
* Why do we not use https?
* Service is accessible from windows using the IP of wsl (wsl hostname -I).
* Inside wsl we can use localhost.
\ No newline at end of file
......@@ -17,5 +17,6 @@ spec:
spec:
containers:
- name: mytodo
image: schmolli/mytodo:0.0.1
imagePullPolicy: Always
\ No newline at end of file
image: schmolli/mytodo:0.0.2
imagePullPolicy: Always
\ No newline at end of file
......@@ -10,7 +10,35 @@ spec:
routes:
- kind: Rule
match: Path(`/health`) && Method(`GET`)
match: Path(`/mytodo/health`) && Method(`GET`)
services:
- kind: Service
name: mytodo
namespace: mytodo
port: 10000
- kind: Rule
match: Path(`/mytodo/todos`) && Method(`GET`)
services:
- kind: Service
name: mytodo
namespace: mytodo
port: 10000
- kind: Rule
match: Path(`/mytodo/todos/{id:[0-9]+}`) && Method(`GET`)
services:
- kind: Service
name: mytodo
namespace: mytodo
port: 10000
- kind: Rule
match: Path(`/mytodo/todos`) && Method(`POST`)
middlewares:
- name: fw-auth-mw
namespace: default
services:
- kind: Service
name: mytodo
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment