konveyor / move2kube

Move2Kube is a command-line tool for automating creation of Infrastructure as code (IaC) artifacts. It has inbuilt support for creating IaC artifacts for replatforming to Kubernetes/Openshift.
https://move2kube.konveyor.io/
Apache License 2.0
383 stars 118 forks source link

Add collector for Amazon ECS and Azure Container Service #43

Open ashokponkumar opened 3 years ago

ashokponkumar commented 3 years ago

Move2Kube collectors which can be invoked using move2kube collect help extract runtime information.

To allow translation from Amazon ECS and Azure Container Service, similar to how we have structured for Cloud Foundry in here (https://github.com/konveyor/move2kube/blob/master/internal/collector/cfappscollector.go).

We can write a collector which will access the running container instances, and extract metadata out of it and serialize it in a format similar to https://github.com/konveyor/move2kube/blob/master/types/collection/cfinstanceapps.go.

Requirements:

  1. Access to Amazon ECS or Azure Container Service

Tasks involved:

  1. Create a serialization format similar to https://github.com/konveyor/move2kube/blob/master/types/collection/cfinstanceapps.go
  2. Write a collector to access the runtime using api and serialize the data similar to https://github.com/konveyor/move2kube/blob/master/internal/collector/cfappscollector.go
akhil-ghatiki commented 3 years ago

@ashokponkumar I would like to take up this issue. I need more inputs though. Will keep you updated on this.

ashokponkumar commented 3 years ago

sure @akhil-ghatiki . Please reach out if you have more questions. The first task we could start with is the api to access ECS or ACS and how to use a go to fetch metadata about running instances.

akhil-ghatiki commented 3 years ago

sure @akhil-ghatiki . Please reach out if you have more questions. The first task we could start with is the api to access ECS or ACS and how to use a go to fetch metadata about running instances.

@ashokponkumar is there any such api used for cf instances ? I can use it for reference.

ashokponkumar commented 3 years ago

https://github.com/konveyor/move2kube/blob/master/internal/collector/cfappscollector.go uses "cf curl /v2/apps" commands.

For ECS, look for ways to list all running instances, and then get metadata like image names etc.

  1. https://docs.aws.amazon.com/cli/latest/reference/ecs/

For Azure Containers, possibly https://docs.microsoft.com/en-us/cli/azure/container?view=azure-cli-latest