Skip to content

Commit f583d71

Browse files
committed
📖 add some simple API docs.
1 parent 088a3b8 commit f583d71

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

‎README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,24 @@ spec:
2929
3030
This will automatically run migrations on all future deployment changes.
3131
32+
### API
33+
34+
There's one API object, the [Migrator](https://github.com/coderanger/migrations-operator/blob/main/api/v1beta1/migrator_types.go),
35+
with these fields:
36+
37+
- selector: [LabelSelector](https://v1-18.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#labelselector-v1-meta)
38+
for which pods to watch to trigger an upgrade action.
39+
- templateSelector: optional
40+
[LabelSelector](https://v1-18.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#labelselector-v1-meta) for which
41+
specific pod, selected by `selector`, to use as a template for building the upgrade Job.
42+
- command: optional string array which will be used as the upgrade Job's `command`.
43+
- args: optional string array to be used as the upgrade Job's `args`.
44+
- image: optional image to use for the upgrade Job.
45+
- container: optional name of a container from the selected template Pod. The selected container will be used to run the upgrader.
46+
47+
The migrator Job will contain only a single container and no initContainers. Any livenessProbes and readinessProbes in the
48+
template will be ignored.
49+
3250
## How It Works
3351

3452
The operator has three main components: the migrations controller, the waiter init container, and the injector webhook. The migrations controller watches for new pods matching its selector and if they are running a new image, it launches a Job to run the migrations as configured. The waiter init container stalls a pod from fully launching until the required migrations have been executed successfully. The injector webhook automatically adds the waiter init container to any pod that matches a Migrator object.

0 commit comments

Comments
 (0)