Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate allowed annotations to Kubernetes recommended syntax #7781

Open
saschagrunert opened this issue Feb 14, 2024 · 9 comments
Open

Migrate allowed annotations to Kubernetes recommended syntax #7781

saschagrunert opened this issue Feb 14, 2024 · 9 comments
Assignees
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/documentation Categorizes issue or PR as related to documentation. kind/feature Categorizes issue or PR as related to a new feature.

Comments

@saschagrunert
Copy link
Member

saschagrunert commented Feb 14, 2024

CRI-O is not following Kubernetes conventions for annotations. See https://kubernetes.io/docs/reference/labels-annotations-taints/ for what actual Kubernetes annotations look like. This means we could either migrate to the new style or solve the issue for future annotations by enforcing conventions (using docs?).

Refers to: #7779, kubernetes/website#45121 (comment)

Migrating the annotations will require a conversion as well as deprecation phase. We did the same some time ago for our metrics, which are still in deprecation:

metricOperations *prometheus.CounterVec // Deprecated: in favour of metricOperationsTotal
metricOperationsLatency *prometheus.GaugeVec // Deprecated: in favour of metricOperationsLatencySeconds
metricOperationsLatencyTotal *prometheus.SummaryVec // Deprecated: in favour of metricOperationsLatencySecondsTotal
metricOperationsErrors *prometheus.CounterVec // Deprecated: in favour of metricOperationsErrorsTotal
metricImagePullsByDigest *prometheus.CounterVec // Deprecated: in favour of metricImagePullsBytesTotal
metricImagePullsByName *prometheus.CounterVec // Deprecated: in favour of metricImagePullsBytesTotal
metricImagePullsByNameSkipped *prometheus.CounterVec // Deprecated: in favour of metricImagePullsSkippedBytesTotal
metricImagePullsFailures *prometheus.CounterVec // Deprecated: in favour of metricImagePullsFailureTotal
metricImagePullsSuccesses *prometheus.CounterVec // Deprecated: in favour of metricImagePullsSuccessTotal
metricImagePullsLayerSize prometheus.Histogram
metricImageLayerReuse *prometheus.CounterVec // Deprecated: in favour of metricImageLayerReuseTotal
metricContainersEventsDropped prometheus.Counter
metricContainersOOMTotal prometheus.Counter
metricContainersOOM *prometheus.CounterVec // Deprecated: in favour of metricContainersOOMCountTotal

@saschagrunert saschagrunert added kind/feature Categorizes issue or PR as related to a new feature. kind/documentation Categorizes issue or PR as related to documentation. labels Feb 14, 2024
@amitamrutiya
Copy link
Contributor

Hey @saschagrunert, Can I work on this issue if it's not urgent? As a beginner with cri-o, I may need some days to fix this issue.

@saschagrunert
Copy link
Member Author

saschagrunert commented Feb 14, 2024

@amitamrutiya2210, yes, but let's wait for consensus with other @cri-o/cri-o-maintainers first before starting to work on this topic.

@haircommander
Copy link
Member

yeah for this one I'd be fine just adding ones that are within style guidelines, marking the others as deprecated. I don't think we need a config field like we did for the metrics.

@kwilczynski
Copy link
Member

/help
/good-first-issue

Copy link
Contributor

openshift-ci bot commented Feb 15, 2024

@kwilczynski:
This request has been marked as suitable for new contributors.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue command.

In response to this:

/help
/good-first-issue

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci openshift-ci bot added good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Feb 15, 2024
@amitamrutiya
Copy link
Contributor

Hello everyone, I'd like to take a shot at resolving this issue.
/assign

@kwilczynski
Copy link
Member

Related:

There is a review comment there that might be useful.

@amitamrutiya
Copy link
Contributor

To deprecate the current annotation, we need to declare new variables with updated annotations. I'm seeking suggestions on the variable naming convention for both deprecated and new annotations.

Here's an approach I've considered for naming the variables:

// UsernsMode is the user namespace mode to use
// Deprecated: in favor of UsernsModeAnnotationV2 
UsernsModeAnnotation = "io.kubernetes.cri-o.userns-mode"

// New: UsernsMode is the user namespace mode to use
UsernsModeAnnotationV2 = "userns-mode.kubernetes.crio-o.io"

This approach is what I've thought of to address this issue. I welcome any suggestions or insights you may have regarding this approach. Your input would be greatly appreciated.

Note: Utilizing this approach would require adding a significant amount of code to ensure functionality is available for both the new and deprecated versions.

@kwilczynski
Copy link
Member

kwilczynski commented May 2, 2024

/assign saschagrunert
/assign haircommander
/assign kwilczynski

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/documentation Categorizes issue or PR as related to documentation. kind/feature Categorizes issue or PR as related to a new feature.
Projects
Status: To do
Development

No branches or pull requests

4 participants