Skip to content

opsmill/infrahub-demo-vip-and-lb

Repository files navigation

Infrahub Logo

Infrahub by OpsMill

Infrahub by OpsMill acts as a central hub to manage the data, templates and playbooks that powers your infrastructure. At its heart, Infrahub is built on 3 fundamental pillars:

  • A Flexible Schema: A model of the infrastructure and the relation between the objects in the model, that's easily extensible.
  • Version Control: Natively integrated into the graph database which opens up some new capabilities like branching, diffing, and merging data directly in the database.
  • Unified Storage: By combining a graph database and git, Infrahub stores data and code needed to manage the infrastructure.

Infrahub - Demo repository for Load Balancer & VIP

This repository is demoing the key Infrahub features for an example with servers, Load Balancer and VIP. Infrahub generates configurations that ansible deploys.

You can run this demo on your pc using docker, or using Github Codespaces.

Running the demo on your pc

Set environment variables

export INFRAHUB_ADDRESS="http://localhost:8000"
export INFRAHUB_API_TOKEN="06438eb2-8019-4776-878c-0941b1f1d1ec"

Install the Infrahub SDK

poetry install --no-interaction --no-ansi --no-root

Start Infrahub

poetry run invoke start

Load schema and data into Infrahub

This will create :

  • Basics data (Account, Organization, ASN, and Tags)
  • Locations data (Locations, and Prefixes)
  • Servers data (VIP, Frontend and Load Balancers)
  • Resource Managers (Prefix, IP and Number pools)
poetry run invoke load-schema load-data

Running the demo in Github Codespaces

Spin up in Github codespace

Demo flow

1. Add the repository into Infrahub (Replace GITHUB_USER and GITHUB_TOKEN)

Note

Reference the Infrahub documentation for the multiple ways this can be done.

mutation AddCredential {
  CorePasswordCredentialCreate(
    data: {
      name: {value: "my-git-credential"},
      username: {value: "<GITHUB_USERNAME>"},
      password: {value: "<GITHUB_TOKEN>"}
    }
  ) {
    ok
    object {
      hfid
    }
  }
}


mutation AddRepository{
  CoreRepositoryCreate(
    data: {
      name: { value: "infrahub-demo-vip-and-lb" }
      location: { value: "https://github.com/GITHUB_USER/infrahub-demo-vip-and-lb.git" }
      # The HFID return from the previous mutation. Will be the name of the credentials
      credential: { hfid: "my-git-credential" }
    }
  ) {
    ok
    object {
      id
    }
  }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published