diff --git a/README.md b/README.md index 339f8f2763b50a7ccee8a78cd03750130af0ec90..500671e69be677370f04255753440caae452ff12 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,26 @@ # 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 diff --git a/config/deployment/mytodo-deployment.yaml b/config/deployment/mytodo-deployment.yaml index a05df17331da96492de156de23fa33d7f1bf1735..d60e4d67edd4f44aa1f8fb5d16fe0d0e702148ac 100644 --- a/config/deployment/mytodo-deployment.yaml +++ b/config/deployment/mytodo-deployment.yaml @@ -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 diff --git a/config/ingressroute/mytodo-ingressroute.yaml b/config/ingressroute/mytodo-ingressroute.yaml index 985aa30af8c53876e73a49e460b508c7e4972b56..6df145290e3a1df037a63ac57d40b7ac39c8ec6e 100644 --- a/config/ingressroute/mytodo-ingressroute.yaml +++ b/config/ingressroute/mytodo-ingressroute.yaml @@ -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