You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1.[Example 3: Use database objects and migrations of Registry](#example-3-use-database-objects-and-migrations-of-registry)
13
+
1.[Example 4: Parametrized database objects resource for Rails](#example-4-parameterized-database-objects-resource-for-rails)
14
14
1.[Level 3](#level-3)
15
15
1.[Level 4](#level-4)
16
16
1.[Considerations](#considerations)
17
17
1.[Bridge the gap](#bridge-the-gap)
18
-
1.[Reorganize the existing database operations](#reorganize-the-existing-database-operations)
19
-
1.[Support dedicated PgBouncer user for databases](#support-dedicated-pgbouncer-user-for-databases)
20
-
1.[Delay the population of PgBouncer database configuration](#delay-the-population-of-pgbouncer-database-configuration)
21
-
1.[Configurable Consul watch for databases](#configurable-consul-watch-for-databases)
22
-
1.[Helper class for general database migration requirements](#helper-class-for-general-database-migration-requirements)
18
+
1.[Reorganize the existing database operations](#reorganize-the-existing-database-operations)
19
+
1.[Support dedicated PgBouncer user for databases](#support-dedicated-pgbouncer-user-for-databases)
20
+
1.[Delay the population of PgBouncer database configuration](#delay-the-population-of-pgbouncer-database-configuration)
21
+
1.[Configurable Consul watch for databases](#configurable-consul-watch-for-databases)
22
+
1.[Helper class for general database migration requirements](#helper-class-for-general-database-migration-requirements)
23
23
24
24
## Level 1
25
25
26
-
1. Add the new database-related configuration attributes to `gitlab.rb`. Do
27
-
not forget to update `gitlab.rb.template`.
28
-
1. Update the Chef recipe to consume the configuration attributes. At this
29
-
level, the requirement is to pass down the attributes to the component,
30
-
generally its through configuration files or command-line arguments.
26
+
1. Add the new database-related configuration attributes to `gitlab.rb`. Do
27
+
not forget to update `gitlab.rb.template`.
28
+
1. Update the Chef recipe to consume the configuration attributes. At this
29
+
level, the requirement is to pass down the attributes to the component,
30
+
generally its through configuration files or command-line arguments.
31
31
32
32
For example in `registry` cookbook:
33
33
34
34
-`registry['database']` attribute is added to `gitlab.rb` (see [`attributes/default.rb`](https://gitlab.com/gitlab-org/omnibus-gitlab/-/blob/565f7a73f721fa40efc936dfd735b849986ce0ac/files/gitlab-cookbooks/registry/attributes/default.rb#L39)).
35
-
36
35
- The configuration template uses the attribute to configure registry (see [`templates/default/registry-config.yml.erb`](https://gitlab.com/gitlab-org/omnibus-gitlab/-/blob/565f7a73f721fa40efc936dfd735b849986ce0ac/files/gitlab-cookbooks/registry/templates/default/registry-config.yml.erb#L47)).
37
36
38
37
## Level 2
@@ -43,10 +42,10 @@ For example in `registry` cookbook:
43
42
44
43
1. Create a `database_objects` custom resource in `resources/` directory of the
45
44
cookbook with the default `nothing` action (a no-op action) and a `create`
46
-
action. The `create`action can leverage the existing `postgresql` custom
45
+
action. The `create` action can leverage the existing `postgresql` custom
47
46
resources to setup the required database objects for the component.
48
47
49
-
See:
48
+
See:
50
49
-`postgresql_user`
51
50
-`postgresql_database`
52
51
-`postgresql_schema`
@@ -329,13 +328,13 @@ end
329
328
is enabled) or the name of the Consul service that is configured manually
330
329
without Omnibus GitLab.
331
330
332
-
1. Use `database_watch` custom resource<sup>[[Needs Implementation](#configurable-consul-watch-for-databases)]</sup>
331
+
1. Use `database_watch` custom resource<sup>([Needs Implementation](#configurable-consul-watch-for-databases))</sup>
333
332
to define a new Consul watch for the database cluster service. It notifies
334
333
PgBouncer to update the logical database endpoint when the leader of the
335
334
cluster changes. Pass the name of the Consul service, logical database, and
336
335
any other PgBouncer options as parameters to the watch.
337
336
338
-
_All`database_watch`resources must be placed in the`consul`cookbook_. As
337
+
_All_`database_watch`_resources must be placed in the_`consul`_cookbook_. As
339
338
opposed to the previous levels, this is the only place where database-related
340
339
resources are concentrated in one cookbook, `consul`, and not managed in
341
340
the same cookbooks as their associated components.
@@ -351,13 +350,13 @@ We don't want to introduce any breaking changes into `gitlab.rb`.
351
350
-_No other resource should be involved with database setup_.
352
351
353
352
- All custom resources _must be idempotent_. For example they must not fail
354
-
when an object already exist even though they are created or ran in another
355
-
cookbook. Instead they must be able to update the current state of the
356
-
database objects, configuration, or migrations based on the new user inputs.
353
+
when an object already exist even though they are created or ran in another
354
+
cookbook. Instead they must be able to update the current state of the
355
+
database objects, configuration, or migrations based on the new user inputs.
357
356
358
357
- In HA mode, given that multiple physical nodes are involved, Omnibus GitLab
359
-
may encounter certain limitations to provide full automation of the
360
-
configuration. This is an acceptable limitation.
358
+
may encounter certain limitations to provide full automation of the
359
+
configuration. This is an acceptable limitation.
361
360
362
361
## Bridge the gap
363
362
@@ -441,16 +440,16 @@ cookbook. It defines a database-specific Consul watch for database a cluster
441
440
service and passes the required information to a parameterized failover script
442
441
to notify PgBouncer. The key attributes of this resource are:
443
442
444
-
1. The service name, that specifies which database cluster must be watched.
445
-
It could be the scope of the Patroni cluster when `patroni['register_service']`
446
-
is enabled or a Consul service name when it is manually configured.
443
+
1. The service name, that specifies which database cluster must be watched.
444
+
It could be the scope of the Patroni cluster when `patroni['register_service']`
445
+
is enabled or a Consul service name when it is manually configured.
447
446
448
-
1. The database name that specifies which logical databases should be
449
-
reconfigured when the database cluster leader changes.
447
+
1. The database name that specifies which logical databases should be
448
+
reconfigured when the database cluster leader changes.
450
449
451
450
### Helper class for general database migration requirements
452
451
453
-
`MigrationHelper`<sup>[Needs implementation]</sup> implements general
452
+
`MigrationHelper`<sup>(Needs implementation)</sup> implements general
454
453
requirements of database migrations, including the central switch for enabling
455
454
or disabling auto-migrations. It can also provides the mapping between the
0 commit comments