Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Big Bang Component Extension #1094

Merged
merged 138 commits into from
Mar 3, 2023
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
e97e096
Dont look
Dec 2, 2022
e1eec01
Dont look
Dec 2, 2022
55b7305
WIP
Dec 3, 2022
c2c628e
Merge branch 'main' into bigbang-component
corang Dec 14, 2022
47e0953
small fixes
corang Dec 15, 2022
611d901
allow package to run on k3s based clusters
corang Dec 15, 2022
0032e29
Merge branch 'main' into bigbang-component
corang Dec 15, 2022
4b6444b
Updated local changes to leverage existing zarf capabilities for imag…
Dec 16, 2022
a116628
Added flux deploy back
Dec 19, 2022
1994071
BB component creation/deployment refactor
corang Dec 19, 2022
7c4cd2f
add test for bigbang package creation/deployment
corang Dec 20, 2022
417881d
bb component supports bb 1.44+ still wip
corang Dec 21, 2022
37aa504
support for 1.44-1.49
corang Jan 5, 2023
e869d05
bb 1.50.0 support, extra images in bb component support
corang Jan 6, 2023
8f9f099
Merge branch 'main' into bigbang-component
corang Jan 6, 2023
0f62550
working and lighter weight test
corang Jan 6, 2023
186605a
Merge branch 'main' into bigbang-component
corang Jan 6, 2023
eb0a87d
bigbang schema fix
corang Jan 6, 2023
84d6cfd
proper default handling around flux
corang Jan 6, 2023
4a80d32
No more hardcoded things where possible
corang Jan 9, 2023
387bcb8
scary script is gone
corang Jan 9, 2023
ff47bef
Merge remote-tracking branch 'origin/main' into bigbang-component
corang Jan 9, 2023
0c779ae
fix merge bug, remove unnecessary code, remove bb test
corang Jan 9, 2023
cbdbbb4
Merge branch 'main' into bigbang-component
jeff-mccoy Jan 18, 2023
044c35f
Added ADR for BigBang
Jan 20, 2023
6e64cd7
Update adr/0012-bigbang-as-a-noun.md
runyontr Jan 20, 2023
844e7c0
Update adr/0012-bigbang-as-a-noun.md
runyontr Jan 20, 2023
c3d2516
Update BigBang work for 1.50,1.51,1.52
Jan 30, 2023
f34b671
Merge branch 'bigbang-component' of github.com:defenseunicorns/zarf i…
Jan 30, 2023
11f08b4
Updated Readme and example
Jan 31, 2023
033374b
Merge remote-tracking branch 'origin/main' into bigbang-component
Jan 31, 2023
047d999
Updated based on comments from PR
Jan 31, 2023
eb1b262
Merge branch 'main' into bigbang-component
jeff-mccoy Feb 1, 2023
2ff9161
Merge branch 'main' into bigbang-component
jeff-mccoy Feb 2, 2023
7d3e689
Converted image discovery for Bigbang to HIP 0015
Feb 6, 2023
d7357e8
Merge branch 'bigbang-component' of github.com:defenseunicorns/zarf i…
Feb 6, 2023
c1fd20d
Converted image discovery for Bigbang to HIP 0015
Feb 6, 2023
d62961f
Update logic for git pulling to allow bigbang branch overrides
Feb 8, 2023
b106675
added kyverno override to allow zarf to do zarf things
Feb 9, 2023
bf0523c
feedback from pr
Feb 10, 2023
fc97087
Merge remote-tracking branch 'origin/main' into bigbang-component
Feb 10, 2023
0d8af81
Merge branch 'main' into bigbang-component
jeff-mccoy Feb 14, 2023
0fb1074
wip: refactor to generic extension model
jeff-mccoy Feb 14, 2023
553e7ff
feedback from pr
Feb 14, 2023
f83a26f
Merge branch 'bigbang-component' of github.com:defenseunicorns/zarf i…
Feb 14, 2023
fd9e631
update eks config
jeff-mccoy Feb 16, 2023
359dab6
yaml cleanup
jeff-mccoy Feb 16, 2023
6693d31
make SplitYamlToString() public
jeff-mccoy Feb 16, 2023
7b90c28
ignore debug
jeff-mccoy Feb 16, 2023
b7a1891
pull bb-things out of internal
jeff-mccoy Feb 16, 2023
0165e47
lots of refactor fun
jeff-mccoy Feb 16, 2023
f89fbbe
add note about extensions location
jeff-mccoy Feb 16, 2023
8c5da99
use named vs indexed value files
jeff-mccoy Feb 16, 2023
9431eed
fix git 💩
jeff-mccoy Feb 16, 2023
c283622
more testing & fixing
jeff-mccoy Feb 16, 2023
869d1cb
remove hard-broke eks & update docs
jeff-mccoy Feb 16, 2023
6c82eaf
testing around bb issues....
jeff-mccoy Feb 16, 2023
9385ef3
so this is super broken..........
jeff-mccoy Feb 16, 2023
dc89a04
fixed git cache bugs
Feb 16, 2023
b83f888
update values files for branhces
Feb 16, 2023
c7040f6
Merge branch 'bigbang-component' of github.com:defenseunicorns/zarf i…
Feb 16, 2023
8b99922
updated since monitoring branch mergeD
Feb 16, 2023
5e86475
don't look tom
jeff-mccoy Feb 16, 2023
7457a1d
use kustomize inline for flux manifest & images processing
jeff-mccoy Feb 16, 2023
cd234b9
use tags for bb image patch
jeff-mccoy Feb 17, 2023
47fd9c7
revert git branch changes
jeff-mccoy Feb 17, 2023
0130fd9
Merge branch 'main' into bigbang-component
jeff-mccoy Feb 17, 2023
954cff4
cleanup
jeff-mccoy Feb 17, 2023
de3ee59
don't make component babies
jeff-mccoy Feb 17, 2023
56987fd
sigh
jeff-mccoy Feb 17, 2023
08e20e1
wip test + zarf meetup cleanup work
jeff-mccoy Feb 18, 2023
9180099
dont trample original component
jeff-mccoy Feb 18, 2023
3ab1f47
add git fallback for cache pulls
jeff-mccoy Feb 18, 2023
93b8cb0
remove unused extensions interface
jeff-mccoy Feb 18, 2023
d062c91
lame lint things
jeff-mccoy Feb 18, 2023
c0b8d33
cleanup adr formatting
jeff-mccoy Feb 18, 2023
3bfc3a3
adr pr comments
jeff-mccoy Feb 18, 2023
2610d56
update IB creds for test
jeff-mccoy Feb 18, 2023
763015f
put registry login in correct workflow
jeff-mccoy Feb 18, 2023
825ae49
update deps to silence CVE in containerd
jeff-mccoy Feb 18, 2023
bc8070d
add zarf build to the path for the test
jeff-mccoy Feb 18, 2023
a4d7fdf
cleaner extension temp files behavior
jeff-mccoy Feb 18, 2023
d8ffe8f
Merge branch 'main' into bigbang-component
jeff-mccoy Feb 18, 2023
45c942a
Merge branch 'main' into bigbang-component
jeff-mccoy Feb 18, 2023
4ad2e76
Big update to verbiage/walkthrough
Racer159 Feb 19, 2023
4a095f5
Fix gitignore:
Racer159 Feb 19, 2023
e1ed136
Fix docs
Racer159 Feb 19, 2023
14883be
Add a note about package remove
Racer159 Feb 19, 2023
c5bb3f8
Refactor image discovery
Racer159 Feb 19, 2023
e34df6b
add comments in the bb zarf.yaml
jeff-mccoy Feb 19, 2023
6795c71
stub out wait actions for bb extension
jeff-mccoy Feb 21, 2023
6a9e050
Merge branch 'main' into bigbang-component
jeff-mccoy Feb 22, 2023
0ed602f
add actions for validating Big Bang releases
jeff-mccoy Feb 22, 2023
fc6321f
add workaround for Metric Server "auto condition"
jeff-mccoy Feb 22, 2023
ff6d8f7
change to 10 mins vs 20 for action success wait thingys
jeff-mccoy Feb 22, 2023
a242276
Update docs/13-walkthroughs/5-big-bang.md
jeff-mccoy Feb 22, 2023
9f9bb2b
Update docs/13-walkthroughs/5-big-bang.md
jeff-mccoy Feb 22, 2023
ab9b2ed
add banner and make bb manifests first in manifest list
jeff-mccoy Feb 23, 2023
9626758
add http connect test for the twistlock console
jeff-mccoy Feb 23, 2023
b149351
Merge remote-tracking branch 'origin/bigbang-component' into bigbang-…
jeff-mccoy Feb 23, 2023
b7d2011
add failure handlers
jeff-mccoy Feb 23, 2023
97524ee
make ci happy times
jeff-mccoy Feb 23, 2023
978ce87
that happened--prob should pay more attention
jeff-mccoy Feb 23, 2023
239c045
connect sequence too janky today in ci without go
jeff-mccoy Feb 23, 2023
96f49e1
pr comments
jeff-mccoy Feb 24, 2023
d6a150d
bump to bb 1.54 minumum (all issues fixed) and drop upgrade test unti…
jeff-mccoy Feb 24, 2023
6f20bd1
Merge branch 'main' into bigbang-component
jeff-mccoy Feb 24, 2023
6691a00
fix leaky tmp dirs
jeff-mccoy Feb 25, 2023
fb00128
add 1.53 back w/upgrade test & disk pressure relief
jeff-mccoy Feb 25, 2023
ce12aa9
well
jeff-mccoy Feb 25, 2023
994c70a
cleanup test / move to extensions folder
jeff-mccoy Feb 25, 2023
e522b6a
switch to go e2e test
jeff-mccoy Feb 25, 2023
3d90373
dont cd just to cd back out like other e2e tests in zarf
jeff-mccoy Feb 25, 2023
98ad8a6
more test cleanup
jeff-mccoy Feb 25, 2023
646165b
./
jeff-mccoy Feb 25, 2023
8c6356f
fix pkg paths & add some disk cleanup back
jeff-mccoy Feb 25, 2023
f0df946
help poor github runners out
jeff-mccoy Feb 25, 2023
8481f4c
Fix @jeff-mccoy complaints
Racer159 Feb 26, 2023
54d0eb0
Merge branch 'main' into bigbang-component
jeff-mccoy Feb 26, 2023
82c6f9d
the linter is such a whiner....
jeff-mccoy Feb 26, 2023
52dd9b9
Merge branch 'main' into bigbang-component
jeff-mccoy Feb 26, 2023
a0f0a32
Update docs/13-walkthroughs/5-big-bang.md
jeff-mccoy Feb 26, 2023
e6aff0f
Update docs/13-walkthroughs/5-big-bang.md
jeff-mccoy Feb 26, 2023
a94e569
Update docs/13-walkthroughs/5-big-bang.md
jeff-mccoy Feb 26, 2023
96217a0
Update examples/big-bang/README.md
jeff-mccoy Feb 26, 2023
48a543c
Update src/extensions/bigbang/bigbang.go
jeff-mccoy Feb 26, 2023
81c3833
better banner behavior + move sort to utils pkg
jeff-mccoy Feb 27, 2023
35eb103
Always show a big bang extension message.
jeff-mccoy Feb 27, 2023
8b48dbd
lint
jeff-mccoy Feb 27, 2023
2a612f9
return err on cyclical dependencies
jeff-mccoy Feb 27, 2023
c55de7b
suspend bb umbrella on removal
jeff-mccoy Feb 27, 2023
b3e4a8c
updated error handling and README for bigbang
Feb 28, 2023
3f28c79
Merge branch 'main' into bigbang-component
jeff-mccoy Feb 28, 2023
f94ed65
try putting force back on git pull
Mar 1, 2023
0d221b6
Add some clarifications on what config options are needed to
Racer159 Mar 3, 2023
c1ec6a8
Merge in git fixes
Racer159 Mar 3, 2023
439b8ae
fix gitcred handling
Racer159 Mar 3, 2023
9016e68
Fix helm git chart behavior
Racer159 Mar 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions adr/0012-bigbang-as-a-noun.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 12. BigBang as a Noun

