Manual Resource Configuration
Overview
The ignore-diff
feature in the Hydrolix operator prevents manual changes in Kubernetes resources from being reverted by the operator. It works with all Kubernetes resources managed by the Hydrolix operator. Enable it by adding the hydrolix.io/ignore-diff=true
annotation to specific Kubernetes resources.
With this feature:
-
Annotated resources are ignored by the operator during reconciliation if manual changes are detected.
-
The operator logs an informational message indicating the resource has been ignored:
hkt.k8s.resourcegroup [INFO] Ignoring changes in <resource-type>/<resource-name>. Reason: hydrolix.io/ignore-diff annotation present.
-
Changes to the
Hydrolixcluster
custom resource that would normally affect the ignored file will not be applied until theignore-diff=true
annotation is removed. -
If the annotation is removed, the operator resumes management of the resource and reconciles it to match the original configuration.
-
Resources without the annotation remain under the operator’s full management.
Annotating and Removing Annotations from Resources
To use the ignore-diff
feature, annotate or remove annotations from Kubernetes resources using kubectl
.
Adding an Annotation
Add the hydrolix.io/ignore-diff
annotation to a resource:
kubectl annotate <resource-type> <resource-name> "hydrolix.io/ignore-diff"="true"
Example for a ConfigMap:
kubectl annotate configmap prometheus-cfg "hydrolix.io/ignore-diff"="true"
Removing an Annotation
Remove the annotation with either of these two options:
-
Overwrite the Annotation
Replace the annotation value with
"false"
:kubectl annotate <resource-type> <resource-name> "hydrolix.io/ignore-diff"="false" --overwrite
Example for a ConfigMap:
kubectl annotate configmap prometheus-cfg "hydrolix.io/ignore-diff"="false" --overwrite
-
Manually Remove the Annotation
Edit the resource to delete the annotation:
kubectl edit <resource-type> <resource-name>
Locate and remove the
hydrolix.io/ignore-diff
annotation from the resource’s metadata section. Save and exit the editor.After removing the annotation, the operator will detect the change during the next reconciliation and resume managing the resource, resetting it to its original state if needed.
Updated 1 day ago