Newer
Older
# Contributing to Big Bang
Thanks for taking the time to contribute to BigBang!
Table of Contents:
- [Contributing to Big Bang](#contributing-to-big-bang)
- [Developers Guide](#developers-guide)
- [Local Git Setup](#local-git-setup)
- [Pre-commit hooks](#pre-commit-hooks)
- [Local Setup](#local-setup)
- [Prereqs](#prereqs)
- [Steps](#steps)
- [Combining Multiple Commits](#combining-multiple-commits)
- [Iron Bank Images](#iron-bank-images)
- [Local Kubernetes cluster](#local-kubernetes-cluster)
- [Deploying Big Bang (Quick Start)](#deploying-big-bang-quick-start)
- [Testing Big Bang Development Changes](#testing-big-bang-development-changes)
- [DNS](#dns)
- [Secrets & Certificates](#secrets--certificates)
- [Merge requests process](#merge-requests-process)
Big Bang is designed in such a way as to be as easily deployed locally as it is in production. In fact, most contributions begin locally.

Zachariah Dzielinski
committed
Per the [charter](https://repo1.dso.mil/platform-one/big-bang/charter), all Big Bang packages will leverage container images from [IronBank](https://ironbank.dso.mil/). In order to pull these images, ImagePullSecrets must be provided to BigBang. To obtain access to these images, follow the guides below. These steps should NOT be used for production since the API keys for a user are only valid when the user is logged into [Registry1](https://registry1.dso.mil)

Zachariah Dzielinski
committed
1) Register for a free Ironbank account [Here](https://sso-info.il2.dso.mil/new_account.html)
1) Log into the [Iron Bank Registry](https://registry1.dso.mil), in the top right click your *Username* and then *User Profile* to get access to your *CLI secret*/API keys.
1) When installing BigBang, set the Helm Values `registryCredentials.username` and `registryCredentials.password` to match your Registry1 username and API token
## Local Kubernetes cluster
Follow the steps below to get a local Kubernetes cluster for Big Bang using [k3d](https://k3d.io/).
```bash
# Create a local k3d cluster with the appropriate port forwards
k3d cluster create --k3s-server-arg "--disable=traefik" --k3s-server-arg "--disable=metrics-server" -p 80:80@loadbalancer -p 443:443@loadbalancer
```
For development, it is quicker to test changes without having to push to Git. To do this, we can bypass Flux2 and deploy Big Bang directly with its Helm chart.

Michael McLeroy
committed

Zachariah Dzielinski
committed
Start by creating `myvalues.yaml` to configure your local Big Bang. Big Bang's template repository contains a starter [development values.yaml](https://repo1.dso.mil/platform-one/big-bang/customers/template/-/blob/main/dev/configmap.yaml).

Michael McLeroy
committed

Michael McLeroy
committed
```bash
# Deploy the latest fluxv2 with Iron Bank images
# For development, you can use flux from the internet using 'flux install`
# Be aware, the internet version is likely newer than the Iron Bank version
./hack/flux-install.sh
# Apply a local version of the umbrella chart
# NOTE: This is the alternative to deploying a HelmRelease and having flux manage it, we use a local copy to avoid having to commit every change
helm upgrade -i bigbang chart -n bigbang --create-namespace -f myvalues.yaml
# A convenience development script is provided to force fluxv2 to reconcile all helmreleases within the cluster insteading of waiting for the next polling interval.
hack/sync.sh
```
For more extensive development, use the [Development Guide](docs/c_development.md).
## Testing Big Bang Development Changes

Zachariah Dzielinski
committed
Development changes should be tested using a full GitOps environment. The [Big Bang environment template](https://repo1.dso.mil/platform-one/big-bang/customers/template/) should be replicated, either on a branch or new repository, to start your deployment. Follow the instructions in the [template's readme](https://repo1.dso.mil/platform-one/big-bang/customers/template/-/tree/main/README.md) and in the [Big Bang docs](./docs) for configuration.
Follow the [Big Bang documentation](./docs) for testing a full deployment of Big Bang.
## DNS
To ease with local development, the TLD `bigbang.dev` has been purchased with the following CNAME record:
`CNAME: *.bigbang.dev -> 127.0.0.1`
All routable endpoints BigBang deploys will use the TLD of `bigbang.dev` by default. It is expected that consumers modify this appropriately for their environment.
A __development only__ gpg key is provided at `bigbang-dev.asc` that is used to encrypt and decrypt the secrets in this Git repository (e.g. [hack/secrets](hack/secrets/).
We cannot stress enough, __do not use this key to encrypt real secret data__. It is a shared key meant to demonstrate the workflow of secrets management within Big Bang.
Follow instructions in the [Big Bang encryption guide](docs/3_encryption.md) for how to encrypt and decrypt secrets.
## Merge requests process
The merge request process is provided as an overview of the pipeline stages required to get a commit merged.
Follow instruction in [CI-Workflow](docs/developer/ci-workflow.md) for specific details on the pipeline stages.