Skip to main content

Installing OpenShift 3.11 on CentOS 8

Installing OpenShift 3.11 on CentOS 8

OS & versi OpenShift yang di gunakan:
OS: CentOS 8
OpenShift 3.11

NOTE: untuk OpenShift 4.x belum bisa di CentOS 7/8 baru bisa di RHEL.

Update CentOS:
$ sudo yum update

Install Prereq:
$ sudo yum install -y yum-utils device-mapper-persistent-data lvm2
$ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
$ sudo yum install -y  docker-ce docker-ce-cli containerd.io
$ sudo usermod -aG docker $USER
$ newgrp docker

set LAN Network Registries:
$ sudo mkdir /etc/docker /etc/containers
$ sudo nano /etc/containers/registries.conf

Paste below (boleh pake vi, tee, nano, pico):
[registries.insecure]
registries = ['10.6.0.0/16']

Save (Ctrl+o) & Exit (Ctrl +x)

$ sudo nano /etc/docker/daemon.json

Paste below:
{
   "insecure-registries": [
     "10.6.0.0/16"
   ]
}

Save & Exit 

NOTE: Network Internal terserah kita set nya mo segmen berapa: bisa 10.x.x.x/24 bisa 192.x.x.x/16 asalkan ip Private segment.

Reload systemd & restart docker daemon:
$ sudo systemctl daemon-reload
$ sudo systemctl restart docker

Enable Docker to start at boot:
$ sudo systemctl enable docker

Enable IP forwarding:
$ sudo echo "net.ipv4.ip_forward = 1" | sudo tee -a /etc/sysctl.conf

Cek IP forwarding enabled:
$ sudo sysctl -p

Kalo ada firewall:
DOCKER_BRIDGE=`docker network inspect -f "{{range .IPAM.Config }}{{ .Subnet }}{{end}}" bridge`
sudo firewall-cmd --permanent --new-zone dockerc
sudo firewall-cmd --permanent --zone dockerc --add-source $DOCKER_BRIDGE
sudo firewall-cmd --permanent --zone dockerc --add-port={80,443,8443}/tcp
sudo firewall-cmd --permanent --zone dockerc --add-port={53,8053}/udp
sudo firewall-cmd --reload

OPENSHIFT ORIGIN INSTALLATION:
NOTE: Openshift harus di jalanin via user bukan root

Download Linux oc Binary 
$ cd /home/$USER
$ tar xvf openshift-origin-client-tools*.tar.gz
$ cd openshift-origin-client*/

Copy/Move oc binary & kubectl ke folder /usr/local/bin & /usr/sbin
$ sudo cp oc kubectl /usr/local/bin
$ sudo cp oc kubectl /usr/sbin

Verify installation of OpenShift:
$ oc version

Start OpenShift Origin Local Cluster:
$ oc cluster up --routing-suffix=<ServerPublicIP> --public-hostname=<ServerPublicIP>

Cek status Cluster:
$ oc cluster status

Login WebConsole OKD:
chrome/firefox address : https://<ServerPublicIP>:8443/console/

username: developer
password: developer

Stop OpenShift Cluster:
$ oc cluster down

Supaya Apps yang di Deploy bisa di akses dari luar:
$ sudo iptables -A FORWARD -p tcp -d 10.6.0.10 --dport 808 -j ACCEPT

Penjelasan:
Memforward packet ke IP private (apps terdeploy bisa di liat IP nya di pods) dengan destinasi port 808

$ sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 808 -j DNAT --to 10.6.0.10:8080

Penjelasan:
menerima PreRoute untuk Interface eth0 (Interface IP Public berada) dengan protocol tcp yang mengarah ke port 808 di arahkan (DNAT) ke IP Private (dimana nodes/pods berada/terdeploy) dan di port berapa.

apps ada di node 172.17.0.10 port internal saat deploy.
--dport port yg mo di buka via IP Public

