Febrac8 + OpenShift + Kubernetes (3) Install OpenShift

Prepare OpenShift Ansible packages

Modify the Master configuration files.

  1. /root/openshift-ansible/roles/openshift_version/tasks/masters_and_nodes.yml:
    line 12~13:
  # block when
  when: 
  - not openshift_is_atomic | bool
  - not openshift_is_containerized | bool
  1. Prepare the host file for ansible
    Path: /etc/ansible/hosts
[OSEv3:children]
masters
nodes
etcd
lb
# Specify there will be GlusterFS nodes
glusterfs
glusterfs_registry

[OSEv3:vars]
ansible_user=root
ansible_ssh_user=root
openshift_deployment_type=origin
#openshift_docker_use_system_container=True
openshift_disable_check=docker_image_availability
containerized=true
openshift_release=3.9
openshift_image_tag=v3.9.0
openshift_pkg_version=-3.9.0
enable_excluders=false

# htpasswd auth
openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', 'challenge': 'true', 'kind': 'HTPasswdPasswordIdentityProvider', 'filename': '/etc/origin/master/htpasswd'},{'name': 'my_ldap_provider', 'challenge': 'true', 'login': 'true', 'kind': 'LDAPPasswordIdentityProvider', 'attributes': {'id': ['dn'], 'email': ['mail'], 'name': ['cn'], 'preferredUsername': ['uid']}, 'bindDN': '', 'bindPassword': '', 'insecure': 'false', 'url': 'ldap://192.168.0.137:389/ou=Tech,dc=gemii,dc=cc?uid'}]
# Defining htpasswd users
openshift_master_htpasswd_users={'admin': '$apr1$0oyVx7VK$OFmO1wA2oUdY.7026TY380'}
# LDAP auth

openshift_storage_glusterfs_namespace=glusterfs 
openshift_storage_glusterfs_name=storage

openshift_hosted_registry_cert_expire_days=3650
openshift_ca_cert_expire_days=3650
openshift_node_cert_expire_days=3650
openshift_master_cert_expire_days=3650
etcd_ca_default_days=3650
os_firewall_use_firewalld=True

openshift_master_cluster_method=native
openshift_master_cluster_hostname=lb1.os.gemii.tech
openshift_master_cluster_public_hostname=oc.os.gemii.tech

#openshift_master_default_subdomain=os.gemii.tech

openshift_clock_enabled=true
# apply updated node defaults
openshift_node_kubelet_args={'pods-per-core': ['10'], 'max-pods': ['250'], 'image-gc-high-threshold': ['90'], 'image-gc-low-threshold': ['80']}

#openshift_logging_install_logging=true
# Configure loggingPublicURL in the master config for aggregate logging, defaults
# to kibana.{{ openshift_master_default_subdomain }}
#openshift_logging_kibana_hostname=logging.dev.gemii.cc
# Configure the number of elastic search nodes, unless you're using dynamic provisioning
# this value must be 1
#openshift_logging_es_cluster_size=3
# Configure the prefix and version for the component images
#openshift_logging_image_prefix=docker.io/openshift/origin-
#openshift_logging_image_version=v3.7.0
#openshift_http_proxy=http://192.168.0.127:8118/
#openshift_https_proxy=http://192.168.0.127:8118/
#openshift_no_proxy='localhost,127.0.0.1,180.169.188.90,hub.docker.gemii.cc,192.168.0.169'


openshift_hosted_registry_storage_kind=glusterfs
openshift_hosted_registry_replicas=3
openshift_hosted_registry_storage_volume_size=500Gi
openshift_generate_no_proxy_hosts=false

[masters]
oskm1.os.gemii.tech
oskm2.os.gemii.tech
oskm3.os.gemii.tech

[nodes]
# masters should be schedulable to run web console pods
oskm1.os.gemii.tech     openshift_schedulable=True 
oskm2.os.gemii.tech     openshift_schedulable=True 
oskm3.os.gemii.tech     openshift_schedulable=True 
oskw1.os.gemii.tech     openshift_node_labels="{'region': 'infra'}" openshift_schedulable=True
oskw2.os.gemii.tech     openshift_node_labels="{'region': 'infra'}" openshift_schedulable=True
oskw3.os.gemii.tech     openshift_node_labels="{'region': 'infra'}" openshift_schedulable=True
oskw4.os.gemii.tech     openshift_node_labels="{'region': 'primary'}" openshift_schedulable=True
oskw5.os.gemii.tech     openshift_node_labels="{'region': 'primary'}" openshift_schedulable=True
oskw6.os.gemii.tech     openshift_node_labels="{'region': 'primary'}" openshift_schedulable=True
oskw7.os.gemii.tech     openshift_node_labels="{'region': 'primary'}" openshift_schedulable=True
oskw8.os.gemii.tech     openshift_node_labels="{'region': 'primary'}" openshift_schedulable=True
oskw9.os.gemii.tech     openshift_node_labels="{'region': 'primary'}" openshift_schedulable=True

[etcd]
oskm1.os.gemii.tech
oskm2.os.gemii.tech
oskm3.os.gemii.tech

[lb]
lb1.os.gemii.tech

# Specify the glusterfs group, which contains the nodes of the external
# GlusterFS cluster. At a minimum, each node must have "glusterfs_hostname"
# and "glusterfs_devices" variables defined.
#
# The first variable indicates the hostname of the external GLusterFS node,
# and must be reachable by the external heketi service.
#
# The second variable is a list of block devices the node will have access to
# that are intended solely for use as GlusterFS storage. These block devices
# must be bare (e.g. have no data, not be marked as LVM PVs), and will be
# formatted.
[glusterfs]
oskw1.os.gemii.tech  glusterfs_devices='[ "/dev/sdc" ]'
oskw2.os.gemii.tech  glusterfs_devices='[ "/dev/sdc" ]'
oskw3.os.gemii.tech  glusterfs_devices='[ "/dev/sdc" ]'

[glusterfs_registry]
oskm1.os.gemii.tech  glusterfs_devices='[ "/dev/sdc" ]'
oskm2.os.gemii.tech  glusterfs_devices='[ "/dev/sdc" ]'
oskm3.os.gemii.tech  glusterfs_devices='[ "/dev/sdc" ]'

3 Install OpenShift

# cd ~
# ansible-playbook ./openshift-ansible/playbooks/prerequisites.yml 
# ansible-playbook ./openshift-ansible/playbooks/deploy_cluster.yml 
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 218,607评论 6 507
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 93,239评论 3 395
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 164,960评论 0 355
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,750评论 1 294
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 67,764评论 6 392
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,604评论 1 305
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,347评论 3 418
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 39,253评论 0 276
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,702评论 1 315
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,893评论 3 336
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 40,015评论 1 348
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,734评论 5 346
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 41,352评论 3 330
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,934评论 0 22
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 33,052评论 1 270
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 48,216评论 3 371
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,969评论 2 355

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,332评论 0 10
  • 1)安装2)常用模块3)inventory4)playbook(role\tag\template)5) yaml...
    秦记阅读 4,172评论 2 5
  • 每日一我 周六了,银耳日。银耳据说是素燕窝呢。 炖了盅银耳红枣羹,这次总算炖透了,口感舒爽, 一下子喝完了。 买了...
    sophietyl阅读 201评论 0 0
  • http://os.51cto.com/art/201706/543533.htm
    平谦阅读 282评论 0 0
  • 计算机二级等级考试前半个小时,我买了去杭州的车票。 不为什么,就是想去。于是推掉了原计划和同学去秦皇岛的计划,花光...
    辛辛辛烷阅读 322评论 1 1