Skip to content

TakeoffTech/netbox-gcp-deployment

Repository files navigation


Logo

Netbox GCP installer

This repo contains terraform and kubernetes configuration to install netbox into an empty GCP project.
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

This project is designed to easily deploy netbox into an GCP project in an opinonated way.

Features:

  • Deploy netbox onto GKE autpilot cluster using the bootc helm chart: https://github.com/bootc/netbox-chart
  • Use a CloudSQL posgresql for database
  • Use a GCP memorystore for redis instance
  • Create DNS records in managed zone
  • Create SSL certs using Letsencrypt and cert-manager
  • Setup and configure necessary infrastructure to support Okta authentication
    • ingress-nginx
    • vouch-proxy
    • Creates Okta OIDC application configuration via terraform
    • creates a standard set of groups in netbox after deployment

(back to top)

Built With

(back to top)

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

Prerequisites

Install garden

Install and init Google Cloud SDK

Create a GCP project

Create a public DNS zone in your GCP project

Installation

  1. Clone the repo
    git clone https://github.com/TakeoffTech/netbox-gcp-deployment.git

(back to top)

Usage

The current setup allows you to deploy netbox to empty gcp project.

Configuration Inputs

Garden Variable ENV Variable Description Default Required
google_project_id GOOGLE_PROJECT Google Project ID to deploy netbox too "" yes
google_compute_region GOOGLE_REGION Google Region to deploy netbox too "us-central1" no
google_managed_zone MANAGED_ZONE Google managed zone name (not the domain name) "" no
google_dns_project_id GOOGLE_DNS_PROJECT Google Project ID that hosts the managed zone google_project_id no
cert_registration_email CERT_REG_EMAIL Letsencrypt Certification registratiobn email "user@example.com" yes
disable_okta__auth DISABLE_OKTA_AUTH Flag to enable or disable okta oidc authentication true no
okta_org_name OKTA_ORG_NAME Okta Org name "" yes (if disable_okta_auth is false)
okta_base_url OKTA_BASE_URL Okta base url "oktapreview.com" no
okta_name_prefix OKTA_NAME_PREFIX Prefix to apply to all okta resources "" no
okta_assignment_group_name OKTA_ASSIGNMENT_GROUP_NAME Group to assign to the application and add to the read-only group "Everyone" no
(ENV only variable for the okta terraform provider) OKTA_API_TOKEN Okta API token "" yes (if disable_okta_auth is false)

To set these variable before running garden deploy you have two options:

  1. simply set the ENV variable in your shell:
export ENV_VARIABLE=myconfig
  1. create a garden.env or garden..env file: Variable files (varfiles)
echo garden_variable_name=myconfig >> garden.env

Hostname creation logic

We automatically create dns records for netbox using the google_managed_zone domain. If you are deploying into the prod environment, it will create netbox.<google_managed_zone.domain>. If the dns zone contains netbox. we assume google_managed_zone is a subdomain for netbox (ie netbox.domain.local) and will create a record just for <google_managed_zone.domain>. When you have disable_okta_auth set to false we will create a record for vouch-proxy for clients and okta to access and they are created like this vouch.<google_managed_zone.domain> if it's a netbox. subdomain. If it's not a subdomain it will create vouch-netbox.<google_managed_zone.domain> for vouch-proxy.

For development environment, replace netbox with netbox-user-<local.username>

Setting your environment variables

  • Your google project ID
    export GOOGLE_PROJECT=<project_id>
  • We default everything to the us-central1 region. You can override this with the GOOGLE_REGION environment variable. You can find the list of GCP regions here: https://cloud.google.com/compute/docs/regions-zones#available
    export GOOGLE_REGION=regionID

Deploying

  • Run garden deploy
    garden deploy

Cleanup

  • Delete the environment
    garden delete env
  • Currently we do not destroy the GKE cluster when deleting the environment, run this to cleanup the project and GKE cluster
    garden plugins terraform destroy-root

(back to top)

Roadmap

  • [] Feature 1
  • [] Feature 2
  • [] Feature 3
    • [] Nested Feature

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Project Link: https://github.com/TakeoffTech/netbox-gcp-deployment

(back to top)

Acknowledgments

(back to top)

About

This repo deploys netbox to an empty GCP project.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •