Giter Club home page Giter Club logo

hydrate's Introduction

Hydrate

Build Status

Hydrate crawls a kubernetes cluster and generates a high level description of your deployments.

Setup

Ensure you are using Python 3.6 or a newer version. Include a "kubeconfig" file for your cluster in the same directory as hydrate.py, or specify one with the -k argument. Finally, install the dependencies.

pip install -r requirements.txt

Basic Usage

python -m hydrate [-h] [-n NAME] [-k FILE] [-o PATH] [-v] [-d] [-t] run

The component.yaml file that is created is based on the specification detailed in the Fabrikate repo.

Fabrikate Component Definition

Fabrikate Config Definition

Positional arguments:

Arg Usage
run Generate component.yaml for current configuration

Optional arguments:

Arg Usage
-h, --help Show the help message and exit
-n NAME, --name NAME Name of the main component (default:hydrated-cluster)
-k FILE, --kubeconfig FILE Kubeconfig file for the cluster (default:kubeconfig)
-o PATH, --output PATH Output path for the generated component.yaml.
-v, --verbose Verbose output logs.
-d, --dry-run Print component.yaml to the terminal.
-t, --telemetry Enable telemetry collection (default: Disabled)

Running in Docker

Step 1. Build The Image

Run the following command from the Hydrate project directory.

docker build --tag=[image-name] .

Step 2. Run The Image

docker run [image-name] [args]

Telemetry

Telemetry is disabled by default, but can be enabled by supplying the -t argument when running hydrate.

The following data is collected and sent to AppInsights:

  • Each time Hydrate is run
  • The runtime of Hydrate
  • The runtime of functions decorated with @timeit_telemetry
  • The content and number of Full Matches
  • The content and number of Partial Matches
  • The number of No Matches

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

hydrate's People

Contributors

andrewdoing avatar edaena avatar madelineliao avatar microsoftopensource avatar msftgits avatar samiyaakhtar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hydrate's Issues

Guide users to additional steps

As a user I want guidance on the parts that were not automatically generated or some insight into what I might be missing to port over to fabrikate.

  • Determine what information to pre-populate in the yaml, for the additional services that were found in the cluster

  • Determine what information can be added as a comment in the generated yaml.

  • Add more guidance to the yaml by using comments.

  • Add information in the comments about the versions of the components so the user is aware of what version were pre-populated

Information that can be pre-populated

  • Deployments that match existing Fabrikate components
  • Deployments that don't match existing Fabrikate components
    • Name of the deployment

Information that the user must provide

  • Deployments that don't match existing Fabrikate components
    • Source repository link
    • Path (if necessary)
    • Generator (if using Helm)

User Steps

  1. Use hydrate to generate a component.yaml
  2. No Match deployments need information to be added OR they must be commented out.
  3. Follow the Fabrikate Steps to generate your manifests

Support deployments that have multiple sub-deployments

As a developer I want to understand other use cases of cluster deployments. Identify if it is possible to differentiate between the services based on namespaces. Example: Kafka, Zookeeper

  • Get sample output file from Nate
  • Support disambiguating between stateful and stateless deployments

Differentiating stateless and stateful applications in the HLD

  • Use comments in the component.yaml labeling stateless and stateful.

  • Support using Helm to generate these and other applications that don't have a Fabrikate Definition.

As a developer I want Hydrate to scaffold a manifests directory and add namespace yaml file

As a developer I want a place to put my namespace yams files. The Hydrate tool should create a manifests directory in the component.yaml output to support this. The tool should also tell me what I should guide me about what I should put inside of this directory.

Example:

name: "cloud-native"
generator: "static"
path: "./manifests"
subcomponents:
  - name: "elasticsearch-fluentd-kibana"
    source: "../fabrikate-elasticsearch-fluentd-kibana"
  - name: "prometheus-grafana"
    source: "../fabrikate-prometheus-grafana"
  - name: "istio"
    source: "../fabrikate-istio"
  - name: "kured"
    source: "../fabrikate-kured"

Telemetry doesn't work on Docker

When running Hydrate on Docker with telemetry enabled, the program gets stuck; no telemetry data is printed, and the program never exits.

Gather Feedback

As a developer I would like more feedback on the features from people with various levels of experience:

  • People familiar with cloud computing, aks, kubernetes

  • People not familiar with cloud computing, aks, kubernetes

