OpenShift Clusters uses two installation methods of setting up the OpenShift
- Quick installation method
- Advanced configuration method
Setting Up OpenShift Clusters
Quick Installation Method
This method is used for running a quick unattained cluster setup configuration. In order to use this method, we need to first install the installer.
Interactive method
$ atomic-openshift-installer install
This is useful when one wishes to run an interactive setup.
Unattended installation method
This method is used when one wishes to set up an unattended way of installation method, wherein the user can define a configuration yaml file and place it under ~/.config/openshift/ with the name of installer.cfg.yml. Then, the following command can be run to install the βu tag.
$ atomic-openshift-installer βu install
By default it uses the config file located under ~/.config/openshift/. Ansible on the other hand is used as a backup of installation.
version: v2 variant: openshift-enterprise variant_version: 3.1 ansible_log_path: /tmp/ansible.log deployment: ansible_ssh_user: root hosts: - ip: 172.10.10.1 hostname: vklnld908.int.example.com public_ip: 24.222.0.1 public_hostname: master.example.com roles: - master - node containerized: true connect_to: 24.222.0.1 - ip: 172.10.10.2 hostname: vklnld1446.int.example.com public_ip: 24.222.0.2 public_hostname: node1.example.com roles: - node connect_to: 10.0.0.2 - ip: 172.10.10.3 hostname: vklnld1447.int.example.com public_ip: 10..22.2.3 public_hostname: node2.example.com roles: - node connect_to: 10.0.0.3 roles: master: <variable_name1>: "<value1>" <variable_name2>: "<value2>" node: <variable_name1>: "<value1>"
Once done, we can verify the installation using the following command.
$ oc get nodes NAME STATUS AGE master.example.com Ready 10d node1.example.com Ready 10d node2.example.com Ready 10d
Advanced Installation
Advanced installation is completely based on Ansible configuration wherein the complete host configuration and variables definition regarding master and node configuration is present. This contains all the details regarding the configuration.
Once we have the setup and the playbook is ready, we can simply run the following command to set up the cluster.
$ ansible-playbook -i inventry/hosts ~/openshift-ansible/playbooks/byo/config.yml
Adding Hosts to a Cluster
We can add a host to the cluster using β
- Quick installer tool
- Advanced configuration method
Quick installation tool works in both interactive and non-interactive mode. Use the following command.
$ atomic-openshift-installer -u -c </path/to/file> scaleup
Advanced Configuration Method
In this method, we update the host file of Ansible and then add a new node or server details in this file. The configuration file looks like the following.
[OSEv3:children] masters nodes new_nodes new_master
In the same Ansible hosts file, add variable details regarding the new node as shown below.
[new_nodes] vklnld1448.int.example.com openshift_node_labels = "{'region': 'primary', 'zone': 'east'}"
Finally, using the updated host file, run the new configuration and invoke the configuration file to get the setup done using the following command.
$ ansible-playbook -i /inventory/hosts /usr/share/ansible/openshift-ansible/playbooks/test/openshift-node/scaleup.yml
Managing Cluster Logs
OpenShift cluster log is nothing but the logs which are getting generated from the master and the node machines of the cluster. These can manage any kind of log, starting from server log, master log, container log, pod log, etc. There are multiple technologies and applications present for container log management.
Few of the tools are as listed, which can be implemented for log management.
- Fluentd
- ELK
- Kabna
- Nagios
- Splunk
ELK stack β This stack is useful while trying to collect the logs from all the nodes and present them in a systematic format. ELK stack is mainly divided into three major categories.
ElasticSearch β Mainly responsible for collecting information from all the containers and putting it into a central location.
Fluentd β Used for feeding collected logs to elastic search container engine.
Kibana β A graphical interface used for presenting the collected data as useful information in a graphical interface.
Log Diagnostics
OpenShift has an inbuilt oc ADM diagnostics command with OC that can be used for analyzing multiple error situations. This tool can be used from the master as a cluster administrator. This utility is very helpful in troubleshooting and diagnosing known problems. This runs on the master client and nodes.
If run without any arguments or flags, it will look for configuration files of the client, server, and node machines, and use them for diagnostics. One can run the diagnostics individually by passing the following arguments β
- AggregatedLogging
- AnalyzeLogs
- ClusterRegistry
- ClusterRoleBindings
- ClusterRoles
- ClusterRouter
- ConfigContexts
- DiagnosticPod
- MasterConfigCheck
- MasterNode
- MetricsApiProxy
- NetworkCheck
- NodeConfigCheck
- NodeDefinitions
- ServiceExternalIPs
- UnitStatus
One can simply run them with the following command.
$ oc adm diagnostics <DiagnosticName>
Upgrading a Cluster
Upgradation of the cluster involves upgrading multiple things within the cluster and getting the cluster updated with new components and upgrades. This involves β
- U pgradation of master components
- Up gradation of node components
- Upg radation of policies
- Upgradation of routes
- Upgradation of image stream
In order to perform all these upgrades, we need to first get quick installers or utils in place. For that, we need to update the following utilities β
- atomic-openshift-utils
- atomic-openshift-excluder
- atomic-openshift-docker-excluder
- etcd package
Before starting the upgrade, we need to backup, etc on the master machine, which can be done using the following commands.
$ ETCD_DATA_DIR = /var/lib/origin/openshift.local.etcd $ etcdctl backup \ --data-dir $ETCD_DATA_DIR \ --backup-dir $ETCD_DATA_DIR.bak.<date>
Upgradation of Master Components
In OpenShift master, we start the upgrade by updating the file and then moving on to Docker. Finally, we run the automated executer to get the cluster into the required position. However, before starting the upgrade we need to first activate the atomic openshift packages on each of the masters. The following commands.
Step1 β Remove atomic-openshift packages
$ atomic-openshift-excluder unexclude
Step2 β Upgrade etc on all the masters.
$ yum update etcd
Step3 β Restart the service of etc and check if it has started successfully.
$ systemctl restart etcd $ journalctl -r -u etcd
Step4 β Upgrade the Docker package.
$ yum update docker
Step5 β Restart the Docker service and check if it is correctly up.
$ systemctl restart docker $ journalctl -r -u docker
Step6 β Once done, reboot the system with the following commands.
$ systemctl reboot $ journalctl -r -u docker
Step7 β Finally, run the atomic-executer to get the packages back to the list of yum excludes.
$ atomic-openshift-excluder exclude
There is no such compulsion for upgrading the policy, it only needs to be upgraded if recommended, which can be checked with the following command.
$ oadm policy reconcile-cluster-roles
In most cases, we donβt need to update the policy definition.
Upgradation of Node Components
Once the master update is complete, we can start upgrading the nodes. One thing to keep in mind is, the period of upgrade should be short in order to avoid any kind of issue in the cluster.
Step1 β Remove all atomic OpenShift packages from all the nodes where you wish to perform the upgrade.
$ atomic-openshift-excluder unexclude
Step2 β Next, disable node scheduling before the upgrade.
$ oadm manage-node <node name> --schedulable = false
Step3 β Replicate all the nodes from the current host to the other host.
$ oadm drain <node name> --force --delete-local-data --ignore-daemonsets
Step4 β Upgrade Docker setup on host.
$ yum update docker
Step5 β Restart the Docker service and then start the Docker service node.
$systemctl restart docker $ systemctl restart atomic-openshift-node
Step6 β Check if both of them started correctly.
$ journalctl -r -u atomic-openshift-node
Step7 β After the upgrade is complete, reboot the node machine.
$ systemctl reboot $ journalctl -r -u docker
Step8 β Re-enable scheduling on nodes.
$ oadm manage-node <node> --schedulable.
Step9 β Run the atomic-openshift executer to get the OpenShift package back on the node.
$ atomic-openshift-excluder exclude
Step10 β Finally, check if all the nodes are available.
$ oc get nodes NAME STATUS AGE master.example.com Ready 12d node1.example.com Ready 12d node2.example.com Ready 12d
Next Topic – Click Here
Pingback: OpenShift - CLI Operations - Adglob Infosystem Pvt Ltd
Pingback: Content Marketing - Overview - Adglob Infosystem Pvt Ltd
Pingback: Content Marketing - Target Customer - Adglob Infosystem Pvt Ltd
Pingback: Content Marketing - Content Creation - Adglob Infosystem Pvt Ltd
Pingback: Content Marketing - Media Channels - Adglob Infosystem Pvt Ltd
Pingback: Content Marketing - Editorial Calendar - Adglob Infosystem Pvt Ltd
Pingback: Content Marketing - Basic Tools - Adglob Infosystem Pvt Ltd
Pingback: Content Marketing - Challenges - Adglob Infosystem Pvt Ltd
Pingback: Content Marketing - Blogs - Adglob Infosystem Pvt Ltd
Pingback: Content Marketing - Lifecycle Emails - Adglob Infosystem Pvt Ltd
Pingback: Content Marketing - Whitepapers & Case Studies - Adglob Infosystem Pvt Ltd
Pingback: Content Marketing - eBooks & Digital Magazines - Adglob Infosystem Pvt Ltd
Pingback: Content Marketing - Mobile Apps - Adglob Infosystem Pvt Ltd
Pingback: Content Marketing - Podcasts - Adglob Infosystem Pvt Ltd
Pingback: Content Marketing - Webinars - Adglob Infosystem Pvt Ltd
Pingback: Content Marketing - Infographics - Adglob Infosystem Pvt Ltd
Pingback: Content Marketing - Articles - Adglob Infosystem Pvt Ltd
Pingback: Content Marketing - Social Media - Adglob Infosystem Pvt Ltd
Pingback: Content Marketing - Examples - Adglob Infosystem Pvt Ltd