Installing Foresight Mobile Platform in Cluster

To install Foresight Mobile Platform in the Kubernetes cluster, execute the operations on the first main cluster node:

  1. Download the cluster_charts*.zip archive.

NOTE. To get the archive, contact technical support by sending a request to support@fsight.ru or via technical support services that are available after registration at the website.

  1. Unpack the cluster_charts*.zip archive and create the stackgres and fmp namespaces in the unpacked folder:

kubectl create namespace stackgres
kubectl create namespace fmp
kubectl create rolebinding serviceaccounts-view --namespace=stackgres --clusterrole=view --group=system:serviceaccounts:fmp

  1. Change value of the storageClass parameter to longhorn in the ./fmp/values.production.yaml file contained in the unpacked archive:

...
 data:
   replicaCount: 3
   persistence:
     size: 8Gi
     storageClass: longhorn
...
sgClusters:
 maindb:
   instanceProfile: "size-s"
   instances: 2
   pods:
     disableConnectionPooling: false
     disableMetricsExporter: false
     disablePostgresUtil: false
     persistentVolume:
       storageClass: longhorn
...
 cachedb:
   instanceProfile: "size-s"
   instances: 2
   pods:
     disableConnectionPooling: false
     disableMetricsExporter: false
     disablePostgresUtil: false
     persistentVolume:
       storageClass: longhorn
...

  1. Change the installation folder for StackGres used as a service for creating databases on mobile platform server. To do this, in the stackgres-operator/values.yaml file change value of the containerRegistry parameter to <work node IP address>:5000.

  2. Make sure that the strings are commented or are absent in the fmp/chart/values.yaml file:

#  podSecurityContext:
#    enabled: false
#  containerSecurityContext:
#    enabled: false

  1. Set the StackGres statement to provide mobile platform work in the cluster. Execute the command in the folder root of the unpacked archive:

helm install -n stackgres stackgres-operator ./stackgres-operator/stackgres-operator.tgz -f ./stackgres-operator/values.yaml

  1. Install Foresight Mobile Platform. Execute the command in the folder root of the unpacked archive:

helm install fmp ./fmp/chart -n fmp -f ./fmp/values.production.yaml --set django.deployment.image.registry=<work node IP address>:5000/fmp --set global.imageRegistry=<work node IP address>:5000/fmp --set nginx.ingress.hostname=<mobile platform host> --set fluentd.enabled=true --timeout 30m0s

In the <mobile platform server host> substitution specify name of the server, at which the mobile platform will be available.

If Foresight Mobile Platform is to be installed by a different ServiceAccount account, add the django.deployment.serviceAccountName parameter to the command:

--set django.deployment.serviceAccountName=<ServiceAccount name>

If a different account is used, the standard account and roles of ServiceAccount will not be created.

To set up additional parameters on installing Foresight. Mobile Platform, see the section:

After executing the operations, Foresight Mobile Platform is installed in the cluster and is available via the address specified in the nginx.ingress.hostname parameter.

If required, one can delete the mobile platform from the cluster.

Deleting Foresight Mobile Platform from Cluster

To delete Foresight Mobile Platform from the cluster, execute the operations on the first main cluster node:

  1. Declare the CLUSTER_NAMESPACE variable:

CLUSTER_NAMESPACE=fmp

  1. Delete the fmp manifest from the namespace specified in the CLUSTER_NAMESPACE variable:

helm uninstall fmp -n ${CLUSTER_NAMESPACE} --timeout 30m0s

  1. Delete the rest of the elements that are not deleted with the fmp manifest:

kubectl delete pvc -n ${CLUSTER_NAMESPACE} --all
kubectl delete job -n ${CLUSTER_NAMESPACE} --all
kubectl delete deployment -n ${CLUSTER_NAMESPACE} --all
kubectl delete secrets -n ${CLUSTER_NAMESPACE} --all

  1. Delete the StackGres statement with CRD (Custom Resource Definitions):

helm uninstall -n stackgres stackgres-operator
kubectl get crds -oname | grep "stackgres.io" | xargs kubectl delete

  1. Delete the Grafana application if required:

helm uninstall -n fmp-monitoring fmp-grafana
kubectl delete pvc -n fmp-monitoring --all

  1. Delete the fmp, stackgres, ongres, fmp-monitoring namespaces:

kubectl delete ns fmp stackgres ongres fmp-monitoring

After executing the operations, Foresight. Mobile Platform is deleted from the cluster.

See also:

Preparation and Deployment of Fault-Tolerant Cluster Based on Kubernetes