Specific Actions

  • Record a short 5 minute demo

  • Share the demo with:

    • Team
    • CSE
    • Interns

Suggest Fabrikate Components for Partial Match Deployments

As a user I want deployments that partially match Fabrikate components to be reflected in the component.yaml.

Partial Match

A partial match is a scenario where a deployment on the cluster exists in a component, but the component contains one or more deployments that aren't present on my cluster.

Example

Cluster: Prometheus
Component: Prometheus-Grafana

Potential Solutions

  1. Allow the user to automatically use the more extensive component. The added functionality of the other deployments may prove to be useful for their cluster. A flag can be set that includes the partial match components in the component.yaml in a ready to use state with Fabrikate.

  2. List the partial match components under a Partial Match comment header. Include with each component the deployments that partially matched the cluster, giving the user a better idea of what's on the cluster.

Chosen Solution

A combination of potential solutions 1 and 2.

  • Identify Partial Match Deployments on the Cluster

  • Create List of Fabrikate Components that Partially Match

  • Add each item to a labelled "Partial Match" section with comments on next steps

  • Update Tests to reflect changes

Project Presentation

  • Include slide with context from bedrock
  • Change the subtitle to something more broad that people that are not familiar with bedrock fabrikate can understand
  • Explain what HLD is
  • For the use case you can mention a fictitious company
  • Create a short video 1-5 minutes

"Connecting to cluster" message appeared after it was connected

On the demo, it was taking time to connect to the cluster, there was no indication of what the tool was doing.

Expected:
Before the cluster connection starts, display the "Connecting to cluster" message

Seen:
The "Connecting to cluster message" showed up after several seconds and right after the "Connected!" message showed up

Create Fabrikate Components for New Deployments

As a developer, I want users to be able to create Fabrikate components for future use. In the scenario where a deployment doesn't match an existing component, the user may want to create a Fabrikate component definition for the new deployment.

Potential Solutions

  1. Guide the user using a "wizard" that helps them create a component.

  2. Guide the user using instructions in documentation form.

Useful Links

Component Definition Spec

Add authentication to Hydrate's GitHub requests

As a user, I want to authenticate my GitHub account with Hydrate so that GitHub requests are tied to my account. This ensures that when the IP address I'm using gets saturated with GitHub requests, I can be sure that my requests go through.

@andrebriggs @edaena : This is an issue I ran into while at OneWeek, there are so many devs using the Wifi that my GitHub requests fail when I run Hydrate. I think this is pretty low priority, but I wanted to create the issue for future reference.

Create Subcomponent Entries for No Match Deployments

As a user, I want the deployments living on my cluster to be reflected in the generated component.yaml, even if there isn't a Fabrikate component that exists for it.

Steps for handling these cases:

  1. Use comments in the component.yaml to make a section for these "no match" deployments, since they will likely require user input before they are ready to be used by Fabrikate.

  2. Guide the user through adding a source and generator to the component.yaml

    • Deployment lives on GitHub

    • Deployment uses a helm chart

Hydrate Icon

As a developer I'd like to associate an icon/logo with the project

Project Presentation

  • Include slide with context from bedrock

  • Change the subtitle to something more broad that people that are not familiar with bedrock fabrikate can understand

  • Explain what HLD is

  • For the use case you can mention a fictitious company

  • Create a short video 1-5 minutes

  • Get Feedback during Team Sync

Add version matching between a cluster and Fabrikate components

As a user, I want the components that are populated in my HLD to match the version I'm using on my cluster.

This information can be gained by introspecting into the resource, specifically looking at image tags, or potentially a piece of metadata labeled "version".

Output component.yaml to an /out folder

Change the default output path of the component.yaml file to be in an /out folder. Currently, the file is written just outside of the hydrate module, but this causes problems when extracting the file from Docker. Creating a new /out folder would simplify the process of copying the file from the container to the host.

Add Test Output to Azure Pipeline

As a developer I want to see some output from my Azure Pipeline builds to gain more insight into failed builds, and to ensure that everything is running properly.

As a developer I want a build badge on the ReadMe.md

As a developer I would like have confidence about the build state of Hydrate. Having a build badge would help let me know tests have been run and that the code is functions according to business requirements.

Setup Azure DevOps Pipeline

Now that the repository is migrated, the pipeline needs to be setup again.

  • Automatically run tests for PRs

  • Run the linting script on the changed files

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.