Date: 2023-01-18

## Status

Accepted

## Context

One primary application component that end users of Zarf are deploying is [Big Bang](https://repo1.dso.mil/platform-one/big-bang/bigbang). The installation of BigBang is complicated for several reason:
jeff-mccoy marked this conversation as resolved.
Show resolved Hide resolved

- It requires Flux to be installed to deploy correctly due to the use of Flux CRDs.
- The [images](https://umbrella-bigbang-releases.s3-us-gov-west-1.amazonaws.com/umbrella/1.51.0/package-images.yaml) defined within BigBang are normally a superset of the images needed for any individual deployment.
- All images that BigBang might need takes 10s of gigabytes of storage to include in a Zarf package.
- The git repositories defined within BigBang are normally a superset of the git repositories needed for any individual deployment.
- Injecting a `values.yaml` file into the [default deployment structure](https://repo1.dso.mil/big-bang/bigbang/-/blob/master/base/kustomization.yaml) is complicated.
and the discovery of which images are needed is a function of the values that are provided to the BigBang chart
mjnagel marked this conversation as resolved.
Show resolved Hide resolved


## Decision

Deployments of BigBang can be managed with a new `bigbang` noun in the zarf.yaml that manages the complexity of the deployment. This capability will take the values provided to the big bang chart, template them during the package phase to identify which [BigBang packages](https://repo1.dso.mil/big-bang/bigbang/-/blob/master/docs/packages.md) are being configured in the Zarf package. The code then includes only the git repositories and images needed for the configured packages, and does not include the git repositories and images for packages that would not be deployed.


The `bigbang` section will provide the following configurations for managing a big bang deployment:

- `version` - Identifies the particular version of Bigbang to deploy, which correspond to git tags in the provided `repo`. See versions of BigBang [here](https://repo1.dso.mil/big-bang/bigbang/-/releases).
jeff-mccoy marked this conversation as resolved.
Show resolved Hide resolved
- `repo` - Identifies the git repository BigBang is hosted on. Defaults to https://repo1.dso.mil/platform-one/big-bang/bigbang.git
- `valuesFrom` - list of local files that get passed to the BigBang helm chart for deployment.
jeff-mccoy marked this conversation as resolved.
Show resolved Hide resolved
- `skipFlux` - boolean to determine if the flux installation for BigBang should be skipped. Only set this to true if flux has been deployed in a different way already in the cluster.


## Consequences

jeff-mccoy marked this conversation as resolved.
Show resolved Hide resolved

- By doing package time rendering and discovery of images for inclusion into the zarf package, the flexibility for deploy time configuration is limited since new parts of BigBang can't be added arbitrarily, since the necessary artifacts to deploy those BigBang packages won't be present in the zarf package
- BigBang is every changing and improving, and while it is available as open source, we do not control the change in how the deployment is handled as [BigBang 2.0](https://repo1.dso.mil/groups/big-bang/-/epics/217) is progressing. This creates a burden on the Zarf team to ensure new changes in Big Bang do not break how BigBang is deployed, and a burden to ensure as the way BigBang gets deployed is changed, it does not break older versions of deploying BigBang.
jeff-mccoy marked this conversation as resolved.
Show resolved Hide resolved
jeff-mccoy marked this conversation as resolved.
Show resolved Hide resolved

102 changes: 100 additions & 2 deletions docs/4-user-guide/3-zarf-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -1471,6 +1471,104 @@ Must be one of:
</blockquote>
</details>

<details>
<summary><strong> <a name="components_items_bigbang"></a>bigbang</strong>

</summary>
&nbsp;
<blockquote>

**Description:** Configurations for installing BigBang and Flux in the cluster

| | |
| ------------------------- | -------------------------------------------------------------------------------------------------------- |
| **Type** | `object` |
| **Additional properties** | [![Not allowed](https://img.shields.io/badge/Not%20allowed-red)](# "Additional Properties not allowed.") |
| **Defined in** | #/definitions/ZarfBigBang |

<details>
<summary><strong> <a name="components_items_bigbang_version"></a>version *</strong>

</summary>
&nbsp;
<blockquote>

![Required](https://img.shields.io/badge/Required-red)

**Description:** The version of Big Bang you'd like to use

| | |
| -------- | -------- |
| **Type** | `string` |

</blockquote>
</details>

<details>
<summary><strong> <a name="components_items_bigbang_repo"></a>repo</strong>

</summary>
&nbsp;
<blockquote>

**Description:** Override of repo to pull big bang from

| | |
| -------- | -------- |
| **Type** | `string` |

</blockquote>
</details>

<details>
<summary><strong> <a name="components_items_bigbang_valuesFrom"></a>valuesFrom</strong>

</summary>
&nbsp;
<blockquote>

**Description:** list of values files to pass to BigBang; these will be merged together

| | |
| -------- | ----------------- |
| **Type** | `array of string` |

| | Array restrictions |
| -------------------- | ------------------ |
| **Min items** | N/A |
| **Max items** | N/A |
| **Items unicity** | False |
| **Additional items** | False |
| **Tuple validation** | See below |

## <a name="autogenerated_heading_19"></a>valuesFrom items

| | |
| -------- | -------- |
| **Type** | `string` |

</blockquote>
</details>

<details>
<summary><strong> <a name="components_items_bigbang_skipFlux"></a>skipFlux</strong>

</summary>
&nbsp;
<blockquote>

**Description:** Should we skip deploying flux? Defaults to false

| | |
| -------- | --------- |
| **Type** | `boolean` |

</blockquote>
</details>

</blockquote>
</details>

</blockquote>
</details>

Expand All @@ -1495,7 +1593,7 @@ Must be one of:
| **Additional items** | False |
| **Tuple validation** | See below |

## <a name="autogenerated_heading_19"></a>ZarfPackageVariable
## <a name="autogenerated_heading_20"></a>ZarfPackageVariable

| | |
| ------------------------- | -------------------------------------------------------------------------------------------------------- |
Expand Down Expand Up @@ -1597,7 +1695,7 @@ Must be one of:
| **Additional items** | False |
| **Tuple validation** | See below |

## <a name="autogenerated_heading_20"></a>ZarfPackageConstant
## <a name="autogenerated_heading_21"></a>ZarfPackageConstant

| | |
| ------------------------- | -------------------------------------------------------------------------------------------------------- |
Expand Down
73 changes: 29 additions & 44 deletions packages/big-bang-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ This package deploys [Big Bang Core](https://repo1.dso.mil/platform-one/big-bang

## Known Issues

- Big Bang requires an AMD64 system to deploy as Iron Bank does not yet support ARM. You will need to deploy to a cluster that is running AMD64. Specifically, M1 Apple computers are not supported locally and you will need to provision a remote cluster to work with Big Bang currently.
Lots of new things
mjnagel marked this conversation as resolved.
Show resolved Hide resolved
* dynamic finding of images
* Hard coding patches
* can only use one values.yaml file
* update docs here to use a binary instead of the go function.

## Instructions

Expand All @@ -18,8 +22,9 @@ This package deploys [Big Bang Core](https://repo1.dso.mil/platform-one/big-bang
# Clone the binaries
git clone https://github.com/defenseunicorns/zarf.git

# Change dir
cd zarf
# change to the examples folder
cd zarf/examples/big-bang-core
runyontr marked this conversation as resolved.
Show resolved Hide resolved

```

### Get K3d components
Expand All @@ -32,49 +37,23 @@ Follow instructions on https://zarf.dev/install/ to get the `zarf` cli

(Optional) Alternatively, build the zarf components from the repo
```shell
# Build zarf components from scratch (NOTE: golang and npm must be installed)
make init-package

# Add zarf cli from build dir to path
export PATH=$(pwd)/build:$PATH
# Create the deploy package and move it to the 'examples/sync' folder
go run ../../main.go package create
```

### Build the deploy package
### Deploy an EKS cluster

```shell
# Change dir
cd packages/big-bang-core

# Authenticate to the registry with Big Bang artifacts
set +o history
export REGISTRY1_USERNAME=<REPLACE_ME>
export REGISTRY1_PASSWORD=<REPLACE_ME>
echo $REGISTRY1_PASSWORD | zarf tools registry login registry1.dso.mil --username $REGISTRY1_USERNAME --password-stdin
set -o history

# Run zarf package command
zarf package create . --confirm
eksctl create cluster -f eksctl/demo.yaml
```

Now wait 20 min :face_palm:

### Initialize Zarf

```shell
# Start k3d cluster
k3d cluster create

# Initialize Zarf (interactively)
zarf init
# Make these choices at the prompt
# ? Do you want to download this init package? Yes
# ? Deploy this Zarf package? Yes
# ? Deploy the k3s component? No
# ? Deploy the logging component? No
# ? Deploy the git-server component? Yes

# (Optional) An alternative approach is to get the zarf init package from the zarf repo releases page or via build
# Change dir to location of the zarf-init*.tar.zst (such as the build dir) & run the zarf init command with these flags
cd ../../build
zarf init --confirm --components git-server
# Initialize Zarf
go run ../../main.go init -a amd64 --confirm --components git-server

# (Optional) Inspect the results
zarf tools k9s
Expand All @@ -83,21 +62,27 @@ zarf tools k9s
### Deploy Big Bang

```shell
# Deploy Big Bang (lightweight version)
cd ../packages/big-bang-core
zarf package deploy --confirm $(ls -1 zarf-package-big-bang-core-demo-*.tar.zst) --components big-bang-core-limited-resources
# NOTE: to deploy the standard full set of components use the flag:
# '--components big-bang-core-standard'
# Deploy Big Bang
./zarf package deploy zarf-package-big-bang-core-demo-arm64-1.47.0.tar.zst --confirm

# (Optional) Inspect the results
zarf tools k9s
```

### See the results

```shell
kubectl get pods -n flux-system
kubectl get hr -n bigbang
kubectl get pods -A
```


### Clean Up

```shell
# Destroy the k3d cluster
k3d cluster delete
# Inside the VM
eksctl delete cluster -f eksctl/demo.yaml --disable-nodegroup-eviction --wait
```

## Services
Expand Down
15 changes: 15 additions & 0 deletions packages/big-bang-core/eksctl/demo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
apiVersion: eksctl.io/v1alpha5
jeff-mccoy marked this conversation as resolved.
Show resolved Hide resolved
kind: ClusterConfig

metadata:
name: stack-demo
region: us-east-1

managedNodeGroups:
- name: ng-1
instanceType: m5.2xlarge
desiredCapacity: 1
volumeSize: 150
ssh:
allow: true # will use ~/.ssh/id_rsa.pub as the default ssh key
13 changes: 13 additions & 0 deletions packages/big-bang-core/values.gatekeeper.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
gatekeeper:
values:
violations:
allowedDockerRegistries:
enabled: false
allowedHostFilesystem:
enabled: false
bannedImageTags:
enabled: false
noPrivilegedContainers:
enabled: false
podsHaveIstio:
enabled: false
62 changes: 62 additions & 0 deletions packages/big-bang-core/values.kyverno.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
domain: bigbang.dev

# Policy
gatekeeper:
enabled: false
clusterAuditor:
enabled: false
kyverno:
enabled: true
kyvernopolicies:
enabled: true
values:
policies:
disallow-shared-subpath-volume-writes:
validationFailureAction: audit
restrict-host-ports:
validationFailureAction: audit
restrict-capabilities:
validationFailureAction: audit
restrict-image-registries:
validationFailureAction: audit
disallow-host-namespaces:
validationFailureAction: audit
disallow-privileged-containers:
validationFailureAction: audit
require-non-root-user:
validationFailureAction: audit
restrict-host-path-mount-pv:
validationFailureAction: audit


kiali:
enabled: false

# logging
logging:
enabled: false
engine: plg

loki:
enabled: true

promtail:
enabled: true
values:
serviceMonitor:
enabled: true

eckoperator:
enabled: false

fluentbit:
enabled: false


# Tracing
jaeger:
enabled: false


twistlock:
enabled: false
Loading