This repository contains the code and Dockerfiles for containers to be used with UM-BRIDGE.
In the simplest instance, these servers can be used as described in the UM-BRIDGE quickstart guide.
To set up to use a Kubernetes cluster the following steps are recommended. The simplest set up follows the recommenedations UM-BRIDGE Kubernetes
- Install and set up a Kubernetes backend e.g. micro-k8s
- Navigate to the model folder e.g. `cd ./doubleglazing'
- (Ignore for
cookies) Create the persistent volume and persistent volume claim. This allows the Kubernetest pods to read and write data in the/output_datasubfolders.microk8s kubectl create -f pv.yamlmicrok8s kubectl create -f pvc.yaml
- Create the pods for the model.
microk8s kubectl create -f model.yaml- The file `model.yaml' allows the number of pods, the resources etc to be tweaked.
- To delete use
microk8s kubectl delete -f model.yaml.
To run multiple models through the same microk8s set up and IP address and ports we use the following set up.
There are two components for each model in the svc-ingress.yaml file.
Firstly services are set up for a model, in this case openfoam.
This selects app: openfoam.
# Service for OpenFOAM application
apiVersion: v1
kind: Service
metadata:
name: svc-openfoam
namespace: default
annotations:
haproxy.org/load-balance: "leastconn" # Use least connections for load balancing
spec:
ports:
- port: 80
protocol: TCP
targetPort: 4242
selector:
app: openfoam
Ingress specifies how this service is reached.
The ingress has a rule identifying paths /openfoam that connect to the Kubernetes access port.
The http message is passed on, with /openfoam stripped from the message so that it can be properly parsed by UM-BRIDGE.
# Ingress for OpenFOAM application
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: openfoam-ingress
annotations:
haproxy.org/path-rewrite: /openfoam/(.*) /\1
spec:
ingressClassName: haproxy
rules:
- http:
paths:
- path: /openfoam
pathType: Prefix
backend:
service:
name: svc-openfoam
port:
number: 80