untuk melihat iptables:
$ sudo iptables -Lvn -t nat 

Penjelasan:
melisting iptables utk semua rule termasuk chain rule nat.


References:
- https://computingforgeeks.com/setup-openshift-origin-local-cluster-on-centos/
- https://docs.openshift.com/container-platform/3.9/cli_reference/basic_cli_operations.html

Untuk docker hub bisa di deploy ke cluster ini, ga bisa via web harus via terminal:
- https://www.openshift.com/blog/deploying-images-from-dockerhub

Comments

Popular posts from this blog

Windows Subsystem for Linux (WSL)

APA ITU WSL? Windows Subsystem for Linux adalah sebuah fitur windows 10 yang memungkinkan kita menjalankan native linux command-line tools langsung di windows. UNTUK SIAPA? WSL diperuntukkan untuk para developers -- terutama web developers dan mereka yang akan/sedang mengerjakan project open source. dengan ini mereka yang memerlukan BASH untuk menjalankan Linux command-line tools seperti awk, ls, ruby, python dll. dapat memanfaatkan tools ini agar bisa running bersamaan dengan windows. APA YANG BISA DILAKUKAN WSL? WSL menyediakan sebuah aplikasi bernama Bash.exe yang, ketika di run, akan membuka sebuah konsol Windows baru dimana dengan konsol ini kita dapat menjalankan shell Bash. Dengan menggunakan Bash, Kita bisa menjalankan tool dan aplikasi Linux command-line. Misalnya, ketik lsb_release -a dan tekan enter; Anda akan melihat detil distro Linux yang sedang berjalan. Kita juga dapat mengakses filesystem komputer lokal Anda dari dalam shell Bash Linux - Kita akan menemukan d...

Installing g2ipmsg in intrepid

prerequisites package: - gettext - libpanel-applet2-dev - libgnomeui-dev - gnome-network-admin command #sudo apt-get install gettext libpanel-applet2-dev libgnomeui-dev gnome-network-admin donlod g2ipmsg from here i'm using the g2ipmsg-0.9.6 source package and ubuntu intrepid 8.10 after that untar the package with: #tar zxvf g2ipmsg-0.9.6.tar.gz #cd g2ipmsg-0.9.6 # ./configure --prefix=/usr --sysconfdir=/etc --enable-systray \ --with-ext-charcode=CP932 --disable-doxygen-doc Check if the configure command is working with no errors and after there are no errors go to the next step which is: #make Check if this has errors too hopefully the prerequisites are helping, and after a sucessfull 'make' the next step is: #make install after this u will be able to check if the installation successfull or not simply just try to find an icon on your desktop or list this file 'g2ipmsg' in /usr/bin folder. after u are able to find the file try to run in with: $sudo /usr/...

Mount ISO image file on HP-UX

There are 2 ways to mount iso file in hp-ux 1) using LVM method (to copy ISO into a logical volume) is the same as for older HP-UX releases: 1. Find out the size of the ISO image: # du -k /data/myImage.iso NOTE: The size will be in Kb. 2. Create a logical volume for the ISO image: # lvcreate -L -n iso /dev/vg00 NOTE: The name of the logical volume will be /dev/vg00/iso 3. Copy the ISO file to the raw logical volume: # dd if=/data/myImage.iso of=/dev/vg00/riso bs=64k 4. Create a temporary directory and mount the /dev/vg00/iso volume # mkdir /iso_image # mount /dev/vg00/iso /iso_image NOTE: For HP-UX 11.11 you must install the latest CDFS patches: PHCO_25841 Add Rock Ridge extension to mount_cdfs(1M) PHKL_26269 Rock Ridge extension for ISO-9660 PHKL_34153 CDFS cumulative patch 2) Available in HP-UX 11.31 0909: ISOIMAGE-ENH. Provides a new DLKM module fspd. Required to mount, read and umount the ISO image file. The comm...