Skip to content

Commit

Permalink
Correctly configure HAProxy to check HTTPS on a TCP frontend
Browse files Browse the repository at this point in the history
If you use the `ssl` option instead of `check-ssl`, then HAProxy will
attempt to add its own TLS encryption on top of the TCP forwarding
instead of merely letting it pass through. Fortunately, you can use
`check-ssl` instead of `ssl`, to tell it only to use SSL on the HTTP
check, not on the main load balancing.
  • Loading branch information
daaang committed Jan 26, 2024
1 parent 8067f9b commit 5588a78
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion manifests/profile/kubernetes/destination_port/api.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
@@concat_fragment { "haproxy kubernetes api ${::hostname}":
target => '/etc/haproxy/services.d/api.cfg',
order => '02',
content => " server ${::hostname} ${::ipaddress}:6443 check ssl verify none\n",
content => " server ${::hostname} ${::ipaddress}:6443 check check-ssl verify none\n",
tag => "${cluster_name}_haproxy_kubernetes_api",
}
}
2 changes: 1 addition & 1 deletion spec/classes/profile/kubernetes/destination_port_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
require 'spec_helper'

[
['api', 6443, 'check ssl verify none'],
['api', 6443, 'check check-ssl verify none'],
['etcd', 2379, 'check'],
['http', 30080, 'check send-proxy'],
['https', 30443, 'check send-proxy'],
Expand Down

0 comments on commit 5588a78

Please sign in to comment.