本篇內(nèi)容介紹了“OpenShift-OKD3.10基礎(chǔ)環(huán)境的部署”的有關(guān)知識(shí),在實(shí)際案例的操作過(guò)程中,不少人都會(huì)遇到這樣的困境,接下來(lái)就讓小編帶領(lǐng)大家學(xué)習(xí)一下如何處理這些情況吧!希望大家仔細(xì)閱讀,能夠?qū)W有所成!
成都創(chuàng)新互聯(lián)是專業(yè)的甘州網(wǎng)站建設(shè)公司,甘州接單;提供成都網(wǎng)站制作、成都做網(wǎng)站,網(wǎng)頁(yè)設(shè)計(jì),網(wǎng)站設(shè)計(jì),建網(wǎng)站,PHP網(wǎng)站建設(shè)等專業(yè)做網(wǎng)站服務(wù);采用PHP框架,可快速的進(jìn)行甘州網(wǎng)站開發(fā)網(wǎng)頁(yè)制作和功能擴(kuò)展;專業(yè)做搜索引擎喜愛(ài)的網(wǎng)站,專業(yè)的做網(wǎng)站團(tuán)隊(duì),希望更多企業(yè)前來(lái)合作!
單master + 雙node
1.主機(jī)角色劃分
#采用雙網(wǎng)段部署 0 網(wǎng)段是opesnshift內(nèi)部通信IP,1 網(wǎng)段是連接外網(wǎng)通信地址
#master master.example.com192.168.0.39 192.168.1.39#node1 node1.example.com192.168.0.40192.168.1.40#node2 node2.example.com192.168.0.41192.168.1.41
2.系統(tǒng)初始化
2.1 開啟SELinux
[root@master ~]# cat /etc/sysconfig/selinux # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=enforcing# SELINUXTYPE= can take one of three two values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted
2.2 安裝基礎(chǔ)組件
yum install wget git net-tools bind-utils yum-utils iptables-services bridge-utils bash-completion kexec-tools sos psacct -y
2.3 更新操作系統(tǒng)
yum update -y reboot
2.4 配置ansible
## install ansibleyum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpmsed -i -e "s/^enabled=1/enabled=0/" /etc/yum.repos.d/epel.repoyum -y --enablerepo=epel install ansible pyOpenSSL
#checkout install playbooks
cd ~
git clone https://github.com/openshift/openshift-ansible
cd openshift-ansible
git checkout release-3.10
2.5 設(shè)置SSH免密登錄(master -> node)
## ssh ssh-keygenfor host in master.example.com \ master.example.com \ node1.example.com \ node2.example.com; \do ssh-copy-id -i ~/.ssh/id_rsa.pub $host; \done
3.開始部署
3.1 更新hosts配置文件
[root@master ~]# cat /etc/ansible/hosts
[OSEv3:children]
masters
nodes
etcd
nfs
[OSEv3:vars]
ansible_ssh_user=root
openshift_deployment_type=origin
#因采用虛擬機(jī)部署學(xué)習(xí) 配置此選項(xiàng)跳過(guò)主機(jī)硬件信息檢查
openshift_disable_check=disk_availability,docker_storage,memory_availability,docker_image_availability
openshift_master_identity_providers=[{'name':'htpasswd_auth','login':'true','challenge':'true','kind':'HTPasswdPasswordIdentityProvider',}]
openshift_master_default_subdomain=apps.test.example.com
openshift_deployment_type=origin
os_firewall_use_firewalld=true[masters]
master.example.com
[etcd]
master.example.com
[nodes]
master.example.com openshift_node_group_name='node-config-master'node1.example.com openshift_node_group_name='node-config-compute'node2.example.com openshift_node_group_name='node-config-compute'[nfs]
master.example.com
3.2 執(zhí)行預(yù)安裝檢測(cè)
[root@master ~]# ansible-playbook openshift-ansible/playbooks/prerequisites.yml
3.3 正式安裝
[root@master ~]# ansible-playbook openshift-ansible/playbooks/deploy_cluster.yml
4.FAQ
Q1 Docker HUB下載鏡像緩慢導(dǎo)致執(zhí)行deploy腳本失敗##更改docker 的配置文件 /etc/sysconfig/docker
設(shè)置國(guó)內(nèi)docker 鏡像倉(cāng)庫(kù)例如阿里云加速
OPTIONS=' --selinux-enabled=false --signature-verification=False --registry-mirror=https://c9ojlmr5.mirror.aliyuncs.com'
#需要重啟docker
systemctl restart docker
#手動(dòng)pull master和node使用的images
#master鏡像列表
docker.io/cockpit/kubernetes
docker.io/openshift/origin-haproxy-router
docker.io/openshift/origin-haproxy-router
docker.io/openshift/origin-service-catalog
docker.io/openshift/origin-node
docker.io/openshift/origin-deployer
docker.io/openshift/origin-control-plane
docker.io/openshift/origin-control-plane
docker.io/openshift/origin-template-service-broker
docker.io/openshift/origin-pod
docker.io/cockpit/kubernetes
docker.io/openshift/origin-web-console
quay.io/coreos/etcd
#node鏡像列表
docker.io/openshift/origin-haproxy-router
docker.io/openshift/origin-node
docker.io/openshift/origin-deployer
docker.io/openshift/origin-pod
docker.io/ansibleplaybookbundle/origin-ansible-service-broker
docker.io/openshift/origin-docker-registry
docker-registry.default.svc:5000/openshift/jenkins
Q2 執(zhí)行deploy時(shí)主機(jī)DNS導(dǎo)致連外網(wǎng)失敗
臨時(shí)解決方案更改/etc/resolv.confecho nameserver 114.114.114.114 >>/etc/resolv.conf
“OpenShift-OKD3.10基礎(chǔ)環(huán)境的部署”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識(shí)可以關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實(shí)用文章!