Last active
June 4, 2019 09:11
-
-
Save liusheng/d0db6514f9924fc22d803a82e37ba73c to your computer and use it in GitHub Desktop.
How to deployment openshift origin on fusioncloud
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
# step1:在跳板机(执行ansible工具的机器上)clone openshift的ansible部署工具,并应用fusioncloud 规避patch: | |
git clone http://github.com/huaweicloud/openshift-ansible | |
cd openshift-ansible | |
git config --global user.email '[email protected]' | |
git config --global user.name 'openlab' | |
git fetch origin refs/pull/12/head:pr12 | |
git cherry-pick pr12 | |
# step2 执行以下准备步骤: | |
cat << EOF > keystonerc | |
export OS_AUTH_URL="https://iam-apigateway-proxy.fusioncloud.huawei.com/v3" | |
export OS_USER_DOMAIN_NAME=InternalTestVDC01 | |
export OS_PROJECT_DOMAIN_NAME=InternalTestVDC01 | |
export OS_IDENTITY_API_VERSION="3" | |
export OS_PASSWORD="*******" | |
export OS_DOMAIN_NAME="InternalTestVDC01" | |
export OS_PROJECT_NAME="InternalTestVDC01" | |
export OS_REGION_NAME="shenzhen-1" | |
export OS_TENANT_NAME="InternalTestVDC01" | |
export OS_USERNAME="apitest01" | |
export OS_AVAILABILITY_ZONE='az2.primary' | |
alias openstack="openstack --insecure" | |
EOF | |
pip install ansible | |
pip install jinja2 | |
pip install shade | |
pip install jmespath | |
pip install dnspython | |
pip install python-openstackclient | |
pip install python-heatclient | |
. ./keystonerc | |
openstack keypair delete openshift || true | |
openstack keypair create openshift > openshift.pem | |
chmod 400 ./openshift.pem | |
# step3 准备fusioncloud云相关的特定配置配置 | |
cat << EOF > extra_vars.yml | |
--- | |
openshift_openstack_external_network_name: "forapig_external_network" | |
openshift_openstack_default_image_name: "CentOS-7-liusheng" | |
openshift_openstack_default_flavor: "s2.xlarge.2" | |
openshift_openstack_user: centos | |
openshift_openstack_bootable_volume_size: 80 | |
EOF | |
# step4 执行下列ansible命令完成openshift的集群provision和部署: | |
# Check prerequisites | |
ansible-playbook --user root \ | |
-i playbooks/openstack/inventory.py \ | |
-i "playbooks/openstack/huawei-inventory" \ | |
--private-key "./openshift.pem" \ | |
playbooks/openstack/openshift-cluster/prerequisites.yml \ | |
-e @extra_vars.yml | |
# Provision | |
ansible-playbook --user root \ | |
-i playbooks/openstack/inventory.py \ | |
-i "playbooks/openstack/huawei-inventory" \ | |
--private-key "./openshift.pem" \ | |
playbooks/openstack/openshift-cluster/provision.yml \ | |
-e @extra_vars.yml | |
# Install openshift cluster | |
ansible-playbook --user root \ | |
-i playbooks/openstack/inventory.py \ | |
-i "playbooks/openstack/huawei-inventory" \ | |
--private-key "./openshift.pem" \ | |
playbooks/openstack/openshift-cluster/install.yml \ | |
-e @extra_vars.yml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment