TLS is broken since containerized undercloud

Bug #1795722 reported by Michele Baldessari
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Critical
Michele Baldessari

Bug Description

Since we moved to containerized UC, TLS Everywhere deployments are broken.
Namely we miss two things:
A. The NAT iptables rule for the nova metadata service to be reachable
B. The setting 'service_metadata_proxy=false' needs to be set for nova metadata otherwise the curl calls to setup ipa will fail with the following:
[root@overcloud-controller-0 log]# curl http://169.254.169.254/openstack/2016-10-06
<html>
 <head>
  <title>400 Bad Request</title>
 </head>
 <body>
  <h1>400 Bad Request</h1>
  X-Instance-ID header is missing from request.<br /><br />
 </body>
</html>

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (master)

Fix proposed to branch: master
Review: https://review.openstack.org/607343

Changed in tripleo:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (master)

Reviewed: https://review.openstack.org/607343
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=c2139a7db2d0142be033d93f63ca6e75f901821a
Submitter: Zuul
Branch: master

commit c2139a7db2d0142be033d93f63ca6e75f901821a
Author: Michele Baldessari <email address hidden>
Date: Tue Oct 2 20:49:29 2018 +0200

    Fix TLS when using a containerized undercloud

    Since we moved to containerized UC, TLS Everywhere deployments are broken.
    Namely we miss two things:

    A. The NAT iptables rule for the nova metadata service to be reachable
    B. The setting 'service_metadata_proxy=false' needs to be set for nova
       metadata otherwise the curl calls to setup ipa will fail with the
       following:
    [root@overcloud-controller-0 log]# curl http://169.254.169.254/openstack/2016-10-06
    <html>
     <head>
      <title>400 Bad Request</title>
     </head>
     <body>
      <h1>400 Bad Request</h1>
      X-Instance-ID header is missing from request.<br /><br />
     </body>
    </html>

    A. Is fixed by adding a conditional iptables rule that is only triggered
       when deploying an undercloud (where we set MetadataNATRule to true)

    B. Is fixed by setting NeutronMetadataProxySharedSecret to '' on the
       undercloud and then setting the corresponding hiera keys only when
       the parameter != ''. We tried alternative simpler approaches like
       setting NeutronMetadataProxySharedSecret to null but that will break
       heat as the parameter is required and setting it to null breaks heat
       validation (we also tried to make the parameter optional with a
       default: '', but that broke as well)

    While we're at it we also remove the neutron metadata service from the
    undercloud as it is not needed.

    Tested by deploying an undercloud with this change and observing:
    A.
    Chain PREROUTING (policy ACCEPT 106 packets, 6698 bytes)
     pkts bytes target prot opt in out source destination
        0 0 REDIRECT tcp -- br-ctlplane * 0.0.0.0/0 169.254.169.254 multiport dports 80 state NEW /* 999 undercloud nat ipv4 */ redir ports 8775

    B.
    grep -ir ^service_metadata_proxy /var/lib/config-data/puppet-generated/nova/etc/nova/nova.conf
    service_metadata_proxy=False

    Also a deployment of a TLS overcloud was successful.

    Change-Id: Id48df6db012fb433f9a0e618d0269196f4cfc2c6
    Co-Authored-By: Martin Schuppert <email address hidden>
    Closes-Bug: #1795722

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.openstack.org/608440

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (stable/rocky)

Reviewed: https://review.openstack.org/608440
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=ca765f73c6d0477d1b5a07e94858b428bda23c08
Submitter: Zuul
Branch: stable/rocky

commit ca765f73c6d0477d1b5a07e94858b428bda23c08
Author: Michele Baldessari <email address hidden>
Date: Tue Oct 2 20:49:29 2018 +0200

    Fix TLS when using a containerized undercloud

    Since we moved to containerized UC, TLS Everywhere deployments are broken.
    Namely we miss two things:

    A. The NAT iptables rule for the nova metadata service to be reachable
    B. The setting 'service_metadata_proxy=false' needs to be set for nova
       metadata otherwise the curl calls to setup ipa will fail with the
       following:
    [root@overcloud-controller-0 log]# curl http://169.254.169.254/openstack/2016-10-06
    <html>
     <head>
      <title>400 Bad Request</title>
     </head>
     <body>
      <h1>400 Bad Request</h1>
      X-Instance-ID header is missing from request.<br /><br />
     </body>
    </html>

    A. Is fixed by adding a conditional iptables rule that is only triggered
       when deploying an undercloud (where we set MetadataNATRule to true)

    B. Is fixed by setting NeutronMetadataProxySharedSecret to '' on the
       undercloud and then setting the corresponding hiera keys only when
       the parameter != ''. We tried alternative simpler approaches like
       setting NeutronMetadataProxySharedSecret to null but that will break
       heat as the parameter is required and setting it to null breaks heat
       validation (we also tried to make the parameter optional with a
       default: '', but that broke as well)

    While we're at it we also remove the neutron metadata service from the
    undercloud as it is not needed.

    Tested by deploying an undercloud with this change and observing:
    A.
    Chain PREROUTING (policy ACCEPT 106 packets, 6698 bytes)
     pkts bytes target prot opt in out source destination
        0 0 REDIRECT tcp -- br-ctlplane * 0.0.0.0/0 169.254.169.254 multiport dports 80 state NEW /* 999 undercloud nat ipv4 */ redir ports 8775

    B.
    grep -ir ^service_metadata_proxy /var/lib/config-data/puppet-generated/nova/etc/nova/nova.conf
    service_metadata_proxy=False

    Also a deployment of a TLS overcloud was successful.

    Change-Id: Id48df6db012fb433f9a0e618d0269196f4cfc2c6
    Co-Authored-By: Martin Schuppert <email address hidden>
    Closes-Bug: #1795722
    (cherry picked from commit c2139a7db2d0142be033d93f63ca6e75f901821a)

tags: added: in-stable-rocky
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates 10.1.0

This issue was fixed in the openstack/tripleo-heat-templates 10.1.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates 9.1.0

This issue was fixed in the openstack/tripleo-heat-templates 9.1.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.