[Global] auth-url = <OS_AUTH_URL> username = <OS_USeRNAMe> password = <password> domain-id = <OS_USeR_DOMAIN_ID> tenant-id = <OS_TeNANT_ID> region = <OS_ReGION_NAMe> [LoadBalancer] subnet-id = <UUID of the load balancer subnet>
When deployed on OpenStack, OpenShift Container Platform can be configured to access OpenStack infrastructure, including using OpenStack Cinder volumes as persistent storage for application data.
To set the required OpenStack variables, create a /etc/cloud.conf file with the following contents on all of your OpenShift Container Platform hosts, both masters and nodes:
[Global] auth-url = <OS_AUTH_URL> username = <OS_USeRNAMe> password = <password> domain-id = <OS_USeR_DOMAIN_ID> tenant-id = <OS_TeNANT_ID> region = <OS_ReGION_NAMe> [LoadBalancer] subnet-id = <UUID of the load balancer subnet>
Consult your OpenStack administrators for values of the OS_
variables, which
are commonly used in OpenStack configuration.
You can set an OpenStack configuration on your OpenShift Container Platform master and node hosts in two different ways:
Manually, by modifying the master-config.yaml and node-config.yaml files.
During advanced installations, OpenStack can be configured using the following parameters, which are configurable in the inventory file:
openshift_cloudprovider_kind
openshift_cloudprovider_openstack_auth_url
openshift_cloudprovider_openstack_username
openshift_cloudprovider_openstack_password
openshift_cloudprovider_openstack_domain_id
openshift_cloudprovider_openstack_domain_name
openshift_cloudprovider_openstack_tenant_id
openshift_cloudprovider_openstack_tenant_name
openshift_cloudprovider_openstack_region
openshift_cloudprovider_openstack_lb_subnet_id
# Cloud Provider Configuration # # Note: You may make use of environment variables rather than store # sensitive configuration within the ansible inventory. # For example: #openshift_cloudprovider_openstack_username="{{ lookup('env','USeRNAMe') }}" #openshift_cloudprovider_openstack_password="{{ lookup('env','PASSWORD') }}" # # Openstack #openshift_cloudprovider_kind=openstack #openshift_cloudprovider_openstack_auth_url=http://openstack.example.com:35357/v2.0/ #openshift_cloudprovider_openstack_username=username #openshift_cloudprovider_openstack_password=password #openshift_cloudprovider_openstack_domain_id=domain_id #openshift_cloudprovider_openstack_domain_name=domain_name #openshift_cloudprovider_openstack_tenant_id=tenant_id #openshift_cloudprovider_openstack_tenant_name=tenant_name #openshift_cloudprovider_openstack_region=region #openshift_cloudprovider_openstack_lb_subnet_id=subnet_id
edit or
create the
master configuration file on all masters
(/etc/origin/master/master-config.yaml by default) and update the
contents of the apiServerArguments
and controllerArguments
sections:
kubernetesMasterConfig:
...
apiServerArguments:
cloud-provider:
- "openstack"
cloud-config:
- "/etc/cloud.conf"
controllerArguments:
cloud-provider:
- "openstack"
cloud-config:
- "/etc/cloud.conf"
When triggering a containerized installation, only the directories of /etc/origin and /var/lib/origin are mounted to the master and node container. Therefore, cloud.conf should be in /etc/origin/ instead of /etc/. |
edit or
create
the node configuration file on all nodes (/etc/origin/node/node-config.yaml
by default) and update the contents of the kubeletArguments
and nodeName
sections:
nodeName:
<instance_name> (1)
kubeletArguments:
cloud-provider:
- "openstack"
cloud-config:
- "/etc/cloud.conf"
1 | Name of the OpenStack instance where the node runs (i.e., name of the virtual machine) |
When triggering a containerized installation, only the directories of /etc/origin and /var/lib/origin are mounted to the master and node container. Therefore, cloud.conf should be in /etc/origin/ instead of /etc/. |