Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to set kube_api_anonymous_auth to false #2761

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions inventory/sample/group_vars/k8s-cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ kube_apiserver_ip: "{{ kube_service_addresses|ipaddr('net')|ipaddr(1)|ipaddr('ad
kube_apiserver_port: 6443 # (https)
kube_apiserver_insecure_port: 8080 # (http)
# Set to 0 to disable insecure port - Requires RBAC in authorization_modes and kube_api_anonymous_auth: true
# If you want to disable kube_api_anonymous_auth too, then you need to add Webhook to authorization_modes.
#kube_apiserver_insecure_port: 0 # (disabled)

# Kube-proxy proxyMode configuration.
Expand Down
4 changes: 2 additions & 2 deletions roles/kubernetes/preinstall/tasks/verify-settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@
when: dashboard_enabled
ignore_errors: "{{ ignore_assert_errors }}"

- name: Stop if RBAC and anonymous-auth are not enabled when insecure port is disabled
- name: Stop if RBAC and anonymous-auth are not enabled when insecure port is disabled and webook authentication is not added
assert:
that: rbac_enabled and kube_api_anonymous_auth
that: rbac_enabled and ( kube_api_anonymous_auth == true or ( kube_api_anonymous_auth == false and ['Webhook' not in authorization_modes] ) )
when: kube_apiserver_insecure_port == 0
ignore_errors: "{{ ignore_assert_errors }}"

Expand Down