Setting Up Cluster

In this article:

Setting Up Time Service Configuration on Cluster Nodes

Installing Local Storage

Installing Image Registry

To set up deployed cluster based on OKD/OCP:

  1. Set up time service configuration on cluster nodes.

  2. Install Local Storage.

  3. Install Image Registry.

After executing the operations the cluster will be set up. Proceed to installing and updating Foresight Mobile Platform on the cluster.

NOTE. Names and IP addresses of hosts are specified for the example of preparation and deployment of cluster based on OKD/OCP and may differ.

Setting Up Time Service Configuration on Cluster Nodes

To set up time service configuration on cluster nodes:

  1. Create contents of the chrony.conf file in the base64 encoding:

  2. cat << EOF | base64
    pool 0.rhel.pool.ntp.org iburst
    driftfile /var/lib/chrony/drift
    makestep 1.0 3
    rtcsync
    logdir /var/log/chrony
    EOF
  3. Create the MachineConfig.yaml file for the Master nodes virtual machine. Replace the base64 string with the string obtained at Step 1:

cat << EOF > ./masters-chrony-configuration.yaml
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
   labels:
    machineconfiguration.openshift.io/role: master
    name: masters-chrony-configuration
spec:
  config:
    ignition:
      config: {}
      security:
        tls: {}
      timeouts: {}
      version: 3.1.0
    networkd: {}
    passwd: {}
    storage:
      files:
      - contents:
          source: data:text/plain;charset=utf-8;base64,<string from Step 1>
        mode: 420
        overwrite: true
        path: /etc/chrony.conf
  osImageURL: ""
EOF
  1. Create the MachineConfig.yaml file for the Worker nodes virtual machine. Replace the base64 string with the string obtained at Step 1:

cat << EOF > ./workers-chrony-configuration.yaml
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
   labels:
    machineconfiguration.openshift.io/role: workers
    name: workers-chrony-configuration
spec:
  config:
    ignition:
      config: {}
      security:
        tls: {}
      timeouts: {}
      version: 3.1.0
    networkd: {}
    passwd: {}
    storage:
      files:
      - contents:
          source: data:text/plain;charset=utf-8;base64,<string from Step 1>
        mode: 420
        overwrite: true
        path: /etc/chrony.conf
  osImageURL: ""
EOF
  1. Apply the configuration using the commands:

oc apply -f ./masters-chrony-configuration.yaml
oc apply -f ./workers-chrony-configuration.yaml

After executing the operations the time service configuration will be set up on cluster nodes.

Installing Local Storage

To install local data storage using the OKD service that is Local Storage, execute the following operations on the srv host:

  1. Install the Local Storage operator using the command:

oc apply -f https://raw.githubusercontent.com/openshift/local-storage-operator/master/examples/olm/catalog-create-subscribe.yaml
  1. Create Local Volume Discovery using the command: Installed Operators > Local Storage > Local Volume Discovery > Create Local Volume Discovery on the OKD administrator panel.

  2. Create Local Volume Set using the command: Installed Operators > Local Storage > Local Volume Set > Create Local Volume Set on the OKD administrator panel.

IMPORTANT. Name of Storage Class Name should match with name of storageClassName in the next section. Disk Mode should be installed in Filesystem.

After executing the operations, Local Storage will be installed.

For details about Local Storage see the OKD documentation.

Installing Image Registry

To install the Image Registry image storage, which will store the mobile platform, execute the following operations on the srv host:

  1. Change state of the Remove operator to Managed using the command:

oc patch configs.imageregistry.operator.openshift.io cluster --type merge --patch '{"spec":{"managementState":"Managed"}}'
  1. Create Persistent Volume Claims using the command:

cat << EOF > ./pvc.yaml
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
    name: image-registry-storage
spec:
    accessModes:
    - ReadWriteOnce
    resources:
        requests:
          storage: 100Gi
     storageClassName: local-sc
EOF
  1. Apply the configuration using the command:

oc create -f pvc.yaml -n openshift-image-registry
  1. Configure the image registry to use Persistent Volume Claims. To do this, change spec.storage.pvc in configs.imageregistry/cluster by replacing storage:{} with the following:

storage:
    pvc:
        claim:
oc edit configs.imageregistry.operator.openshift
oc patch config.imageregistry.operator.openshift.io/cluster --type=merge -p '{"spec":{"rolloutStrategy":"Recreate","replicas":1}}'

After executing the operations, Image Registry will be installed.

For details about Image Registry see the OKD documentation.

See also:

Preparation and Deployment of Fault-Tolerant Cluster Based on OKD/OCP | Installing and Updating Foresight Mobile Platform on Cluster