Deployment

Warning Warning

This document includes guidance on hosting Haztrak using various cloud service providers. The United States Environmental Protection Agency (EPA) does not endorse any cloud service provider mentioned in this documentation. EPA is not responsible for any costs incurred by a third party that chooses to host Haztrak.

If you're looking to contribute to the Haztrak project, see our documentation setting up a local development environment section.

Overview

Where applicable, the Haztrak project embraces a number of doctrines1 that are important to understand:

Tools Employed

Section Coming soon.

Infrastructure as Code (IaC)

Section Coming soon.

Continuous Deployment

Section Coming soon.

Example local k8 Deployment

Don't bother following this yet. This is a work in progress meant to document the steps.

As an example, you can deploy Haztrak to a local Minikube cluster. Minikube is a lightweight tool for creating a Kubernetes cluster on your local machine.

Prerequisites

Before proceeding, ensure the following prerequisites are installed:

Steps

To deploy Haztrak locally to a Minikube cluster, follow these steps:

  1. Start Minikube: Open a terminal and start the Minikube cluster using the following command: This may take a few minutes, depending on your system.

    minikube start
    
  2. Clone the Haztrak repository to you local machine and cd into the project root:

    git clone https://github.com/USEPA/haztrak.git
    cd haztrak
    
  3. configure your minikube environment to use the docker daemon running on your local machine:

    eval $(minikube docker-env)
    
  4. Build the docker images for the Haztrak services:

    docker build -t haztrak-server --target production ./server
    
  5. Deploy Haztrak: Run the following Helm command to deploy Haztrak:

    helm install haztrak ./haztrak-charts
    

    This installs the Haztrak charts and creates the necessary Kubernetes resources in your minikube cluster.

  6. Access Haztrak with minikube service command:

    minikube service haztrak
    

This will open a browser to IP address created by the haztrak k8 service for your viewing pleasure.



1 This is a not 100% accurate since Haztrak will never be deployed, by the EPA, to a true production environment. Declaring that we embrace GitOps and continuous monitoring is a little like armchair quarterbacking. The Haztrak project implements these practices in our development process where we can.