Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Problem

Anonymous users were not able Unable to access Kube API server from outside. To enable this access execute following commandsas anonymous user.

Cause

 No user management required/setup for the cluster

Fix

Anonymous user is not created with role to access Kube API.

Fix

In order to allow anonymous users to access Kube API server from outside, follow the commands mentioned below -

# kubectl create rolebinding bob-admin-binding --clusterrole=admin --user=system:anonymous --namespace=default   default (any Any user can access Kube API)

(OR) use Use authentication token   (preferred one)

curl -k `(kubectl config view | grep server | cut -f 2- -d ":" | tr -d " ")`/api/v1/namespaces/default/pods/web/log --header "Authorization: Bearer `(kubectl describe secret $(kubectl get secrets | grep default | cut -f1 -d ' ') | grep -E '^token' | cut -f2 -d':' | tr -d '\t')`"