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
- apiVersion: apps/v1
- kind: Deployment
- metadata:
- name: mt4rest
- labels:
- app: mt4rest
- spec:
- replicas: 2
- selector:
- matchLabels:
- app: mt4rest
- template:
- metadata:
- labels:
- app: mt4rest
- spec:
- containers:
- – name: mt4rest
- image: timurila/mt4rest
- ports:
- – containerPort: 80
- livenessProbe:
- httpGet:
- path: /healthz
- port: 80
- initialDelaySeconds: 10
- timeoutSeconds: 2
- periodSeconds: 3
./microk8s.kubectl apply -f ~/mt4dep.yaml
nano ~/mt4srv.yaml
- kind: Service
- apiVersion: v1
- metadata:
- name: mt4rest
- spec:
- selector:
- app: mt4rest
- type: NodePort
- ports:
- - name: http
- protocol: TCP
- port: 80
- nodePort: 30400
- 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.