From f8a0054cf13aee95e57f189814f5fe2b42fafa93 Mon Sep 17 00:00:00 2001 From: Tommi Immonen Date: Wed, 11 Jan 2017 13:05:21 +0200 Subject: [PATCH 1/5] Tommin muutokset customize-disk-image skriptiin --- customize-disk-image | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/customize-disk-image b/customize-disk-image index 55a7cd3..5743b1e 100755 --- a/customize-disk-image +++ b/customize-disk-image @@ -18,20 +18,13 @@ parser.add_argument('--deployment-type', dest='deployment', default='origin', parser.add_argument('--memsize', dest='memsize', default='512', help='memory size to be used by virt-customize') parser.add_argument('--package', dest="packages", action='append', - default=['deltarpm', - 'git', - 'httpd-tools', - 'iptables', - 'iptables-services', - 'PyYAML', - 'ceph-common', - 'glusterfs-fuse', - 'nfs-utils', - 'libselinux-python', - 'firewalld', - 'logrotate', - 'pcs', - 'bash-completion'], + default=['wget', + 'git', + 'net-tools', + 'bind-utils', + 'iptables-services', + 'bridge-utils', + 'bash-completion'], help='additional package to install') parser.add_argument('--sm-credentials', dest="sm_creds", help='subscription-manager credentials (user:password)') @@ -41,7 +34,7 @@ parser.add_argument('--sm-repo', dest="sm_repos", action='append', default=['rhel-7-server-rpms', 'rhel-7-server-extras-rpms', 'rhel-7-server-optional-rpms', - 'rhel-7-server-ose-3.2-rpms'], + 'rhel-7-server-ose-3.3-rpms'], help='subscription-manager repository to enable') parser.add_argument('--no-update', dest="update", action='store_false', default=True, help='update packages') @@ -63,8 +56,7 @@ if args.verbose: # Create set of packages to install if args.deployment == "enterprise": - args.packages += ["atomic-openshift-master", "atomic-openshift-node", - "tuned-profiles-atomic-openshift-node"] + args.packages += ["atomic-openshift-utils"] elif args.deployment == "origin": args.packages += ["origin-master", "origin-node", "tuned-profiles-origin-node"] @@ -103,11 +95,11 @@ if args.update: cmd += ["--update"] # Set up EPEL -cmd += ["--install", "https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm", - "--run-command", "sed -i -e 's/^enabled=1/enabled=0/' /etc/yum.repos.d/epel.repo"] +#cmd += ["--install", "https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm", +# "--run-command", "sed -i -e 's/^enabled=1/enabled=0/' /etc/yum.repos.d/epel.repo"] # Install ansible -cmd += ["--run-command", "yum -y --enablerepo=epel install ansible"] +#cmd += ["--run-command", "yum -y --enablerepo=epel install ansible"] # Install required packages cmd += ["--install", ",".join(args.packages)] From 1c6a50b2128c9bf44a1173a13210ed5c674dff37 Mon Sep 17 00:00:00 2001 From: Vedran Bartonicek Date: Wed, 3 May 2017 13:02:58 +0300 Subject: [PATCH 2/5] Revert "Tommin muutokset customize-disk-image skriptiin" This reverts commit f8a0054cf13aee95e57f189814f5fe2b42fafa93. --- customize-disk-image | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/customize-disk-image b/customize-disk-image index 5743b1e..55a7cd3 100755 --- a/customize-disk-image +++ b/customize-disk-image @@ -18,13 +18,20 @@ parser.add_argument('--deployment-type', dest='deployment', default='origin', parser.add_argument('--memsize', dest='memsize', default='512', help='memory size to be used by virt-customize') parser.add_argument('--package', dest="packages", action='append', - default=['wget', - 'git', - 'net-tools', - 'bind-utils', - 'iptables-services', - 'bridge-utils', - 'bash-completion'], + default=['deltarpm', + 'git', + 'httpd-tools', + 'iptables', + 'iptables-services', + 'PyYAML', + 'ceph-common', + 'glusterfs-fuse', + 'nfs-utils', + 'libselinux-python', + 'firewalld', + 'logrotate', + 'pcs', + 'bash-completion'], help='additional package to install') parser.add_argument('--sm-credentials', dest="sm_creds", help='subscription-manager credentials (user:password)') @@ -34,7 +41,7 @@ parser.add_argument('--sm-repo', dest="sm_repos", action='append', default=['rhel-7-server-rpms', 'rhel-7-server-extras-rpms', 'rhel-7-server-optional-rpms', - 'rhel-7-server-ose-3.3-rpms'], + 'rhel-7-server-ose-3.2-rpms'], help='subscription-manager repository to enable') parser.add_argument('--no-update', dest="update", action='store_false', default=True, help='update packages') @@ -56,7 +63,8 @@ if args.verbose: # Create set of packages to install if args.deployment == "enterprise": - args.packages += ["atomic-openshift-utils"] + args.packages += ["atomic-openshift-master", "atomic-openshift-node", + "tuned-profiles-atomic-openshift-node"] elif args.deployment == "origin": args.packages += ["origin-master", "origin-node", "tuned-profiles-origin-node"] @@ -95,11 +103,11 @@ if args.update: cmd += ["--update"] # Set up EPEL -#cmd += ["--install", "https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm", -# "--run-command", "sed -i -e 's/^enabled=1/enabled=0/' /etc/yum.repos.d/epel.repo"] +cmd += ["--install", "https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm", + "--run-command", "sed -i -e 's/^enabled=1/enabled=0/' /etc/yum.repos.d/epel.repo"] # Install ansible -#cmd += ["--run-command", "yum -y --enablerepo=epel install ansible"] +cmd += ["--run-command", "yum -y --enablerepo=epel install ansible"] # Install required packages cmd += ["--install", ",".join(args.packages)] From ceb037b7cc1c45ac082663f2ae926e5df9792f75 Mon Sep 17 00:00:00 2001 From: Vedran Bartonicek Date: Fri, 5 May 2017 21:17:58 +0300 Subject: [PATCH 3/5] Added configration files for lbaasv2 --- loadbalancer_lbaasv2.yaml | 225 +++++++++++++++++++++++++++ loadbalancer_lbaasv2_poolmember.yaml | 37 +++++ 2 files changed, 262 insertions(+) create mode 100644 loadbalancer_lbaasv2.yaml create mode 100644 loadbalancer_lbaasv2_poolmember.yaml diff --git a/loadbalancer_lbaasv2.yaml b/loadbalancer_lbaasv2.yaml new file mode 100644 index 0000000..aefd295 --- /dev/null +++ b/loadbalancer_lbaasv2.yaml @@ -0,0 +1,225 @@ +heat_template_version: 2014-10-16 + +description: > + A template which provides a creates a loadbalancer using neutron's LBaaS. + +parameters: + + key_name: + description: > + A pre-submitted SSH key to access the VM hosts + type: string + constraints: + - custom_constraint: nova.keypair + + image: + type: string + default: '' + + flavor: + description: > + Define the hardware characteristics for the VMs: CPU, Memory, base disk + type: string + constraints: + - custom_constraint: nova.flavor + + hostname: + description: > + The load balancer hostname portion of the FQDN + type: string + constraints: + - allowed_pattern: '[a-z0-9\-]*' + description: Hostname must contain only characters [a-z0-9\-]. + + domain_name: + description: > + All VMs will be placed in this domain + type: string + + rhn_username: + description: > + A valid user with entitlements to RHEL and OpenShift software repos + type: string + + rhn_password: + description: > + The password for the RHN user + type: string + hidden: true + + # Red Hat satellite subscription parameters + sat6_hostname: + type: string + description: > + The hostname of the Satellite 6 server which will provide software updates + default: '' + + sat6_organization: + type: string + description: > + An organization string provided by Sat6 to group subscriptions + default: '' + + sat6_activationkey: + type: string + description: > + An activation key string provided by Sat6 to enable subscriptions + + rhn_pool: + description: > + A subscription pool containing the RHEL and OpenShift software repos + OPTIONAL + type: string + hidden: true + + extra_rhn_pools: + type: comma_delimited_list + description: List of rhn pools which will be installed on each node. + default: '' + + ssh_user: + description: > + The user for SSH access to the VM hosts + type: string + + ansible_public_key: + description: > + The SSH public key that Ansible will use to access master and node hosts + This will be placed on each VM host in /root/.ssh/authorized_keys + type: string + + single_lb_member_address: + type: string + + master_ips: + type: comma_delimited_list + + master_count: + type: number + + master_hostname: + type: string + + fixed_network: + description: > + The name or ID of the internal network + type: string + constraints: + - custom_constraint: neutron.network + + fixed_subnet: + description: > + The name or ID of the internal IPv4 space + type: string + constraints: + - custom_constraint: neutron.subnet + + external_network_subnet: + description: > + The name or ID of the external IPv4 space + type: string + constraints: + - custom_constraint: neutron.subnet + + extra_repository_urls: + type: comma_delimited_list + description: List of repository URLs which will be installed on each node. + default: '' + + extra_docker_repository_urls: + type: comma_delimited_list + description: List of docker repository URLs which will be installed on each node, if a repo is insecure use '#insecure' suffix. + default: '' + + stack_name: + type: string + default: '' + + bastion_node: + type: string + description: > + The name or ID of the bastion instance. + default: '' + +resources: + lb: + type: OS::Neutron::LBaaS::LoadBalancer + properties: + name: + list_join: ['-', [ {get_param: stack_name}, 'loadbalancer']] + vip_subnet: {get_param: fixed_subnet} + + listener: + type: OS::Neutron::LBaaS::Listener + properties: + loadbalancer: {get_resource: lb} + name: + list_join: ['-', [ {get_param: stack_name}, 'loadbalancer-listener']] + protocol: HTTPS + protocol_port: 8443 + + lb_pool: + type: OS::Neutron::LBaaS::Pool + properties: + listener: {get_resource: listener} + name: + list_join: ['-', [ {get_param: stack_name}, 'loadbalancer-listener-pool']] + description: Load balancer for OpenShift hosts. + lb_algorithm: ROUND_ROBIN + protocol: HTTPS + session_persistence: + type: SOURCE_IP + + pool_members: + depends_on: [lb_pool] + type: OS::Heat::ResourceGroup + properties: + count: {get_param: master_count} + resource_def: + type: loadbalancer_lbaasv2_poolmember.yaml + properties: + # Note you have to pass the index and the entire list into the + # nested template, resolving via %index% doesn't work directly + # in the get_param here + index: "%index%" + lb_pool: {get_resource: lb_pool} + protocol_port: 8443 + master_ips: {get_param: master_ips} + fixed_subnet: {get_param: fixed_subnet} + external_network_subnet: {get_param: external_network_subnet} + + lb_monitor: + type: OS::Neutron::LBaaS::HealthMonitor + properties: + pool: { get_resource: lb_pool } + type: TCP + delay: 15 + max_retries: 5 + timeout: 10 + +outputs: + console_url: + description: URL of the OpenShift web console + value: + str_replace: + template: "https://%hostname%.%domainname%:8443/console/" + params: + '%hostname%': {get_param: hostname} + '%domainname%': {get_param: domain_name} + + api_url: + description: URL entrypoint to the OpenShift API + value: + str_replace: + template: "https://%hostname%.%domainname%:8443/" + params: + '%hostname%': {get_param: hostname} + '%domainname%': {get_param: domain_name} + + loadbalancer_ip: + description: Load Balancer IP + value: {get_attr: [lb, vip_address ]} + + loadbalancer_port_id: + description: Load Balaner port id for floating ip association + value: {get_attr: [lb, vip_port_id]} diff --git a/loadbalancer_lbaasv2_poolmember.yaml b/loadbalancer_lbaasv2_poolmember.yaml new file mode 100644 index 0000000..f61f7c8 --- /dev/null +++ b/loadbalancer_lbaasv2_poolmember.yaml @@ -0,0 +1,37 @@ +heat_template_version: 2014-10-16 + +parameters: + + lb_pool: + type: string + + index: + type: number + + protocol_port: + type: number + + master_ips: + type: comma_delimited_list + + fixed_subnet: + type: string + + external_network_subnet: + description: > + The name or ID of the internal IPv4 space + type: string + +resources: + + pool_member: + type: OS::Neutron::LBaaS::PoolMember + properties: + pool: {get_param: lb_pool} + protocol_port: {get_param: protocol_port} + address: {get_param: [master_ips, {get_param: index}]} + subnet: {get_param: external_network_subnet} + +outputs: + lb_member: + value: { get_attr: [pool_member, show] } From dc624d34ec936c3b282e852cd1ebf2a6bcf3ed23 Mon Sep 17 00:00:00 2001 From: Vedran Bartonicek Date: Fri, 5 May 2017 22:13:29 +0300 Subject: [PATCH 4/5] Missing parameters for lbaas --- env_loadbalancer_lbaasv2.yaml | 6 ++++++ loadbalancer_lbaasv2.yaml | 32 ++++++++++++++++++++++++++++++++ openshift.yaml | 5 +++++ 3 files changed, 43 insertions(+) create mode 100644 env_loadbalancer_lbaasv2.yaml diff --git a/env_loadbalancer_lbaasv2.yaml b/env_loadbalancer_lbaasv2.yaml new file mode 100644 index 0000000..e8a8dec --- /dev/null +++ b/env_loadbalancer_lbaasv2.yaml @@ -0,0 +1,6 @@ +parameters: + loadbalancer_type: 'neutron' + +resource_registry: + OOShift::LoadBalancer: loadbalancer_lbaasv2.yaml + OOShift::IPFailover: ipfailover_keepalived.yaml diff --git a/loadbalancer_lbaasv2.yaml b/loadbalancer_lbaasv2.yaml index aefd295..37df26c 100644 --- a/loadbalancer_lbaasv2.yaml +++ b/loadbalancer_lbaasv2.yaml @@ -5,6 +5,38 @@ description: > parameters: + ocp_version: + type: string + description: > + The version of OpenShift Container Platform to deploy + + app_subdomain: + type: string + + members: + type: comma_delimited_list + + master_hostname: + type: string + + floatingip_id: + type: string + + dns_servers: + type: comma_delimited_list + description: address of dns nameservers reachable in your environment + + dns_update_key: + type: string + hidden: true + + ca_cert: + type: string + description: Certificate Authority Certificate to be added to trust chain + + floatingip: + type: string + key_name: description: > A pre-submitted SSH key to access the VM hosts diff --git a/openshift.yaml b/openshift.yaml index 80a4b3e..b66a571 100644 --- a/openshift.yaml +++ b/openshift.yaml @@ -1007,6 +1007,11 @@ resources: dns_servers: {get_param: dns_nameserver} dns_update_key: {get_param: dns_update_key} ca_cert: {get_param: ca_cert} + # lbaasv2 + master_ips: {get_attr: [openshift_masters, ip_address]} + single_lb_member_address: {get_attr: [ openshift_masters, resource.0.private_ip_address ]} + master_count: {get_param: master_count} + external_network_subnet: {get_param: external_network_subnet} outputs: From cf1b156eab7e10a678cbec711796f041dbcda65a Mon Sep 17 00:00:00 2001 From: Vedran Bartonicek Date: Sun, 7 May 2017 13:42:31 +0300 Subject: [PATCH 5/5] Added parameters specific for lbaasv2 --- loadbalancer_dedicated.yaml | 13 +++++++++++++ loadbalancer_external.yaml | 13 +++++++++++++ loadbalancer_lbaasv2.yaml | 3 --- loadbalancer_lbaasv2_poolmember.yaml | 13 +++++++++++++ loadbalancer_neutron.yaml | 13 +++++++++++++ loadbalancer_none.yaml | 13 +++++++++++++ openshift.yaml | 2 -- 7 files changed, 65 insertions(+), 5 deletions(-) diff --git a/loadbalancer_dedicated.yaml b/loadbalancer_dedicated.yaml index e472e25..3744e07 100644 --- a/loadbalancer_dedicated.yaml +++ b/loadbalancer_dedicated.yaml @@ -176,6 +176,19 @@ parameters: type: string description: Certificate Authority Certificate to be added to trust chain + master_ips: + type: comma_delimited_list + + master_count: + type: number + + external_network_subnet: + description: > + The name or ID of the external IPv4 space + type: string + constraints: + - custom_constraint: neutron.subnet + resources: floating_ip_assoc: type: OS::Neutron::FloatingIPAssociation diff --git a/loadbalancer_external.yaml b/loadbalancer_external.yaml index db77a4d..5f1a8f3 100644 --- a/loadbalancer_external.yaml +++ b/loadbalancer_external.yaml @@ -62,6 +62,19 @@ parameters: type: string hidden: true + master_ips: + type: comma_delimited_list + + master_count: + type: number + + external_network_subnet: + description: > + The name or ID of the external IPv4 space + type: string + constraints: + - custom_constraint: neutron.subnet + # Red Hat satellite subscription parameters sat6_hostname: type: string diff --git a/loadbalancer_lbaasv2.yaml b/loadbalancer_lbaasv2.yaml index 37df26c..bb33568 100644 --- a/loadbalancer_lbaasv2.yaml +++ b/loadbalancer_lbaasv2.yaml @@ -120,9 +120,6 @@ parameters: This will be placed on each VM host in /root/.ssh/authorized_keys type: string - single_lb_member_address: - type: string - master_ips: type: comma_delimited_list diff --git a/loadbalancer_lbaasv2_poolmember.yaml b/loadbalancer_lbaasv2_poolmember.yaml index f61f7c8..4c9c9dc 100644 --- a/loadbalancer_lbaasv2_poolmember.yaml +++ b/loadbalancer_lbaasv2_poolmember.yaml @@ -22,6 +22,19 @@ parameters: The name or ID of the internal IPv4 space type: string + master_ips: + type: comma_delimited_list + + master_count: + type: number + + external_network_subnet: + description: > + The name or ID of the external IPv4 space + type: string + constraints: + - custom_constraint: neutron.subnet + resources: pool_member: diff --git a/loadbalancer_neutron.yaml b/loadbalancer_neutron.yaml index cdb49a8..627be3b 100644 --- a/loadbalancer_neutron.yaml +++ b/loadbalancer_neutron.yaml @@ -167,6 +167,19 @@ parameters: type: string description: Certificate Authority Certificate to be added to trust chain + master_ips: + type: comma_delimited_list + + master_count: + type: number + + external_network_subnet: + description: > + The name or ID of the external IPv4 space + type: string + constraints: + - custom_constraint: neutron.subnet + resources: lb: type: OS::Neutron::LoadBalancer diff --git a/loadbalancer_none.yaml b/loadbalancer_none.yaml index 2c1d825..908fd3b 100644 --- a/loadbalancer_none.yaml +++ b/loadbalancer_none.yaml @@ -178,6 +178,19 @@ parameters: type: string description: Certificate Authority Certificate to be added to trust chain + master_ips: + type: comma_delimited_list + + master_count: + type: number + + external_network_subnet: + description: > + The name or ID of the external IPv4 space + type: string + constraints: + - custom_constraint: neutron.subnet + outputs: console_url: description: URL of the OpenShift web console diff --git a/openshift.yaml b/openshift.yaml index b66a571..3eeaea0 100644 --- a/openshift.yaml +++ b/openshift.yaml @@ -1007,9 +1007,7 @@ resources: dns_servers: {get_param: dns_nameserver} dns_update_key: {get_param: dns_update_key} ca_cert: {get_param: ca_cert} - # lbaasv2 master_ips: {get_attr: [openshift_masters, ip_address]} - single_lb_member_address: {get_attr: [ openshift_masters, resource.0.private_ip_address ]} master_count: {get_param: master_count} external_network_subnet: {get_param: external_network_subnet}