Kubernetes. HTTPS API return `Unauthorized`

Did you specify --token-auth-file=<file> and/or --basic-auth-file=<otherfile> or one of the other authentication modes? I don't know that https endpoint will work without one of these (maybe it should, but it doesn't, apparently). Check out https://kubernetes.io/docs/admin/authentication/


Hi this is what I did for token,

  1. Find address Server Api

    • open /etc/kubernetes/kubelet.conf

      example: server: https://10.1.32.120:6443

  2. Find token

    • open /etc/kubernetes/pki/tokens.csv

      example: 4c95a1a22d19b20811,kubeadm-node-csr,07ccbf35-e206-11e6-ab8f-0010184e550e,system:kubelet-bootstrap

  3. In this case the token is 4c95a1a22d19b20811
  4. If use postman, add header Authorization: Bearer 4c95a1a22d19b20811