Sha256: f177ec704e0da8af309448767d1aa232269f009ad6ed055e166f9cb939652eac

Contents?: true

Size: 1.33 KB

Versions: 2

Compression:

Stored size: 1.33 KB

Contents

# Creates a load balancer for CD4PE
#
# This will result in the following services going into DNS:
#
# * cd4pe.puppet.local
# * cd4pe-webhooks.puppet.local
# * k8s-api.puppet.local
# * k8s-console.puppet.local
# * k8s-registry.puppet.local
#
class profile::cd4pe::haproxy {
  require profile::haproxy

  Haproxy::Listen {
    ipaddress => $facts['networking']['ip'],
  }

  # For each of these endpoints we create a listener and a dns name
  # e.g. {name}.{domain}
  $endpoints = [
    {
      'name' => 'cd4pe',
      'port' => '443',
    },
    {
      'name' => 'cd4pe-webhooks',
      'port' => '443',
    },
    {
      'name' => 'k8s-api',
      'port' => '6443',
    },
    {
      'name' => 'kots-console',
      'port' => '8800',
    },
    {
      'name' => 'k8s-registry',
      'port' => '443',
    },
  ]

  $endpoints.each |$details| {
    # Each endpoint gets a DNS name and a listener
    $dns_name = "${details['name']}.puppet.local"
    $ip       = $facts['networking']['ip']

    # Create the listener
    haproxy::listen { $details['name']:
      ipaddress        => $ip,
      collect_exported => true,
      ports            => $details['port'],
    }

    @@resource_record { $dns_name:
      ensure => present,
      record => $dns_name,
      type   => 'A',
      zone   => 'puppet.local',
      data   => [
        $ip,
      ],
    }
  }
}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
onceover-4.0.0 spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/cd4pe/haproxy.pp
onceover-3.22.0 spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/cd4pe/haproxy.pp