This commit is contained in:
parent
2cf73e1cb2
commit
43d4514bc6
6 changed files with 81 additions and 64 deletions
|
@ -19,11 +19,10 @@ It is also possible to configure the intervall of days between the sending of ho
|
|||
The app can be deployed by running:
|
||||
|
||||
```bash
|
||||
$ kubectl apply -f ingress.yaml
|
||||
$ kubectl apply -f service.yaml
|
||||
$ kubectl apply -f deployment.yaml
|
||||
```
|
||||
|
||||
This will start the deployment of the app in the pod, the service and an ingress for the HTTP frontend server and an ingress for the backend server.
|
||||
When a pod with the app is initally started, one email will be sent to the configured receiver.
|
||||
|
||||
## Backend Server
|
||||
|
@ -32,10 +31,12 @@ The backend server is running inside the pod on the address http://localhost:809
|
|||
An E-Mail with an I-Ching horoscope (provided by the library app) will be sent to the configured email address.
|
||||
|
||||
The backend server can be tested from inside the pod by calling 'curl -X POST http://localhost:8090/iching/api/command' from the console.
|
||||
The backend server has a separate ingress, so API requests can get forwarded to the backend. Also the backend does not need 'rewrite target'.
|
||||
|
||||
## HTTP Server
|
||||
|
||||
The frontend server is running inside the pod on the address http://localhost:8080/iching. It provides an HTML homepage with a button. Upon pressing the button, the backend server will be called (to send an E-Mail).
|
||||
The frontend server has a separate ingress from the backend server, since the frontend server needs the 'rewrite target' annotation: So the Frontend is not running in the root folder but using the sub-path 'iching'.
|
||||
|
||||
<!--## Testing
|
||||
The Jest unit tests can be run with
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: iching-backend-ingress
|
||||
namespace: argocd
|
||||
spec:
|
||||
ingressClassName: nginx
|
||||
rules:
|
||||
- host: 192-168-197-2.c-one-infra.de
|
||||
http:
|
||||
paths:
|
||||
- path: /iching/api(/|$)(.*)
|
||||
pathType: ImplementationSpecific
|
||||
backend:
|
||||
service:
|
||||
name: iching-service
|
||||
port:
|
||||
number: 81
|
||||
tls:
|
||||
- hosts:
|
||||
- 192-168-197-2.c-one-infra.de
|
||||
secretName: argocd-net-tls
|
|
@ -1,3 +1,5 @@
|
|||
# --- DEPLOYMENT --------------------------------------------
|
||||
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
|
@ -17,3 +19,78 @@ spec:
|
|||
name: iching-broker
|
||||
imagePullPolicy: Always
|
||||
|
||||
---
|
||||
|
||||
# --- SERVICE -----------------------------------------------
|
||||
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: iching-service
|
||||
namespace: argocd
|
||||
spec:
|
||||
selector:
|
||||
app: iching-broker
|
||||
ports:
|
||||
- name: frontend
|
||||
port: 80
|
||||
targetPort: 8080
|
||||
- name: backend
|
||||
port: 81
|
||||
targetPort: 8090
|
||||
|
||||
---
|
||||
|
||||
# --- INGRESS: Frontend -------------------------------------
|
||||
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: iching-frontend-ingress
|
||||
namespace: argocd
|
||||
annotations:
|
||||
nginx.ingress.kubernetes.io/rewrite-target: /$2
|
||||
spec:
|
||||
ingressClassName: nginx
|
||||
rules:
|
||||
- host: 192-168-197-2.c-one-infra.de
|
||||
http:
|
||||
paths:
|
||||
- path: /iching(/|$)(.*)
|
||||
pathType: ImplementationSpecific
|
||||
backend:
|
||||
service:
|
||||
name: iching-service
|
||||
port:
|
||||
number: 80
|
||||
tls:
|
||||
- hosts:
|
||||
- 192-168-197-2.c-one-infra.de
|
||||
secretName: argocd-net-tls
|
||||
|
||||
---
|
||||
|
||||
# --- INGRESS: Backend ---------------------------------------
|
||||
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: iching-backend-ingress
|
||||
namespace: argocd
|
||||
spec:
|
||||
ingressClassName: nginx
|
||||
rules:
|
||||
- host: 192-168-197-2.c-one-infra.de
|
||||
http:
|
||||
paths:
|
||||
- path: /iching/api(/|$)(.*)
|
||||
pathType: ImplementationSpecific
|
||||
backend:
|
||||
service:
|
||||
name: iching-service
|
||||
port:
|
||||
number: 81
|
||||
tls:
|
||||
- hosts:
|
||||
- 192-168-197-2.c-one-infra.de
|
||||
secretName: argocd-net-tls
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: iching-frontend-ingress
|
||||
namespace: argocd
|
||||
annotations:
|
||||
nginx.ingress.kubernetes.io/rewrite-target: /$2
|
||||
spec:
|
||||
ingressClassName: nginx
|
||||
rules:
|
||||
- host: 192-168-197-2.c-one-infra.de
|
||||
http:
|
||||
paths:
|
||||
- path: /iching(/|$)(.*)
|
||||
pathType: ImplementationSpecific
|
||||
backend:
|
||||
service:
|
||||
name: iching-service
|
||||
port:
|
||||
number: 80
|
||||
tls:
|
||||
- hosts:
|
||||
- 192-168-197-2.c-one-infra.de
|
||||
secretName: argocd-net-tls
|
|
@ -56,7 +56,7 @@
|
|||
<h1>🧘 My I-Ging Horoscope</h1>
|
||||
<p>Click on the Button to receive your personal Horoscope. 100% accuracy guaranteed!</p>
|
||||
<button id="myButton">✨ Receive Horoscope ✨</button>
|
||||
<div class="footer">With Love & Chance from the Cosmos 💫</div>
|
||||
<div class="footer">With Love & Fortune from the Cosmos 💫</div>
|
||||
</div>
|
||||
|
||||
<script type="module" src="./event.mjs"></script>
|
||||
|
|
15
service.yaml
15
service.yaml
|
@ -1,15 +0,0 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: iching-service
|
||||
namespace: argocd
|
||||
spec:
|
||||
selector:
|
||||
app: iching-broker
|
||||
ports:
|
||||
- name: frontend
|
||||
port: 80
|
||||
targetPort: 8080
|
||||
- name: backend
|
||||
port: 81
|
||||
targetPort: 8090
|
Loading…
Reference in a new issue