-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Configure Dex with CRDs #1381
Comments
Yup, looks like something where some more docs would be helpful, indeed. There's docs, but they could surely be expanded with some config examples. Does looking at the helm chart help in any way? I'm sorry I've never messed with CRDs much... |
@logicfox, I agree that it would be really convenient to be able to define clients with CRDs, but this doesn't currently work -- as the documentation states, "Admins should not interact with these resources directly, except while debugging. These resources are only designed to store state and aren't meant to be consumed by end users. For modifying dex's state dynamically see the API documentation." |
Yes, this is unsupported. |
That's unfortunate. Given that all the required information is already there in those CRDs and that the primary use-case for Dex is Kubernetes, would it be possible to implement reading the configuration from storage.go if a configuration flag is set? |
Is it? News to me 😅 Dex really works in many settings 😃 That said, I take your point as this being an enhancement that might make sense. 👍 |
Hi! Sorry to bump an old issue, I just wanted to add a use-case to this topic: GitOps When following GitOps practices the state of a system is defined in terms of files in Git instead of being imperatively driven via API requests. Having supported access to Dex's CRDs would allow us to define clients in a way that is decoupled from the Dex deployment files (which may live in a separate repository). Example: I have an One developer wants to deploy an internal custom webapp which should authenticate users with the same user pool as the rest of the infra services. Instead of having to edit Dex's configuration file in the One example of Kubernetes-enabled system that works this way is ArgoCD which supports creating apps and projects via either a web UI, a gRPC API or by applying custom resources. Given that Dex already has its own CRDs, I guess supporting this use-case could simply mean adding a validation schema to the CRDs and documenting how to create them via YAML files. |
We would love this too, our current story for provisioning new apps onto Dex is a bit painful. |
Sorry to nudge this issue again, but declarative management of clients and providers is something really we really need in order to integrate Dex in our environment. I would like to ask the maintainers if they have plans for this, or if they want to delegate this to an third party "Dex Operator" project. IMHO, since Dex already supports CRDs for configuration it would be only natural to use them and promote them to the status of "public API", compared to the current "internal implementation detail". |
We'll add this to the roadmap at some point, but can't promise anything or give an ETA at this point. We are still figuring things out around the CNCF sandbox status, trying to clean up our processes, etc. But I think this is definitely the way Dex needs to head, or at least we need something similar to Prometheus for configuration. |
Dex CRDs are used for storage and not for configuration that is why they are an internal implementation detail. |
@bonifaido I know, that's what I'm saying. The fact that Dex already has CRDs means it should not be too complicated to promote them from internal storage implementation to an officially supported way of configuration, aligning Dex's user experience to other projects in the kube world (namely the Argo projects, the operator pattern, etc) and enabling fully declarative Dex deployments |
The fact that it uses CRDs for something (storage in this case) doesn't mean that configuring Dex via CRDs is two clicks away. 🤣 |
I didn't mean to trivialize the task. I just meant to point out that it's not like Dex has to be integrated from scratch, so I wanted to encourage maintainers to consider this feature. |
Based on the example of @logicfox and reverse engineering of some code, I was able to define a connector with following CRD: apiVersion: dex.coreos.com/v1
kind: Connector
metadata:
namespace: dex
name: atest # id of your connector
id: atest # should match metadata.name
type: oidc
name: 'A test'
# config, as described on https://dexidp.io/docs/connectors/oidc/, converted to json, base64 encoded
config: eyJpc3N1ZXIiOiJodHRwczovL2lzc3Vlci51cmwiLCJjbGllbnRJRCI6InRoZS1jbGllbnQtaWQiLCJjbGllbnRTZWNyZXQiOiJvaC1zby1zZWNyZXQiLCJyZWRpcmVjdFVSSSI6Imh0dHBzOi8vZGV4LmFwcGxpY2F0aW9uLm5ldC9jYWxsYmFjay8ifQo=
|
I haven't found any examples of configuring Connectors and OAuth2Clients via CRDs. It would be useful to know how to do this, or add missing support, as this would enable users of an RBAC enabled cluster to configure Dex simply with CRDs.
For instance, I tried creating an OIDC connector based on this struct
but Dex fails while starting up with the error message from this line
The text was updated successfully, but these errors were encountered: