How to install MT4 restful with microk8s

easy direct connection to any MT4 and MT5 server

How to install MT4 restful with microk8s

We recommend to install on Debian 11 as below:

sudo apt-get update
sudo apt install snapd
sudo snap install microk8s --classic
cd /snap/bin
./microk8s enable dns dashboard storage
nano ~/mt4dep.yaml

Code Snippet
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: mt4rest
  5. labels:
  6.    app: mt4rest
  7. spec:
  8. replicas: 2
  9. selector:
  10.    matchLabels:
  11.      app: mt4rest
  12. template:
  13.    metadata:
  14.      labels:
  15.        app: mt4rest
  16.    spec:
  17.      containers:
  18.      – name: mt4rest
  19.        image: timurila/mt4rest
  20.        ports:
  21.        – containerPort: 80
  22.        livenessProbe:
  23.          httpGet:
  24.            path: /healthz
  25.            port: 80
  26.          initialDelaySeconds: 10
  27.          timeoutSeconds: 2
  28.          periodSeconds: 3

./microk8s.kubectl apply -f ~/mt4dep.yaml
nano ~/mt4srv.yaml

Code Snippet
  1. kind: Service
  2. apiVersion: v1
  3. metadata:
  4. name: mt4rest
  5. spec:
  6. selector:
  7.    app: mt4rest
  8. type: NodePort
  9. ports:
  10. - name: http
  11.    protocol: TCP
  12.    port: 80
  13.    nodePort: 30400
  14. sessionAffinity: ClientIP

./microk8s.kubectl apply -f ~/mt4srv.yaml
./microk8s.kubectl --namespace kube-system patch svc kubernetes-dashboard -p '{"spec": {"type": "NodePort"}}'
./microk8s.kubectl --namespace kube-system patch svc kubernetes-dashboard -p '{"spec": {"ports":[{"nodePort": 30100,"port": 443,"protocol": "TCP","targetPort": 8443}]}}'


------- Check how is whole system running:
./microk8s kubectl get all --all-namespaces
-------- Get control panel token
token=$(./microk8s kubectl -n kube-system get secret | grep default-token | cut -d " " -f1)
./microk8s kubectl -n kube-system describe secret $token

After that control panel should be available at https://localhost:30100 and restful service at http://localhost:30400.

Leave a Reply