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

Ingress removal storage svc #224

Merged
merged 110 commits into from
Apr 7, 2023
Merged

Ingress removal storage svc #224

merged 110 commits into from
Apr 7, 2023

Conversation

IsaiasA1
Copy link
Contributor

@IsaiasA1 IsaiasA1 commented Apr 3, 2023

Description

This PR removes the storage-service ingress from the RPM, adds storage-service handlers to the proxy-server, updates karavictl to connect to the proxy-server instead of the storage-service, and adds telemetry updates.

Proxy-Server changes:

New service handler at internal/proxy/service_handler.go to handle these paths for karavictl:

POST /proxy/storage/ (create storage, storage info is in request body)
PATCH /proxy/storage/ (update storage, storage info is in request body)
GET /proxy/storage/ (list or get storage, storage name is in query parameter)
PATCH /proxy/storage/ (storage info is in request body)
The handlers for each path will parse the request and make the appropriate grpc request to the storage service.

Adds grpc connection interceptors which will automatically create tracing spans for grpc client requests.

New http middleware called TelemetryMW. This will log the time taken for the next handler to complete and record the error in the span. The telemetry will happen only if the next handler is the type HandlerWithError. This handler returns an error specifically for recording in the span.

type HandlerWithError func(w http.ResponseWriter, r *http.Request) error

karavictl changes:

karavictl commands that previously connected to the storage-service via grpc now connect to the proxy-server via https
New file cmd/karavictl/cmd/api/api.go which is a generic http client inspired by https://github.com/dell/goscaleio/blob/main/api/api.go
karavictl will build this generic http client and execute the appropriate request
Storage-service changes:

Adds grpc server interceptors which will automatically create tracing spans for incoming requests.
Adds telemetry middleware at internal/storage-service/middleware/storage_telemetry.go to log the time taken for the request, log request info, and set the request info in the span

Most if not all code is similar to Tenant-service changes made by Aaron Tye

GitHub Issues

List the GitHub issues impacted by this PR:

GitHub Issue #
dell/csm#725

Checklist:

  • I have performed a self-review of my own code to ensure there are no formatting, vetting, linting, or security issues
  • I have verified that new and existing unit tests pass locally with my changes
  • I have not allowed coverage numbers to degenerate
  • I have maintained at least 90% code coverage
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • Backward compatibility is not broken

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration

Powerflex E2E Test, and manual test (Containerized, RPM, and CSM-Operator)

cmd.Execute()

if !gotCalled {
t.Error("expected DeleteTenant to be called, but it wasn't")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it DeleteTenant to be called? Also the gotCalled was set to true anyways from the beginning?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, also noticed this on other karavictl test and updated the error logs

alikdell
alikdell previously approved these changes Apr 6, 2023
@@ -0,0 +1,127 @@
package middleware
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy Right headers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

alikdell
alikdell previously approved these changes Apr 7, 2023
cfg Config
)

// Config is the configuration details on the tenant-service
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this config say its for storage service?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -0,0 +1,79 @@
// Copyright © 2021-2023 Dell Inc., or its subsidiaries. All Rights Reserved.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need a range here if this file was just added

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@IsaiasA1 IsaiasA1 requested review from alikdell and xuluna April 7, 2023 14:04
alikdell
alikdell previously approved these changes Apr 7, 2023
@IsaiasA1 IsaiasA1 merged commit 974c298 into main Apr 7, 2023
@IsaiasA1 IsaiasA1 deleted the Ingress-removal-storage-svc branch April 7, 2023 20:50
@dell dell deleted a comment from IsaiasA1 Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants