Step by step tutorial how to deploy hyper-converged infrastructure by OpenShift Origin + Gluster for CentOS Atomic Host (deploying containerized Gluster storage with Atomic Host and OpenShift)
Step by step tutorial how to deploy hyper-converged infrustructure by OpenShift Origin v1.5.1 + Gluster for CentOS Atomic Host
Host | OS | IP | Cores | RAM | dev/vda (system) | dev/vdb (docker) | dev/vdc (gluster) |
---|---|---|---|---|---|---|---|
installer.openshift151.amsokol.me | CentOS Minimal | 192.168.151.10 | 2 | 2048 MB | 64 GB | - | - |
master-01.openshift151.amsokol.me | CentOS Atomic | 192.168.151.11 | 2 | 4096 MB | 64 GB | 128 GB | - |
node-1-01.openshift151.amsokol.me | CentOS Atomic | 192.168.151.101 | 2 | 4096 MB | 64 GB | 128 GB | 256 GB |
node-1-02.openshift151.amsokol.me | CentOS Atomic | 192.168.151.102 | 2 | 4096 MB | 64 GB | 128 GB | 256 GB |
node-2-01.openshift151.amsokol.me | CentOS Atomic | 192.168.151.201 | 2 | 4096 MB | 64 GB | 128 GB | 256 GB |
node-2-02.openshift151.amsokol.me | CentOS Atomic | 192.168.151.202 | 2 | 4096 MB | 64 GB | 128 GB | 256 GB |
CentOS Atomic (tested for CentOS-Atomic-Host-7.1704-Installer.iso
): http://cloud.centos.org/centos/7/atomic/images/
CentOS Minimal (tested for CentOS-7-x86_64-Minimal-1704-01.iso
): https://buildlogs.centos.org/rolling/7/isos/x86_64/
Set DNS records from table above.
Set *.app.openshift151.amsokol.me
to 192.168.151.101
Set openshift151.amsokol.me
to 192.168.151.11
You need only root account on installer
and master-01
.
All command should be run under root
!
master-01
, node-1-01
, node-1-02
, node-2-01
, node-2-02
hosts (run for each server):
3. SSH as root and run:
4. Run as root:
vm.overcommit_memory = 1
vm.panic_on_oom = 0
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF
## Configure `installer` host:
1. Install OS
2. SSH as root and run:
3. SSH as root
4. Run (leave all passwords empty):
5. Run (enter root password for for each server):
node-1-01.openshift151.amsokol.me \
node-1-02.openshift151.amsokol.me \
node-2-01.openshift151.amsokol.me \
node-2-02.openshift151.amsokol.me; \
do ssh-copy-id -i ~/.ssh/id_rsa.pub $host; \
done
6. Run:
## Installation:
1. SSH as root to `installer`
2. Check if all nodes are ready:
3. Start installation:
## [Optional, just FYI] Redeploy master certificates (you need to have your own domain instead of amsokol.me):
1. SSH as root to `installer`
2. Uncomment two lines below `"# Redeploy master certificates"` in `inventory-lab02.properties` file:
openshift_master_named_certificates=[{“certfile”: “/root/openshift.amsokol.me.crt”, “keyfile”: “/root/openshift.amsokol.me.key”, “names”:[“openshift.amsokol.me”]}]
openshift_master_overwrite_named_certificates=true
3. Create `openshift-master.pem` and `openshift-master.pem` on `https://www.startssl.com/`
4. Copy `openshift-master.pem` and `openshift-master.pem` to `installer` /root folder
5. Run installation:
## Add administrator user account:
1. SSH as root to `installer`
2. Add `admin` with password:
htpasswd -n admin
‘ /etc/origin/master/htpasswd”
## [Optional, just FYI] Add user developer account (with name `amsokol` as an example)
1. SSH as root to `installer`
2. Add `amsokol` with password
htpasswd -n amsokol
‘ /etc/origin/master/htpasswd”
3. [Optional] Give `amsokol` direct access to OpenShift's Docker registry:
## Install Gluster cluster to OpenShift
1. SSH as root to `installer` and run:
2. Copy all files from `/usr/share/heketi/templates` (on `installer`) to `/root/heketi/templates` (on `master-01` where you need to create `/root/heketi/templates` before)
3. For each `node-1-01`, `node-1-02`, `node-2-01`, `node-2-02` hosts add the following rules to `/etc/sysconfig/iptables` and reboot:
-A OS_FIREWALL_ALLOW -p tcp -m state —state NEW -m tcp —dport 24007 -j ACCEPT
-A OS_FIREWALL_ALLOW -p tcp -m state —state NEW -m tcp —dport 24008 -j ACCEPT
-A OS_FIREWALL_ALLOW -p tcp -m state —state NEW -m tcp —dport 2222 -j ACCEPT
-A OS_FIREWALL_ALLOW -p tcp -m state —state NEW -m multiport —dports 49152:49251 -j ACCEPT
4. [Workaround due to issue [#656](https://github.com/heketi/heketi/issues/656) in Heketi] For each `node-1-01`, `node-1-02`, `node-2-01`, `node-2-02` run the following as root:
5. SSH as root to `master-01` and run:
6. Wait while all pods are created
7. Run (replace `<admin_password>` by `admin` password you set when created account):
-p HEKETI_KUBE_NAMESPACE=aplo \
-p HEKETI_KUBE_APIHOST=https://openshift151.amsokol.me:8443 \
-p HEKETI_KUBE_INSECURE=y \
-p HEKETI_KUBE_USER=admin \
-p HEKETI_KUBE_PASSWORD=<admin_password> | oc create -f -
8. Wait while pod is created and test result:
9. Run:
10. SSH as root to `installer` and run:
11. Copy `heketi-storage.json` from `/root` (on `installer`) to `/root` (on `master-01`)
12. SSH as root to `master-01` and run:
13. Run (replace `<admin_password>` by `admin` password you set when created account):
-p HEKETI_KUBE_NAMESPACE=aplo \
-p HEKETI_KUBE_APIHOST=https://openshift151.amsokol.me:8443 \
-p HEKETI_KUBE_INSECURE=y \
-p HEKETI_KUBE_USER=admin \
-p HEKETI_KUBE_PASSWORD=<admin_password> | oc create -f -
14. Wait while pod is created and test result:
15. SSH as root to `installer` and run:
16. Copy `glusterfs-storageclass.yaml` from `/root/openshift-lab01-hyper-converged` (on `installer`) to `/root` (on `master-01`)
17. SSH as root to `master-01` and run:
oc create -f glusterfs-storageclass.yaml
## Configure Gluster cluster storage for internal Docker registry
1. Login as `admin` (account you created above) to `https://openshift151.amsokol.me:8443`
2. Open `default` project
3. Create storage (`'Storage Classes'`=`'slow'`, `'Name'`=`'docker-registry-claim'`, `'Access Mode'`=`'Shared Access'`, `'Size'`=`50GiB`)
4. SSH as root to `master-01` and run:
```