c12s-kubespray/roles/kubernetes/preinstall/tasks
Chad Swenson 0c7e1889e4 Support for disabling apiserver insecure port
This allows `kube_apiserver_insecure_port` to be set to 0 (disabled). It's working, but so far I have had to:

1. Make the `uri` module "Wait for apiserver up" checks use `kube_apiserver_port` (HTTPS)
2. Add apiserver client cert/key to the "Wait for apiserver up" checks
3. Update apiserver liveness probe to use HTTPS ports
4. Set `kube_api_anonymous_auth` to true to allow liveness probe to hit apiserver's /healthz over HTTPS (livenessProbes can't use client cert/key unfortunately)
5. RBAC has to be enabled. Anonymous requests are in the `system:unauthenticated` group which is granted access to /healthz by one of RBAC's default ClusterRoleBindings. An equivalent ABAC rule could allow this as well.

Changes 1 and 2 should work for everyone, but 3, 4, and 5 require new coupling of currently independent configuration settings. So I also added a new settings check.

Options:

1. The problem goes away if you have both anonymous-auth and RBAC enabled. This is how kubeadm does it. This may be the best way to go since RBAC is already on by default but anonymous auth is not.
2. Include conditional templates to set a different liveness probe for possible combinations of `kube_apiserver_insecure_port = 0`, RBAC, and `kube_api_anonymous_auth` (won't be possible to cover every case without a guaranteed authorizer for the secure port)
3. Use basic auth headers for the liveness probe (I really don't like this, it adds a new dependency on basic auth which I'd also like to leave independently configurable, and it requires encoded passwords in the apiserver manifest)

Option 1 seems like the clear winner to me, but is there a reason we wouldn't want anonymous-auth on by default? The apiserver binary defaults anonymous-auth to true, but kubespray's default was false.
2017-11-06 14:01:10 -06:00
..
azure-credential-check.yml Adding yamllinter to ci steps (#1556) 2017-08-24 12:09:52 +03:00
dhclient-hooks-undo.yml rename almost all mentions of kargo 2017-06-16 13:25:46 -04:00
dhclient-hooks.yml This continues the DHCP hook checks. Also protect the create side 2017-01-31 09:56:27 -06:00
etchosts.yml added flag for not populating inventory entries to etc hosts file 2017-06-30 16:41:03 +00:00
growpart-azure-centos-7.yml Cleanup legacy syntax, spacing, files all to yml 2017-02-17 16:22:34 -05:00
main.yml Fix local volume provisioner mount point for rkt 2017-11-02 09:45:26 +00:00
openstack-credential-check.yml Fix openstack tenant id variable name (#1932) 2017-11-05 08:40:41 +00:00
resolvconf.yml Condense resolvconf sources before starting loop 2017-03-17 13:06:56 +03:00
set_facts.yml Normalize tags in all places to prepare for tag fixing in future (#1739) 2017-10-05 08:43:04 +01:00
set_resolv_facts.yml Rename dns_server, add var for selinux. (#1572) 2017-10-11 20:40:21 +01:00
verify-settings.yml Support for disabling apiserver insecure port 2017-11-06 14:01:10 -06:00
vsphere-credential-check.yml Adding yamllinter to ci steps (#1556) 2017-08-24 12:09:52 +03:00