Skip to content

Commit 096a020

Browse files
committed
Address review feedback
1 parent 4070520 commit 096a020

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

docs/proposals/control-plane-config.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ limited to, log level, tracing, or metrics. For the best user experience, these
2525
changed at runtime, to avoid having to restart NKG. The first option that we will allow users to configure is the
2626
log level. The easiest and most intuitive way to implement a Kubernetes-native API is through a CRD.
2727

28+
In this doc, the term "user" will refer to the cluster operator (the person who installs and manages NKG). The
29+
cluster operator owns this CRD resource.
30+
2831
## API, Customer Driven Interfaces, and User Experience
2932

3033
The API would be provided in a CRD. An authorized user would interact with this CRD using `kubectl` to `get`
@@ -33,20 +36,24 @@ or `edit` the configuration.
3336
Proposed configuration CRD example:
3437

3538
```yaml
36-
apiVersion: nginx.gateway.k8s.io/v1beta1
39+
apiVersion: nginx.gateway.k8s.io/v1alpha1
3740
kind: NGINXControlConfig
3841
metadata:
3942
name: nkg-config
4043
namespace: nginx-gateway
4144
spec:
42-
logLevel: info
45+
log:
46+
level: info
47+
...
48+
status:
4349
...
4450
```
4551
4652
- The CRD would be Namespace-scoped, living in the same Namespace as the controller that it applies to.
47-
- CRD is initialized and created when NKG is deployed
48-
- NKG references the name of this CRD via CLI arg, and only watches this CRD
49-
- If user deletes resource, NKG logs an error and creates an event. Last state is used until CRD is restored.
53+
- CRD is initialized and created when NKG is deployed.
54+
- NKG references the name of this CRD via CLI arg, and only watches this CRD. If the resource doesn't exist,
55+
then an error is logged and event created, and default values are used.
56+
- If user deletes resource, NKG logs an error and creates an event. NKG will revert to default values.
5057
5158
For discussion with team:
5259
@@ -79,7 +86,8 @@ be similar in behavior as the current unit tests that verify Gateway API resourc
7986
We need to ensure that any configurable fields that are exposed to a user are:
8087
8188
- Properly validated. This means that the fields should be the correct type (integer, string, etc.), have appropriate
82-
length, and use regex patterns or enums to prevent any unwanted input.
89+
length, and use regex patterns or enums to prevent any unwanted input. This will initially be done through
90+
OpenAPI schema validation. If necessary as the CRD evolves, CEL or webhooks could be used.
8391
- Have a valid use case. The more fields we expose, the more attack vectors we create. We should only be exposing
8492
fields that are genuinely useful for a user to change dynamically.
8593

0 commit comments

Comments
 (0)