@@ -67,26 +67,34 @@ Validation Webhook
67
67
~~~~~~~~~~~~~~~~~~
68
68
69
69
The |k8s-op-short| uses a webhook to prevent users from applying invalid
70
- resource definitions. The webhook rejects creating and updating replica
71
- sets in the following scenarios:
72
-
73
- - :setting:`spec.connectivity.replicaSetHorizons` is set, but
74
- :setting:`spec.security.tls.enabled` is ``false`` or not set
75
- - :setting:`spec.connectivity.replicaSetHorizons` has a number of
76
- horizons configured that is not equal to the number of members set in
77
- :setting:`spec.members`
78
-
79
- The webhook rejects these requests immediately and the |k8s-op-short|
80
- doesn't create or update the resource.
70
+ resource definitions. The webhook rejects these requests immediately and
71
+ the |k8s-op-short| doesn't create or update the resource.
81
72
82
73
The ``ClusterRole`` and ``ClusterRoleBinding`` for the webhook are
83
74
included in the default configuration files that you apply during
84
75
installation. To create the role and binding, you must have
85
76
:k8sdocs:`cluster-admin privileges
86
- </reference/access-authn-authz/rbac/#user-facing-roles>` . If you have
87
- insufficient privileges or if you choose to remove the role and binding
88
- from the default configuration, the |k8s-op-short| produces error logs
89
- and continues to function normally, but without validation rejections.
77
+ </reference/access-authn-authz/rbac/#user-facing-roles>`.
78
+
79
+ If you apply an invalid resource definition, the webhook returns
80
+ a message that describes the error to the shell:
81
+
82
+ .. code-block:: none
83
+
84
+ Error from server (shardPodSpec field is not configurable for
85
+ application databases as it is for sharded clusters and appdbs are
86
+ replica sets): error when creating "my-ops-manager.yaml":
87
+ admission webhook "ompolicy.mongodb.com" denied the request:
88
+ shardPodSpec field is not configurable for application databases as
89
+ it is for sharded clusters and appdbs are replica sets
90
+
91
+ The validation webhook is not required to create or update resources. If
92
+ you omit the validation webhook, remove its role and binding from the
93
+ default configuration, or have insufficient privileges to run it, the
94
+ |k8s-op-short| performs the same validations when it reconciles each
95
+ resource. The |k8s-op-short| marks resources as ``Failed`` if validation
96
+ encounters a critical error. For non-critical errors, the |k8s-op-short|
97
+ issues warnings.
90
98
91
99
.. _k8s-deployment-scopes:
92
100
0 commit comments