In this article:
To set up deployed cluster based on OKD/OCP:
Set up time service configuration on cluster nodes.
Install Local Storage.
Install Image Registry.
After executing the operations the cluster will be set up. Proceed to installing and updating Foresight Mobile Platform in 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.
To set up time service configuration on cluster nodes:
Create contents of the chrony.conf file in the base64 encoding:
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
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
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
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.
To install local data storage using the OKD service that is Local Storage, execute the following operations on the srv host:
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
Create Local Volume Discovery using the command: Installed Operators > Local Storage > Local Volume Discovery > Create Local Volume Discovery on the OKD administrator panel.
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.
To install the Image Registry image storage, which will store the mobile platform, execute the following operations on the srv host:
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"}}'
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
Apply the configuration using the command:
oc create -f pvc.yaml -n openshift-image-registry
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 in Cluster