@@ -351,6 +351,17 @@ const (
351
351
352
352
Here, ` StorageMedium ` can have infinite number of possible values, which disqualify it as an enum type.
353
353
354
+ The parser of Go compiler and, as a result, ` gengo ` , does not support type aliases. See https://github.com/kubernetes/gengo/issues/224 for details.
355
+ As of Kubernetes 1.23, we do not have any type aliases in kubernetes/kubernetes repo. Any attempt to add aliases would break the code generation.
356
+ Example: https://github.com/kubernetes/kubernetes/pull/106300
357
+
358
+ However, as of 1.23, the enum marker is the only marker to be added to a type declaration, and would be the first marker to be affected.
359
+ Until there is a fix to ` gengo ` , the enum generator has the following limitations:
360
+ - the enum marker must not be added to aliases
361
+ - an aliased enum type or value SHOULD NOT have comments. Otherwise, the comments will be squashed with these of the original with undefined ordering.
362
+
363
+ If the fix to ` gengo ` does not arrive in this release cycle, detection and enforcement the rules above will be added to the ` verify-*.sh ` scripts.
364
+
354
365
### Risks and Mitigations
355
366
356
367
<!--
@@ -522,12 +533,6 @@ Pick one of these and delete the rest.
522
533
- [X] Feature gate (also fill in values in ` kep.yaml ` )
523
534
- Feature gate name: ` OpenAPIEnum `
524
535
- Components depending on the feature gate: ` kube-apiserver `
525
- - [ ] Other
526
- - Describe the mechanism:
527
- - Will enabling / disabling the feature require downtime of the control
528
- plane?
529
- - Will enabling / disabling the feature require downtime or reprovisioning
530
- of a node? (Do not assume ` Dynamic Kubelet Config ` feature is enabled).
531
536
532
537
###### Does enabling the feature change any default behavior?
533
538
@@ -580,13 +585,18 @@ feature flags will be enabled on some API servers and not others during the
580
585
rollout. Similarly, consider large clusters and how enablement/disablement
581
586
will rollout across nodes.
582
587
-->
588
+ If the API-server has multiple replicas, with some instances not yet enabling this feature,
589
+ whether the returned OpenAPI Spec contains enum types will depend on which instance handle the request
590
+ which could result in inconsistent responses for the same request.
583
591
584
592
###### What specific metrics should inform a rollback?
585
593
586
594
<!--
587
595
What signals should users be paying attention to when the feature is young
588
596
that might indicate a serious problem?
589
597
-->
598
+ Standard API Server metrics apply to this feature. For example, when
599
+ ` apiserver_request_duration_seconds ` is too high for ` /openapi ` endpoints.
590
600
591
601
###### Were upgrade and rollback tested? Was the upgrade->downgrade->upgrade path tested?
592
602
@@ -596,12 +606,15 @@ Longer term, we may want to require automated upgrade/rollback tests, but we
596
606
are missing a bunch of machinery and tooling and can't do that now.
597
607
-->
598
608
609
+ Enabling, disabling, and re-enabling the feature gate yields expected outcomes.
599
610
###### Is the rollout accompanied by any deprecations and/or removals of features, APIs, fields of API types, flags, etc.?
600
611
601
612
<!--
602
613
Even if applying deprecation policies, they may still surprise some users.
603
614
-->
604
615
616
+ No.
617
+
605
618
### Monitoring Requirements
606
619
607
620
<!--
@@ -615,7 +628,7 @@ Ideally, this should be a metric. Operations against the Kubernetes API (e.g.,
615
628
checking if there are objects with field X set) may be a last resort. Avoid
616
629
logs or events for this purpose.
617
630
-->
618
-
631
+ N/A. Workloads that query the OpenAPI specs automatically use this feature if enabled.
619
632
###### How can someone using this feature know that it is working for their instance?
620
633
621
634
<!--
@@ -627,13 +640,8 @@ and operation of this feature.
627
640
Recall that end users cannot usually observe component logs or access metrics.
628
641
-->
629
642
630
- - [ ] Events
631
- - Event Reason:
632
- - [ ] API .status
633
- - Condition name:
634
- - Other field:
635
- - [ ] Other (treat as last resort)
636
- - Details:
643
+ - [X] Other (treat as last resort)
644
+ - Details: the returned OpenAPI Spec contains enum types.
637
645
638
646
###### What are the reasonable SLOs (Service Level Objectives) for the enhancement?
639
647
@@ -651,19 +659,17 @@ high level (needs more precise definitions) those may be things like:
651
659
These goals will help you determine what you need to measure (SLIs) in the next
652
660
question.
653
661
-->
662
+ This feature does not affect the SLO of API Server or any other components.
654
663
655
664
###### What are the SLIs (Service Level Indicators) an operator can use to determine the health of the service?
656
665
657
666
<!--
658
667
Pick one more of these and delete the rest.
659
668
-->
660
669
661
- - [ ] Metrics
662
- - Metric name:
663
- - [ Optional] Aggregation method:
664
- - Components exposing the metric:
665
- - [ ] Other (treat as last resort)
666
- - Details:
670
+ - [X] Metrics
671
+ - Metric name: apiserver_request_duration_seconds
672
+ - Components exposing the metric: kube-api-server
667
673
668
674
###### Are there any missing metrics that would be useful to have to improve observability of this feature?
669
675
@@ -695,6 +701,11 @@ and creating new ones, as well as about cluster-level services (e.g. DNS):
695
701
- Impact of its degraded performance or high-error rates on the feature:
696
702
-->
697
703
704
+ - ` kube-apiserver `
705
+ - Usage description:
706
+ - Impact of its outage on the feature: The ` /openapi ` endpoint is unavailable
707
+ - Impact of its degraded performance or high-error rates on the feature: The ` /openapi ` endpoint is degraded.
708
+
698
709
### Scalability
699
710
700
711
<!--
@@ -784,6 +795,7 @@ details). For now, we leave it here.
784
795
-->
785
796
786
797
###### How does this feature react if the API server and/or etcd is unavailable?
798
+ This feature is part of API server. The feature is unavailable if API server is unavailable.
787
799
788
800
###### What are other known failure modes?
789
801
@@ -799,9 +811,12 @@ For each of them, fill in the following information by copying the below templat
799
811
Not required until feature graduated to beta.
800
812
- Testing: Are there any tests for failure mode? If not, describe why.
801
813
-->
814
+ N/A. This feature fails if and only if the API Server becomes unavailable.
802
815
803
816
###### What steps should be taken if SLOs are not being met to determine the problem?
804
817
818
+ N/A. This feature fails if and only if the API Server becomes unavailable.
819
+
805
820
## Implementation History
806
821
807
822
<!--
@@ -815,6 +830,11 @@ Major milestones might include:
815
830
- when the KEP was retired or superseded
816
831
-->
817
832
833
+ - 09-09-2021 ` Summary ` and ` Motivation ` sections being merged, signaling SIG acceptance
834
+ - 09-09-2021 ` Proposal ` section being merged, signaling agreement on a proposed design
835
+ - 09-14-2021 Enum type generator merged as ` kubernetes/kube-openapi#242 `
836
+ - 11-16-2021 Enum type support for OpenAPI v2 merged as #105057
837
+
818
838
## Drawbacks
819
839
820
840
<!--
0 commit comments