Code Monkey home page Code Monkey logo

Comments (11)

rajansandeep avatar rajansandeep commented on June 14, 2024

0319 07:09:59.530761 1 reflector.go:134] github.com/coredns/coredns/plugin/kubernetes/controller.go:322: Failed to list *v1.Namespace: Unauthorized

Unauthorized errors mean the authentication credentials being used are not valid.

from kubernetai.

rajansandeep avatar rajansandeep commented on June 14, 2024

This is my coredns kubernetai config (replaced kubernetes default block), the rest is coredns defaults

Is there a reason to use kubernetai instead of the default kubernetes plugin, since it seems you have only one zone cluster.local

Nvm, corefile seems valid.

from kubernetai.

offzale avatar offzale commented on June 14, 2024

I am using kubernetai to be able to use the plugin more than once in the server block

Unauthorized errors mean the authentication credentials being used are not valid.

You're right, so I wonder if I can really make either this or kubernetes plugin work with EKS. Since the typical authentication method used to access EKS clusters is not using keys but aws-iam-authenticator

from kubernetai.

chrisohaver avatar chrisohaver commented on June 14, 2024

In general, "Unauthorized" means that the user identity is successfully authenticated, but not authorized to access the resource requested ...

May want to double check that the user account has the list permission for the Namespace resource in RBAC.

from kubernetai.

offzale avatar offzale commented on June 14, 2024

In general, "Unauthorized" means that the user identity is successfully authenticated, but not authorized to access the resource requested ...

May want to double check that the user account has the list permission for the Namespace resource in RBAC.

I understand what you describe as a Forbidden error, and Unauthorized as when the server does not accept the credentials passed. Nevertheless, I disabled the certificate I am using on the AWS user and tried again using the same credentials (this time they are not valid) and still get the same Unauthorized error.

The way I am authenticating to EKS at the moment is by using credentials that can do a PassRole action to the role assigned to the k8s EKS cluster. So you first need a way to authenticate to the AWS account, and then switch to the Role that has permissions on that cluster. I didn't see any plugin in coredns that supports such authentication yet, since it would be quite custom just for accessing to EKS clusters.

Anyone aware of any other way to authenticate to EKS clusters that can work when connecting to them from any coredns plugin?

from kubernetai.

chrisohaver avatar chrisohaver commented on June 14, 2024

Ah, OK thanks. In general there is a distinction between authorization and authentication... but it seems that k8s is blurring the terminology in this error message.

from kubernetai.

johnbelamaric avatar johnbelamaric commented on June 14, 2024

from kubernetai.

johnbelamaric avatar johnbelamaric commented on June 14, 2024

from kubernetai.

offzale avatar offzale commented on June 14, 2024

@johnbelamaric you're right, I don't see any AWS compatible client-go auth-plugin either. This is the EKS authentication and authorization workflow:
https://docs.aws.amazon.com/eks/latest/userguide/managing-auth.html

It authenticates first to AWS, then RBAC checks if that IAM entity has permissions to run the kubectl command. So the authentication is not made using certs but AWS credentials.

from kubernetai.

chrisohaver avatar chrisohaver commented on June 14, 2024

@johnbelamaric, yes thanks for that. makes sense. me being dense. @offzale, my apologies for misleading you.

from kubernetai.

offzale avatar offzale commented on June 14, 2024

@chrisohaver no problem, it could have been the problem also. So was good to check to make sure it wasn't. I am afraid that it is what @johnbelamaric spotted, there is no auth plugin for AWS yet.

from kubernetai.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.