-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
The variable "K3S_DATASTORE_ENDPOINT" not resolved yet. #9111
Comments
That is not what's happening. K3s always connects to the postgres database initially, in order to test for existence of the k3s database. See #9033 (comment) |
Is this new? Because I never had a line allowing k3s to access the database |
Yes, under various circumstances. Prior to k3s-io/kine#241 it would connect to that database temporarily, in order to create the kine database if it did not exist. Now it connects to that database in order to check the existence of the kine database in order to avoid creating it if it already exists. There is always some situation under which we may need to use it. |
Thanks for the information @brandond, but I didn't fully get it. Should k3s's postgresql user have access to |
Not sure, please let us know what you find out! |
Hello, in my situation, I rely on a managed postgresql instance which doesn't allow access to |
It does not and cannot allow access to it, or you have not taken steps to grant access to it? As per #9033 (comment) the upstream postgres docs indicate that access to the postgres default database should be safe to assume. |
As a postgres contributor, I would never recommend that any application ignore the configured connection string and connect to the Yes, it's commonly used by utilities, but apps should accept what they are given; they cannot assume the administrator will grant the user they are connecting as the privileges to connect to DBs other than the one specified to the application. An application should run with least privilege. Having to configure the application with access to the When I deploy an application I expect it to use the credentials I supply to connect to the database I give it access to. I will generally have done admin steps first, connecting to an admin db like
... then I just give the application a connection string/URI to connect as Even this gives the app excessive privileges. If possible the application should support being configured with a "database admin connection string" that has database owner rights, for schema migrations etc. It should usually run with a less privileged "user connection string" that has For people who encounter this issue and need to work around the k3s issue, you should be able to grant your k3s user limited rights to the
(The |
The problem is that even if you define the name of the database, k3s v1.28.4+k3s1 onwards only recognizes the "postgres" database. I'm currently using v1.29.0+k3s1 and adjusted it to use the "postgres" database. Even version v1.28.3+k3s1 recognizes the database configuration passed in the K3S_DATASTORE_ENDPOINT variable
In this example "db_k3s" is ignored and considers "postgres"
The text was updated successfully, but these errors were encountered: