Skip to content

Improve Readability of Names #245

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

Merged
merged 10 commits into from
Aug 9, 2021
Merged

Improve Readability of Names #245

merged 10 commits into from
Aug 9, 2021

Conversation

eberlep
Copy link
Collaborator

@eberlep eberlep commented Jul 1, 2021

Now that the ServiceMonitor works, it becomes apparent that only using UUIDs might not be so optimal for actually operating a postgres instance. It is not very convenient (and quite error prone) to select the correct uuid from an endless list of uuids in the monitoring dashboard. Also, finding logs is not so pleasant. It it gets even worse once we enable prometheus-federation and the customers access that data.

By now, we only need the namespace to be unique, so it's creation can stay as is (actually it can even simplified a litte, as it does not need to be a valid dns name aka start with a letter anymore).

So this opens up the possibility to be more playful with the actual teamID and name within the realm of the postgres operator. This proof of concept uses the tenant name as teamid and the teamid+description as the name.

The result looks like this:

NAME                                   TENANT   VERSION   REPLICAS   IP    PORT    STATUS
1e536912-d69a-48e5-99f6-9e4b8e15ead9   xy       12        1                32002   Running
a2fe9f2e-fa85-4168-bd90-76a218c40bf8   Ft       12        1                32000   Running
a47d009d-bcb1-432e-bd0e-fcdeca10f9ba   Ft       12        1                32001   Running

would become

NAMESPACE                               NAME                                         READY   STATUS    RESTARTS   AGE
87d5d11b14cc4518-1e536912d69a48e599f6   pgxy-pgaast01-0                              3/3     Running   0          14m
87d5d11b14cc4518-1e536912d69a48e599f6   postgres-operator-7c45557b9b-qspwq           1/1     Running   0          14m
87d5d11b14cc4518-a2fe9f2efa854168bd90   pgft-psqlt01fitssvct03-0                     3/3     Running   0          15m
87d5d11b14cc4518-a2fe9f2efa854168bd90   postgres-operator-7c45557b9b-bb9qj           1/1     Running   0          15m
87d5d11b14cc4518-a47d009dbcb1432ebd0e   pgft-psqlt02fitssvct03-0                     3/3     Running   0          14m
87d5d11b14cc4518-a47d009dbcb1432ebd0e   postgres-operator-7c45557b9b-46pts           1/1     Running   0          14m

Still not perfect, but hopefully way easier to find in the monitoring dashboard.

As the description is not unique, we should add a part of the ID at the end. Everything is namespaced, so this is technically not neccessary.

We could also consider using project description to make the teamid longer, but we currently do not have access to that description.

Update: Using the description as the database name would also mean that the description can not be edited after postgres creation:

name the name of the cluster. Must start with the teamId followed by a dash. Changing it after the cluster creation is not supported. Required field.

@eberlep eberlep marked this pull request as ready for review August 9, 2021 09:24
@eberlep eberlep merged commit 3ce542d into main Aug 9, 2021
@eberlep eberlep deleted the naming-poc branch September 23, 2021 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant