Skip to content

Instantly share code, notes, and snippets.

@remoteur
Last active December 20, 2018 04:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save remoteur/6f80a52d2bf21d9b26a903ad9c0d1fd1 to your computer and use it in GitHub Desktop.
Save remoteur/6f80a52d2bf21d9b26a903ad9c0d1fd1 to your computer and use it in GitHub Desktop.
ocp tripleo
(undercloud) [stack@undercloud ~]$ openstack baremetal node list
+--------------------------------------+--------------------+---------------+-------------+--------------------+-------------+
| UUID | Name | Instance UUID | Power State | Provisioning State | Maintenance |
+--------------------------------------+--------------------+---------------+-------------+--------------------+-------------+
| e5146164-5479-4aa2-b598-23cf4d203e5f | openshift-master-0 | None | power on | manageable | False |
| b8630617-70af-4c25-9601-283cbc7e24d1 | openshift-master-1 | None | power on | manageable | False |
| 21de991b-8a63-4f36-8911-02d6e1b2ed4d | openshift-master-2 | None | power on | manageable | False |
| f697d202-d710-47fa-bd5e-eea357433ade | openshift-infra-0 | None | power on | manageable | False |
| 35caf228-db29-4032-8c11-feadabc950fc | openshift-infra-1 | None | power on | manageable | False |
| 1fd4301a-6fa2-43ac-a253-9f6456f60a2e | openshift-infra-2 | None | power on | manageable | False |
| 09028695-d7f8-4118-b27b-b95399fc31cb | openshift-worker-0 | None | power on | manageable | False |
| 315ce1bc-f2ba-458c-b49c-74e2fce63330 | openshift-worker-1 | None | power on | manageable | False |
| f44fef3e-eb36-4565-836b-d6b7c915939a | openshift-worker-2 | None | power on | manageable | False |
+--------------------------------------+--------------------+---------------+-------------+--------------------+-------------+
(undercloud) [stack@undercloud ~]$ openstack baremetal node list
+--------------------------------------+--------------------+---------------+-------------+--------------------+-------------+
| UUID | Name | Instance UUID | Power State | Provisioning State | Maintenance |
+--------------------------------------+--------------------+---------------+-------------+--------------------+-------------+
| e5146164-5479-4aa2-b598-23cf4d203e5f | openshift-master-0 | None | power off | available | False |
| b8630617-70af-4c25-9601-283cbc7e24d1 | openshift-master-1 | None | power off | available | False |
| 21de991b-8a63-4f36-8911-02d6e1b2ed4d | openshift-master-2 | None | power off | available | False |
| f697d202-d710-47fa-bd5e-eea357433ade | openshift-infra-0 | None | power off | available | False |
| 35caf228-db29-4032-8c11-feadabc950fc | openshift-infra-1 | None | power off | available | False |
| 1fd4301a-6fa2-43ac-a253-9f6456f60a2e | openshift-infra-2 | None | power off | available | False |
| 09028695-d7f8-4118-b27b-b95399fc31cb | openshift-worker-0 | None | power off | available | False |
| 315ce1bc-f2ba-458c-b49c-74e2fce63330 | openshift-worker-1 | None | power off | available | False |
| f44fef3e-eb36-4565-836b-d6b7c915939a | openshift-worker-2 | None | power off | available | False |
+--------------------------------------+--------------------+---------------+-------------+--------------------+-------------+
heat_template_version: 2014-10-16
resources:
userdata:
type: OS::Heat::MultipartMime
properties:
parts:
- config: {get_resource: repo_config}
repo_config:
type: OS::Heat::SoftwareConfig
properties:
config: |
#!/bin/bash
yum remove -y librados2
cat >> /etc/yum.repos.d/okd.repo << EOF
[ocp-3.11]
name=OpenShift 3.11
baseurl=https://cbs.centos.org/repos/paas7-openshift-origin311-candidate/\$basearch//os/
enabled=1
gpgcheck=0
[containers-common]
name=Containers Common
baseurl=https://cbs.centos.org/repos/virt7-container-common-candidate/\$basearch//os/
enabled=1
gpgcheck=0
EOF
outputs:
OS::stack_id:
value: {get_resource: userdata}
heat_template_version: ocata
description: >
Software Config to drive os-net-config to configure multiple interfaces
for the controller role.
parameters:
ControlPlaneIp:
default: ''
description: IP address/subnet on the ctlplane network
type: string
ExternalIpSubnet:
default: ''
description: IP address/subnet on the external network
type: string
InternalApiIpSubnet:
default: ''
description: IP address/subnet on the internal API network
type: string
StorageIpSubnet:
default: ''
description: IP address/subnet on the storage network
type: string
StorageMgmtIpSubnet:
default: ''
description: IP address/subnet on the storage mgmt network
type: string
TenantIpSubnet:
default: ''
description: IP address/subnet on the tenant network
type: string
ManagementIpSubnet: # Only populated when including environments/network-management.yaml
default: ''
description: IP address/subnet on the management network
type: string
ExternalNetworkVlanID:
default: 10
description: Vlan ID for the external network traffic.
type: number
InternalApiNetworkVlanID:
default: 20
description: Vlan ID for the internal_api network traffic.
type: number
StorageNetworkVlanID:
default: 30
description: Vlan ID for the storage network traffic.
type: number
StorageMgmtNetworkVlanID:
default: 40
description: Vlan ID for the storage mgmt network traffic.
type: number
TenantNetworkVlanID:
default: 50
description: Vlan ID for the tenant network traffic.
type: number
ExternalInterfaceDefaultRoute:
default: '10.0.0.1'
description: default route for the external network
type: string
ControlPlaneSubnetCidr: # Override this via parameter_defaults
default: '24'
description: The subnet CIDR of the control plane network.
type: string
ControlPlaneDefaultRoute: # Override this via parameter_defaults
description: The subnet CIDR of the control plane network.
type: string
DnsServers: # Override this via parameter_defaults
default: []
description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf.
type: json
EC2MetadataIp: # Override this via parameter_defaults
description: The IP address of the EC2 metadata server.
type: string
StorageInterfaceRoutes:
default: []
description: >
Routes for the storage network traffic.
JSON route e.g. [{'destination':'10.0.0.0/16', 'nexthop':'10.0.0.1'}]
Unless the default is changed, the parameter is automatically resolved
from the subnet host_routes attribute.
type: json
StorageMgmtInterfaceRoutes:
default: []
description: >
Routes for the storage_mgmt network traffic.
JSON route e.g. [{'destination':'10.0.0.0/16', 'nexthop':'10.0.0.1'}]
Unless the default is changed, the parameter is automatically resolved
from the subnet host_routes attribute.
type: json
InternalApiInterfaceRoutes:
default: []
description: >
Routes for the internal_api network traffic.
JSON route e.g. [{'destination':'10.0.0.0/16', 'nexthop':'10.0.0.1'}]
Unless the default is changed, the parameter is automatically resolved
from the subnet host_routes attribute.
type: json
TenantInterfaceRoutes:
default: []
description: >
Routes for the tenant network traffic.
JSON route e.g. [{'destination':'10.0.0.0/16', 'nexthop':'10.0.0.1'}]
Unless the default is changed, the parameter is automatically resolved
from the subnet host_routes attribute.
type: json
ExternalInterfaceRoutes:
default: []
description: >
Routes for the external network traffic.
JSON route e.g. [{'destination':'10.0.0.0/16', 'nexthop':'10.0.0.1'}]
Unless the default is changed, the parameter is automatically resolved
from the subnet host_routes attribute.
type: json
ManagementInterfaceRoutes:
default: []
description: >
Routes for the management network traffic.
JSON route e.g. [{'destination':'10.0.0.0/16', 'nexthop':'10.0.0.1'}]
Unless the default is changed, the parameter is automatically resolved
from the subnet host_routes attribute.
type: json
resources:
OsNetConfigImpl:
type: OS::Heat::SoftwareConfig
properties:
group: script
config:
str_replace:
template:
get_file: /usr/share/openstack-tripleo-heat-templates/network/scripts/run-os-net-config.sh
params:
$network_config:
network_config:
-
type: interface
name: nic1
use_dhcp: false
dns_servers:
get_param: DnsServers
addresses:
-
ip_netmask:
list_join:
- '/'
- - get_param: ControlPlaneIp
- get_param: ControlPlaneSubnetCidr
routes:
-
ip_netmask: 0.0.0.0/0
next_hop:
get_param: ControlPlaneDefaultRoute
default: true
-
ip_netmask: 169.254.169.254/32
next_hop:
get_param: EC2MetadataIp
-
type: linux_bridge
name: br-management
use_dhcp: false
members:
-
type: interface
name: nic2
-
type: vlan
device: br-management
vlan_id:
get_param: InternalApiNetworkVlanID
addresses:
-
ip_netmask:
get_param: InternalApiIpSubnet
-
type: vlan
device: br-management
vlan_id:
get_param: StorageNetworkVlanID
addresses:
-
ip_netmask:
get_param: StorageIpSubnet
outputs:
OS::stack_id:
description: The OsNetConfigImpl resource.
value:
get_resource: OsNetConfigImpl
heat_template_version: ocata
description: >
Software Config to drive os-net-config to configure multiple interfaces
for the controller role.
parameters:
ControlPlaneIp:
default: ''
description: IP address/subnet on the ctlplane network
type: string
ExternalIpSubnet:
default: ''
description: IP address/subnet on the external network
type: string
InternalApiIpSubnet:
default: ''
description: IP address/subnet on the internal API network
type: string
StorageIpSubnet:
default: ''
description: IP address/subnet on the storage network
type: string
StorageMgmtIpSubnet:
default: ''
description: IP address/subnet on the storage mgmt network
type: string
TenantIpSubnet:
default: ''
description: IP address/subnet on the tenant network
type: string
ManagementIpSubnet: # Only populated when including environments/network-management.yaml
default: ''
description: IP address/subnet on the management network
type: string
ExternalNetworkVlanID:
default: 10
description: Vlan ID for the external network traffic.
type: number
InternalApiNetworkVlanID:
default: 20
description: Vlan ID for the internal_api network traffic.
type: number
StorageNetworkVlanID:
default: 30
description: Vlan ID for the storage network traffic.
type: number
StorageMgmtNetworkVlanID:
default: 40
description: Vlan ID for the storage mgmt network traffic.
type: number
TenantNetworkVlanID:
default: 50
description: Vlan ID for the tenant network traffic.
type: number
ExternalInterfaceDefaultRoute:
default: '10.0.0.1'
description: default route for the external network
type: string
ControlPlaneSubnetCidr: # Override this via parameter_defaults
default: '24'
description: The subnet CIDR of the control plane network.
type: string
ControlPlaneDefaultRoute: # Override this via parameter_defaults
description: The subnet CIDR of the control plane network.
type: string
DnsServers: # Override this via parameter_defaults
default: []
description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf.
type: json
EC2MetadataIp: # Override this via parameter_defaults
description: The IP address of the EC2 metadata server.
type: string
StorageInterfaceRoutes:
default: []
description: >
Routes for the storage network traffic.
JSON route e.g. [{'destination':'10.0.0.0/16', 'nexthop':'10.0.0.1'}]
Unless the default is changed, the parameter is automatically resolved
from the subnet host_routes attribute.
type: json
StorageMgmtInterfaceRoutes:
default: []
description: >
Routes for the storage_mgmt network traffic.
JSON route e.g. [{'destination':'10.0.0.0/16', 'nexthop':'10.0.0.1'}]
Unless the default is changed, the parameter is automatically resolved
from the subnet host_routes attribute.
type: json
InternalApiInterfaceRoutes:
default: []
description: >
Routes for the internal_api network traffic.
JSON route e.g. [{'destination':'10.0.0.0/16', 'nexthop':'10.0.0.1'}]
Unless the default is changed, the parameter is automatically resolved
from the subnet host_routes attribute.
type: json
TenantInterfaceRoutes:
default: []
description: >
Routes for the tenant network traffic.
JSON route e.g. [{'destination':'10.0.0.0/16', 'nexthop':'10.0.0.1'}]
Unless the default is changed, the parameter is automatically resolved
from the subnet host_routes attribute.
type: json
ExternalInterfaceRoutes:
default: []
description: >
Routes for the external network traffic.
JSON route e.g. [{'destination':'10.0.0.0/16', 'nexthop':'10.0.0.1'}]
Unless the default is changed, the parameter is automatically resolved
from the subnet host_routes attribute.
type: json
ManagementInterfaceRoutes:
default: []
description: >
Routes for the management network traffic.
JSON route e.g. [{'destination':'10.0.0.0/16', 'nexthop':'10.0.0.1'}]
Unless the default is changed, the parameter is automatically resolved
from the subnet host_routes attribute.
type: json
resources:
OsNetConfigImpl:
type: OS::Heat::SoftwareConfig
properties:
group: script
config:
str_replace:
template:
get_file: /usr/share/openstack-tripleo-heat-templates/network/scripts/run-os-net-config.sh
params:
$network_config:
network_config:
-
type: interface
name: nic1
use_dhcp: false
dns_servers:
get_param: DnsServers
addresses:
-
ip_netmask:
list_join:
- '/'
- - get_param: ControlPlaneIp
- get_param: ControlPlaneSubnetCidr
routes:
-
ip_netmask: 169.254.169.254/32
next_hop:
get_param: EC2MetadataIp
-
type: linux_bridge
name: br-management
use_dhcp: false
addresses:
-
ip_netmask:
get_param: ExternalIpSubnet
routes:
-
ip_netmask: 0.0.0.0/0
next_hop:
get_param: ExternalInterfaceDefaultRoute
members:
-
type: interface
name: nic2
-
type: vlan
device: br-management
vlan_id:
get_param: InternalApiNetworkVlanID
addresses:
-
ip_netmask:
get_param: InternalApiIpSubnet
-
type: vlan
device: br-management
vlan_id:
get_param: StorageNetworkVlanID
addresses:
-
ip_netmask:
get_param: StorageIpSubnet
outputs:
OS::stack_id:
description: The OsNetConfigImpl resource.
value:
get_resource: OsNetConfigImpl
- name: Storage
vip: true
vlan: 30
name_lower: storage
ip_subnet: '172.17.3.0/24'
allocation_pools: [{'start': '172.17.3.10', 'end': '172.17.3.149'}]
- name: InternalApi
name_lower: internal_api
vip: true
vlan: 20
ip_subnet: '172.17.1.0/24'
allocation_pools: [{'start': '172.17.1.10', 'end': '172.17.1.149'}]
- name: External
vip: true
name_lower: external
ip_subnet: '10.0.0.0/24'
allocation_pools: [{'start': '10.0.0.101', 'end': '10.0.0.149'}]
gateway_ip: '10.0.0.1'
{
"nodes": [
{
"pm_type": "ipmi",
"mac": [
"52:54:00:03:b2:27"
],
"pm_user": "admin",
"pm_password": "password",
"pm_addr": "172.16.0.1",
"pm_port": "6231",
"name": "openshift-master-0"
},
{
"pm_type": "ipmi",
"mac": [
"52:54:00:00:36:89"
],
"pm_user": "admin",
"pm_password": "password",
"pm_addr": "172.16.0.1",
"pm_port": "6232",
"name": "openshift-master-1"
},
{
"pm_type": "ipmi",
"mac": [
"52:54:00:1a:a7:11"
],
"pm_user": "admin",
"pm_password": "password",
"pm_addr": "172.16.0.1",
"pm_port": "6230",
"name": "openshift-master-2"
},
{
"pm_type": "ipmi",
"mac": [
"52:54:00:5f:1e:6e"
],
"pm_user": "admin",
"pm_password": "password",
"pm_addr": "172.16.0.1",
"pm_port": "6235",
"name": "openshift-infra-0"
},
{
"pm_type": "ipmi",
"mac": [
"52:54:00:c2:7d:73"
],
"pm_user": "admin",
"pm_password": "password",
"pm_addr": "172.16.0.1",
"pm_port": "6234",
"name": "openshift-infra-1"
},
{
"pm_type": "ipmi",
"mac": [
"52:54:00:40:47:e0"
],
"pm_user": "admin",
"pm_password": "password",
"pm_addr": "172.16.0.1",
"pm_port": "6233",
"name": "openshift-infra-2"
},
{
"pm_type": "ipmi",
"mac": [
"52:54:00:a1:df:3f"
],
"pm_user": "admin",
"pm_password": "password",
"pm_addr": "172.16.0.1",
"pm_port": "6237",
"name": "openshift-worker-0"
},
{
"pm_type": "ipmi",
"mac": [
"52:54:00:f6:5c:0b"
],
"pm_user": "admin",
"pm_password": "password",
"pm_addr": "172.16.0.1",
"pm_port": "6238",
"name": "openshift-worker-1"
},
{
"pm_type": "ipmi",
"mac": [
"52:54:00:3f:d9:94"
],
"pm_user": "admin",
"pm_password": "password",
"pm_addr": "172.16.0.1",
"pm_port": "6236",
"name": "openshift-worker-2"
}
]
}
resource_registry:
OS::TripleO::NodeUserData: /home/stack/firstboot.yaml
OS::TripleO::OpenShiftMaster::Net::SoftwareConfig: /home/stack/master-nic.yaml
OS::TripleO::OpenShiftWorker::Net::SoftwareConfig: /home/stack/worker-nic.yaml
OS::TripleO::OpenShiftInfra::Net::SoftwareConfig: /home/stack/infra-nic.yaml
parameter_defaults:
CloudName: public.openshift.localdomain
PublicVirtualFixedIPs: [{'ip_address':'10.0.0.200'}]
CloudNameInternal: internal.openshift.localdomain
InternalApiVirtualFixedIPs: [{'ip_address':'172.17.1.200'}]
CloudDomain: openshift.localdomain
OpenShiftMasterCount: 3
OvercloudOpenShiftMasterFlavor: master
OpenShiftWorkerCount: 3
OvercloudOpenShiftWorkerFlavor: worker
OpenShiftInfraCount: 3
OvercloudOpenShiftInfraFlavor: infra
OpenShiftInfraParameters:
OpenShiftGlusterDisks:
- /dev/vdb
OpenShiftWorkerParameters:
OpenShiftGlusterDisks:
- /dev/vdb
- /dev/vdc
NtpServer: ["10.11.160.238","10.16.255.1"]
ControlPlaneDefaultRoute: 192.168.24.1
EC2MetadataIp: 192.168.24.1
ControlPlaneSubnetCidr: 24
DnsServers:
- 10.46.0.31
OpenShiftGlobalVariables:
openshift_master_identity_providers:
- name: allow_all
login: 'true'
challenge: true
kind: AllowAllPasswordIdentityProvider
openshift_master_default_subdomain: apps.openshift.localdomain
openshift_master_cluster_hostname: internal.openshift.localdomain
openshift_master_cluster_public_hostname: public.openshift.localdomain
heat_template_version: ocata
description: >
Software Config to drive os-net-config to configure multiple interfaces
for the controller role.
parameters:
ControlPlaneIp:
default: ''
description: IP address/subnet on the ctlplane network
type: string
ExternalIpSubnet:
default: ''
description: IP address/subnet on the external network
type: string
InternalApiIpSubnet:
default: ''
description: IP address/subnet on the internal API network
type: string
StorageIpSubnet:
default: ''
description: IP address/subnet on the storage network
type: string
StorageMgmtIpSubnet:
default: ''
description: IP address/subnet on the storage mgmt network
type: string
TenantIpSubnet:
default: ''
description: IP address/subnet on the tenant network
type: string
ManagementIpSubnet: # Only populated when including environments/network-management.yaml
default: ''
description: IP address/subnet on the management network
type: string
ExternalNetworkVlanID:
default: 10
description: Vlan ID for the external network traffic.
type: number
InternalApiNetworkVlanID:
default: 20
description: Vlan ID for the internal_api network traffic.
type: number
StorageNetworkVlanID:
default: 30
description: Vlan ID for the storage network traffic.
type: number
StorageMgmtNetworkVlanID:
default: 40
description: Vlan ID for the storage mgmt network traffic.
type: number
TenantNetworkVlanID:
default: 50
description: Vlan ID for the tenant network traffic.
type: number
ExternalInterfaceDefaultRoute:
default: '10.0.0.1'
description: default route for the external network
type: string
ControlPlaneSubnetCidr: # Override this via parameter_defaults
default: '24'
description: The subnet CIDR of the control plane network.
type: string
ControlPlaneDefaultRoute: # Override this via parameter_defaults
description: The subnet CIDR of the control plane network.
type: string
DnsServers: # Override this via parameter_defaults
default: []
description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf.
type: json
EC2MetadataIp: # Override this via parameter_defaults
description: The IP address of the EC2 metadata server.
type: string
StorageInterfaceRoutes:
default: []
description: >
Routes for the storage network traffic.
JSON route e.g. [{'destination':'10.0.0.0/16', 'nexthop':'10.0.0.1'}]
Unless the default is changed, the parameter is automatically resolved
from the subnet host_routes attribute.
type: json
StorageMgmtInterfaceRoutes:
default: []
description: >
Routes for the storage_mgmt network traffic.
JSON route e.g. [{'destination':'10.0.0.0/16', 'nexthop':'10.0.0.1'}]
Unless the default is changed, the parameter is automatically resolved
from the subnet host_routes attribute.
type: json
InternalApiInterfaceRoutes:
default: []
description: >
Routes for the internal_api network traffic.
JSON route e.g. [{'destination':'10.0.0.0/16', 'nexthop':'10.0.0.1'}]
Unless the default is changed, the parameter is automatically resolved
from the subnet host_routes attribute.
type: json
TenantInterfaceRoutes:
default: []
description: >
Routes for the tenant network traffic.
JSON route e.g. [{'destination':'10.0.0.0/16', 'nexthop':'10.0.0.1'}]
Unless the default is changed, the parameter is automatically resolved
from the subnet host_routes attribute.
type: json
ExternalInterfaceRoutes:
default: []
description: >
Routes for the external network traffic.
JSON route e.g. [{'destination':'10.0.0.0/16', 'nexthop':'10.0.0.1'}]
Unless the default is changed, the parameter is automatically resolved
from the subnet host_routes attribute.
type: json
ManagementInterfaceRoutes:
default: []
description: >
Routes for the management network traffic.
JSON route e.g. [{'destination':'10.0.0.0/16', 'nexthop':'10.0.0.1'}]
Unless the default is changed, the parameter is automatically resolved
from the subnet host_routes attribute.
type: json
resources:
OsNetConfigImpl:
type: OS::Heat::SoftwareConfig
properties:
group: script
config:
str_replace:
template:
get_file: /usr/share/openstack-tripleo-heat-templates/network/scripts/run-os-net-config.sh
params:
$network_config:
network_config:
-
type: interface
name: nic1
use_dhcp: false
dns_servers:
get_param: DnsServers
addresses:
-
ip_netmask:
list_join:
- '/'
- - get_param: ControlPlaneIp
- get_param: ControlPlaneSubnetCidr
routes:
-
ip_netmask: 0.0.0.0/0
next_hop:
get_param: ControlPlaneDefaultRoute
default: true
-
ip_netmask: 169.254.169.254/32
next_hop:
get_param: EC2MetadataIp
-
type: linux_bridge
name: br-management
use_dhcp: false
members:
-
type: interface
name: nic2
-
type: vlan
device: br-management
vlan_id:
get_param: InternalApiNetworkVlanID
addresses:
-
ip_netmask:
get_param: InternalApiIpSubnet
-
type: vlan
device: br-management
vlan_id:
get_param: StorageNetworkVlanID
addresses:
-
ip_netmask:
get_param: StorageIpSubnet
outputs:
OS::stack_id:
description: The OsNetConfigImpl resource.
value:
get_resource: OsNetConfigImpl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment