# I-Ching The I-Ching (a.k.a. the *Book of Changes*) is an ancient method of divination based on cleromancy (assigning meaning to the generation of apparently random numbers.) Six numbers between 6 and 9 are generated in order to create a hexagram, the meaning of which is contained in the I Ching book. You can find lots of great information on the 2000+ year history of the I-Ching on [Wikipedia](https://en.wikipedia.org/wiki/I_Ching) This app will send an I-Ching horoscope to the pre-configured mailhog instance in configurable intervalls. This app uses the I-Ching library app https://github.com/Velfi/i-ching.git. ## First Start The app can be deployed by running: ```bash $ 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 The backend server is running inside the pod on the address http://localhost:8090/command. If a POST is sent to this address, the server will run the main logic of this app: 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'.