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
Copy file name to clipboardExpand all lines: content/atlas-operator/upcoming/source/ak8so-dry-run.txt
+91-6Lines changed: 91 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -23,10 +23,10 @@ Prerequisites
23
23
24
24
In order to use the |ak8so| Dry Run feature, you need to:
25
25
26
-
- Have access to a **new Kubernetes or Open Shift {+cluster+}**.
27
-
- Apply |ak8so| custom resources to your **new Kubernetes {+cluster+}**.
26
+
- Have access to a **new Kubernetes or OpenShift cluster**.
27
+
- Apply |ak8so| custom resources to your **new Kubernetes cluster**.
28
28
When you apply your resources, make sure you provide a `secret with credentials <https://www.mongodb.com/docs/atlas/operator/stable/ak8so-quick-start/#create-a-secret-with-your-api-keys-and-organization-id>`__.
29
-
You need a new {+cluster+}, because upgrading CRDs on your existing |k8s| {+cluster+}
29
+
You need a new cluster, because upgrading CRDs on your existing |k8s| cluster
30
30
might leave |ak8so| unable to reconcile existing custom resources. Moreover,
31
31
the CRDs that are applied can be a newer version with potential breaking changes.
32
32
@@ -37,8 +37,8 @@ In order to use the |ak8so| Dry Run feature, you need to:
37
37
need to deploy a new |k8s| cluster (possibly a temporary cluster) to
38
38
execute the dry run.
39
39
40
-
- Install CRDs to your {+cluster+} for the version of the |ak8so| you want to execute dry-run for.
41
-
- Create a ``mongodb-atlas-operator`` service account in your |k8s| {+cluster+}.
40
+
- Install CRDs to your cluster for the version of the |ak8so| you want to execute dry-run for.
41
+
- Create a ``mongodb-atlas-operator`` service account in your |k8s| cluster.
42
42
- Create a `role <https://github.com/mongodb/mongodb-atlas-kubernetes/blob/main/config/rbac/clusterwide/role.yaml>`__
43
43
and `rolebinding <https://github.com/mongodb/mongodb-atlas-kubernetes/blob/main/config/rbac/clusterwide/role_binding.yaml>`__
44
44
for your `service account <https://github.com/mongodb/mongodb-atlas-kubernetes/blob/main/config/rbac/service_account.yaml>`__
@@ -87,7 +87,7 @@ Procedure
87
87
.. step:: Apply the following |k8s| Job.
88
88
89
89
Save the following example in a file called ``dry-run-job.yaml``
90
-
and apply it to your {+cluster+} by running ``kubectl apply -f dry-run-job.yaml``.
90
+
and apply it to your cluster by running ``kubectl apply -f dry-run-job.yaml``.
91
91
This will start |ak8so| as a |k8s| Job with the ``--dry-run`` parameter.
92
92
Every reconciliation in the |ak8so| will run only once, emitting
93
93
events for each resource if there are changes between the resource
@@ -161,3 +161,88 @@ Procedure
161
161
LAST SEEN TYPE REASON OBJECT MESSAGE
162
162
103s Normal DryRun atlasproject/my-project Would delete (DELETE) /api/atlas/v1.0/groups/6558f184beba40022cbb2043/integrations/SLACK
163
163
101s Warning DryRun atlasproject/my-project finished dry run
164
+
165
+
166
+
Log Resource Diffs
167
+
------------------
168
+
169
+
When ``--log-level`` is set to ``debug``, the |ak8so| provides a detailed diff of
170
+
the changes that you make to |service| resources that are managed by the |ak8so|.
171
+
This diff is particularly useful when used in conjunction with the Dry Run
172
+
feature, as it allows you to see the differences between the current state of
173
+
your |ak8so| custom resources and the state that the |ak8so| would apply to your
174
+
|service| environment.
175
+
176
+
This diff feature is informed by comparing the result of any PUT or PATCH
177
+
requests sent to |service| with the current state of the |ak8so|
178
+
custom resources in your |service| environment.
179
+
180
+
.. note::
181
+
182
+
To facilitate this comparison, the |ak8so| makes a GET request to |service| to
183
+
learn the current state of resources in |service|. As such, we recommend
184
+
that you only set the log level to debug in non-production environments,
185
+
as this feature can increase the load on |service|.
186
+
187
+
To see the differences, you need to set the ``--log-level=debug`` flag when
188
+
running the |ak8so| command. Because the |ak8so| uses structured
189
+
logging, we recommend analyzing the JSON diff in a structured logging viewer
190
+
for better human readability. The following example shows a rendered |ak8so|
191
+
``DEBUG`` log line in YAML format, as displayed in a structured logging viewer:
0 commit comments