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

[K8s] Generate migration_services.yaml from ConfigMaps #1307

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

lewijacn
Copy link
Collaborator

Description

This change removes the static migration_services.yaml we were using temporarily for K8s to now utilize the groundwork we had in the K8s config map utils library for generating this file from ConfigMap values.

Note: While several attempts were made to keep the existing /etc/migration_services.yaml path on the Migration Console container, K8s does not seem to make it easy to mount only a single file like was done with the Docker compose setup, but rather requires a good bit of misdirection which I didn't want to cause more complexity here. The new path that is utilized here is /config/migration_services.yaml with the entire config directory being mounted on the Migration Console container.

Issues Resolved

https://opensearch.atlassian.net/browse/MIGRATIONS-2383

Testing

Python unit tests
Local K8s testing

Check List

  • New functionality includes testing
  • Public documentation issue/PR created, if applicable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Tanner Lewis <lewijacn@amazon.com>
Signed-off-by: Tanner Lewis <lewijacn@amazon.com>
Signed-off-by: Tanner Lewis <lewijacn@amazon.com>
… container to main container

Signed-off-by: Tanner Lewis <lewijacn@amazon.com>
Signed-off-by: Tanner Lewis <lewijacn@amazon.com>
Signed-off-by: Tanner Lewis <lewijacn@amazon.com>
Signed-off-by: Tanner Lewis <lewijacn@amazon.com>
Signed-off-by: Tanner Lewis <lewijacn@amazon.com>
Signed-off-by: Tanner Lewis <lewijacn@amazon.com>
Signed-off-by: Tanner Lewis <lewijacn@amazon.com>
Signed-off-by: Tanner Lewis <lewijacn@amazon.com>
# Conflicts:
#	TrafficCapture/dockerSolution/src/main/docker/migrationConsole/Dockerfile
#	deployment/k8s/charts/aggregates/migrationAssistant/values.yaml
#	deployment/k8s/charts/components/migrationConsole/migration_services.yaml
#	deployment/k8s/charts/components/migrationConsole/templates/deployment.yaml
#	deployment/k8s/minikubeLocal.sh
#	deployment/k8s/update_deps.sh
Signed-off-by: Tanner Lewis <lewijacn@amazon.com>
Signed-off-by: Tanner Lewis <lewijacn@amazon.com>
Signed-off-by: Tanner Lewis <lewijacn@amazon.com>
Signed-off-by: Tanner Lewis <lewijacn@amazon.com>
Signed-off-by: Tanner Lewis <lewijacn@amazon.com>
Signed-off-by: Tanner Lewis <lewijacn@amazon.com>
Signed-off-by: Tanner Lewis <lewijacn@amazon.com>
Copy link

codecov bot commented Feb 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.33%. Comparing base (3ed5c60) to head (407f2f1).
Report is 13 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1307      +/-   ##
============================================
- Coverage     79.36%   79.33%   -0.04%     
- Complexity     3184     3196      +12     
============================================
  Files           438      444       +6     
  Lines         16403    16874     +471     
  Branches       1114     1117       +3     
============================================
+ Hits          13019    13387     +368     
- Misses         2709     2814     +105     
+ Partials        675      673       -2     
Flag Coverage Δ
unittests 79.33% <ø> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lewijacn lewijacn marked this pull request as ready for review February 26, 2025 04:04
Signed-off-by: Tanner Lewis <lewijacn@amazon.com>

[report]
omit =
*/tests/*
Copy link
Member

Choose a reason for hiding this comment

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

Nit: I like seeing test coverage information, makes it really clear when tests are disabled or we've got extraneous logic that should be reviewed

@@ -248,6 +249,7 @@ jobs:
--exclude "https://localhost*"
--exclude "http://capture-proxy*"
--exclude "https://capture-proxy*"
--exclude-path "TrafficCapture/dockerSolution/src/main/docker/k8sConfigMapUtilScripts/tests/data"
Copy link
Member

Choose a reason for hiding this comment

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

Could we instead add the k8 urls that are common to the project like the above that we have so we can be sure we are using valid urls save for really specific items?

@@ -0,0 +1,33 @@
# Kubernetes Config Map Utility Library

This library provides utilities for working with Kubernetes ConfigMaps and specifically generating a `migration_services.yaml` usable by the Migration Console from ConfigMap values
Copy link
Member

Choose a reason for hiding this comment

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

Could you provide more details on where/how those ConfigMap values are set?

@@ -0,0 +1,33 @@
# Kubernetes Config Map Utility Library

Copy link
Member

Choose a reason for hiding this comment

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

Whats the lifecycle of this tool, it looks like it should be turned on and it watches for changes, or should it be triggered on /off by something?

@@ -23,17 +23,17 @@ start() {
helm repo add strimzi https://strimzi.io/charts/

minikube start
minikube mount .:/opensearch-migrations > /dev/null 2>&1 &
#minikube mount .:/opensearch-migrations > /dev/null 2>&1 &
Copy link
Member

Choose a reason for hiding this comment

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

Remove these commented out lines?

condition: conditionalPackageInstalls.jaeger
version: "3.2.0"
repository: "https://jaegertracing.github.io/helm-charts"
# - name: grafana
Copy link
Member

Choose a reason for hiding this comment

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

Test change?

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.

2 participants