Last active
June 16, 2022 09:18
-
-
Save TyeolRik/fba6c8ad953caf3640b2bb0aeaa41020 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dnf update -y &&\ | |
| dnf install -y kernel-devel kernel-header* make gcc elfutils-libelf-devel | |
| echo "Installing Docker" | |
| yum install -y yum-utils telnet &&\ | |
| yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo &&\ | |
| yum install -y --allowerasing docker-ce docker-ce-cli containerd.io docker-compose-plugin &&\ | |
| systemctl enable docker.service &&\ | |
| systemctl start docker.service | |
| echo "Docker install complete" | |
| echo "Open Port" | |
| # Dashboard | |
| firewall-cmd --zone=public --permanent --add-port 8443/tcp | |
| firewall-cmd --reload | |
| echo "Check br_netfilter" | |
| printf "br_netfilter" > /etc/modules-load.d/k8s.conf | |
| printf "net.bridge.bridge-nf-call-ip6tables = 1\nnet.bridge.bridge-nf-call-iptables = 1" > /etc/sysctl.d/k8s.conf | |
| sysctl --system | |
| echo "SELinux permissive" | |
| setenforce 0 | |
| sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config | |
| echo "Swap off" | |
| swapon && cat /etc/fstab | |
| swapoff -a && sed -i '/swap/s/^/#/' /etc/fstab | |
| echo "Install CEPH" | |
| cat <<EOF | tee ./initial-ceph.conf | |
| [global] | |
| osd crush chooseleaf type = 0 | |
| EOF | |
| dnf install -y centos-release-ceph-pacific.noarch | |
| dnf install -y cephadm | |
| cephadm add-repo --release pacific | |
| cephadm install ceph-common | |
| cephadm bootstrap --mon-ip $(hostname -I | cut -d ' ' -f1) --config ./initial-ceph.conf | |
| ceph orch apply osd --all-available-devices # There are available HDDs in this node, host. | |
| ceph orch device ls # For checking connected devices' name | |
| # If osd isn't applied automatically, type below command | |
| # ls -al /dev/ # Check what disk is mounted. (ex. /dev/sda, /dev/sdb, /dev/sdc, /dev/sdd) | |
| # ceph orch daemon add osd $(hostname):/dev/sdd # If you want to connect CEPH and disk /dev/sdd | |
| dnf install -y ceph-mgr-dashboard | |
| ceph mgr services # Check Dashboard IP:Port | |
| # Connect to k8s cluster using CEPH-CSI | |
| # https://docs.ceph.com/en/latest/rbd/rbd-kubernetes/ | |
| ceph osd pool create kubernetes | |
| rbd pool init kubernetes | |
| ceph auth get-or-create client.kubernetes mon 'profile rbd' osd 'profile rbd pool=kubernetes' mgr 'profile rbd pool=kubernetes' | |
| ceph mon dump | grep -E 'fsid|mon' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment