Skip to content

Commit

Permalink
1168 review docs examples (#1741)
Browse files Browse the repository at this point in the history
## Description

Ok, so I started out w/ the full intention of just reviewing examples +
cleaning up some of the test code to put `kubectl get`'s as `wait`
actions within their source `zarf.yaml`s. Pretty good intentions right?!
Well you know what they say about roads and good intentions...

## Related Issue

Fixes #1168 

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [x] Other (security config, docs update, etc)

## Checklist before merging

- [ ] Test, docs, adr added or updated as needed
- [x] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/CONTRIBUTING.md#developer-workflow)
followed

---------

Signed-off-by: razzle <harry@razzle.cloud>
Co-authored-by: Jonathan Perry <YrrepNoj@gmail.com>
Co-authored-by: Wayne Starr <Racer159@users.noreply.github.com>
  • Loading branch information
3 people authored Jun 1, 2023
1 parent c681879 commit 4d53e40
Show file tree
Hide file tree
Showing 149 changed files with 1,970 additions and 1,604 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ jobs:
# in a previous step. This test run will the current release to create a K3s cluster.
# chown the logs since they were originally created as root
run: |
zarf package create src/test/upgrade-test --set PODINFO_VERSION=6.3.3 --confirm
zarf package create src/test/upgrade-test --set PODINFO_VERSION=6.3.4 --confirm
zarf package create src/test/upgrade --set PODINFO_VERSION=6.3.3 --confirm
zarf package create src/test/upgrade --set PODINFO_VERSION=6.3.4 --confirm
sudo env "PATH=$PATH" CI=true zarf package deploy zarf-package-test-upgrade-package-amd64-6.3.3.tar.zst --confirm
sudo chown $USER /tmp/zarf-*.log
Expand Down
16 changes: 5 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -132,18 +132,12 @@ build-examples: ## Build all of the example packages

@test -s ./build/zarf-package-data-injection-$(ARCH).tar || $(ZARF_BIN) package create examples/data-injection -o build -a $(ARCH) --confirm

@test -s ./build/zarf-package-git-data-$(ARCH)-v1.0.0.tar.zst || $(ZARF_BIN) package create examples/git-data -o build -a $(ARCH) --confirm
@test -s ./build/zarf-package-git-data-$(ARCH)-0.0.1.tar.zst || $(ZARF_BIN) package create examples/git-data -o build -a $(ARCH) --confirm

@test -s ./build/zarf-package-helm-alt-release-name-$(ARCH).tar.zst || $(ZARF_BIN) package create examples/helm-alt-release-name -o build -a $(ARCH) --confirm

@test -s ./build/zarf-package-helm-local-chart-$(ARCH)-0.0.1.tar.zst || $(ZARF_BIN) package create examples/helm-local-chart -o build -a $(ARCH) --confirm
@test -s ./build/zarf-package-helm-charts-$(ARCH)-0.0.1.tar.zst || $(ZARF_BIN) package create examples/helm-charts -o build -a $(ARCH) --confirm

@test -s ./build/zarf-package-podinfo-flux-$(ARCH).tar.zst || $(ZARF_BIN) package create examples/podinfo-flux -o build -a $(ARCH) --confirm

@test -s ./build/zarf-package-helm-no-wait-$(ARCH).tar.zst || $(ZARF_BIN) package create examples/helm-no-wait -o build -a $(ARCH) --confirm

@test -s ./build/zarf-package-helm-oci-chart-$(ARCH)-0.0.1.tar.zst || $(ZARF_BIN) package create examples/helm-oci-chart -o build -a $(ARCH) --confirm

@test -s ./build/zarf-package-yolo-$(ARCH).tar.zst || $(ZARF_BIN) package create examples/yolo -o build -a $(ARCH) --confirm

## NOTE: Requires an existing cluster or the env var APPLIANCE_MODE=true
Expand All @@ -158,16 +152,16 @@ test-external: ## Run the Zarf CLI E2E tests for an external registry and cluste
@test -s $(ZARF_BIN) || $(MAKE) build-cli
@test -s ./build/zarf-init-$(ARCH)-$(CLI_VERSION).tar.zst || $(MAKE) init-package
@test -s ./build/zarf-package-podinfo-flux-$(ARCH).tar.zst || $(ZARF_BIN) package create examples/podinfo-flux -o build -a $(ARCH) --confirm
cd src/test/external-test && go test -failfast -v -timeout 30m
cd src/test/external && go test -failfast -v -timeout 30m

## NOTE: Requires an existing cluster and
.PHONY: test-upgrade
test-upgrade: ## Run the Zarf CLI E2E tests for an external registry and cluster
@test -s $(ZARF_BIN) || $(MAKE) build-cli
[ -n "$(shell zarf version)" ] || (echo "Zarf must be installed prior to the upgrade test" && exit 1)
[ -n "$(shell zarf package list 2>&1 | grep test-upgrade-package)" ] || (echo "Zarf must be initialized and have the 6.3.3 upgrade-test package installed prior to the upgrade test" && exit 1)
@test -s "zarf-package-test-upgrade-package-amd64-6.3.4.tar.zst" || zarf package create src/test/upgrade-test/ --set PODINFO_VERSION=6.3.4 --confirm
cd src/test/upgrade-test && go test -failfast -v -timeout 30m
@test -s "zarf-package-test-upgrade-package-amd64-6.3.4.tar.zst" || zarf package create src/test/upgrade/ --set PODINFO_VERSION=6.3.4 --confirm
cd src/test/upgrade && go test -failfast -v -timeout 30m

.PHONY: test-unit
test-unit: ensure-ui-build-dir ## Run unit tests within the src/pkg and the bigbang extension directory
Expand Down
6 changes: 3 additions & 3 deletions docs/3-create-a-zarf-package/2-zarf-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ Can be when using the `url` key:

<Tabs queryString="chart-examples">
<TabItem value="localPath">
<ExampleYAML example="helm-local-chart" component="demo-helm-local-chart" />
<ExampleYAML example="helm-charts" component="demo-helm-local-chart" />
</TabItem>
<TabItem value="URL (git)">
<ExampleYAML example="helm-git-chart" component="demo-helm-git-chart" />
<ExampleYAML example="helm-charts" component="demo-helm-git-chart" />
</TabItem>
<TabItem value="URL (oci)">
<ExampleYAML example="helm-oci-chart" component="helm-oci-chart" />
<ExampleYAML example="helm-charts" component="demo-helm-oci-chart" />
</TabItem>
</Tabs>

Expand Down
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The Zarf examples demonstrate different ways to utilize Zarf in your environment

To build and deploy a demo, change directories to the example you want to try and run:

``` bash
```bash
cd <directory> # This should be whatever example you want to try (i.e. game)
zarf package create # This will create the zarf package
zarf package deploy # This will prompt you to deploy the created zarf package
Expand Down
26 changes: 0 additions & 26 deletions examples/big-bang-yolo-mode/README.md

This file was deleted.

128 changes: 0 additions & 128 deletions examples/big-bang-yolo-mode/config/ingress.yaml

This file was deleted.

27 changes: 0 additions & 27 deletions examples/big-bang-yolo-mode/config/kyverno.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions examples/big-bang-yolo-mode/config/loki.yaml

This file was deleted.

20 changes: 20 additions & 0 deletions examples/big-bang/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,23 @@ To view the example in its entirety, select the `Edit this page` link below the
:::

<ExampleYAML example="big-bang" showLink={false} />

:::caution

`valuesFiles` are processed in the order provided with Zarf adding an initial values file to populate registry and git server credentials as the first file. Including credential `values` (even empty ones) will override these values. This can be used to our advantage however for things like YOLO mode as described below.

:::

## Big Bang YOLO Mode Support

The Big Bang extension also supports YOLO mode, provided that you add your own credentials for the image registry. This is accomplished below with the `provision-flux-credentials` component and the `credentials.yaml` values file which allows images to be pulled from [registry1.dso.mil](https://registry1.dso.mil). We demonstrate providing account credentials via Zarf Variables, but there are other ways to populate the data in `private-registry.yaml`.

You can learn about YOLO mode in the [FAQ](../../docs/8-faq.md#what-is-yolo-mode-and-why-would-i-use-it) or the [YOLO mode example](../yolo/README.md).

:::info

To view the example in its entirety, select the `Edit this page` link below the article and select the parent folder, then select the `yolo` folder.

:::

<ExampleYAML example="big-bang/yolo" showLink={false} />
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ registryCredentials:
registry: registry1.dso.mil
username: "###ZARF_VAR_REGISTRY1_USERNAME###"
password: "###ZARF_VAR_REGISTRY1_CLI_SECRET###"
email: ""
email: ""
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,21 @@ kind: ZarfPackageConfig

metadata:
name: yolo-big-bang
description: "Deploy Big Bang Core in YOLO mode"
description: Deploy Big Bang Core in YOLO mode
version: 2.0.0
url: https://p1.dso.mil/products/big-bang
architecture: amd64
yolo: true

variables:
- name: REGISTRY1_USERNAME
description: "The username for pulling images from registry1.dso.mil"
required: true
description: The username for pulling images from registry1.dso.mil
prompt: true
- name: REGISTRY1_CLI_SECRET
description: "The CLI secret for pulling images from registry1.dso.mil"
required: true
description: The CLI secret for pulling images from registry1.dso.mil
prompt: true
- name: REGISTRY1_AUTH
description: "A base64 encoded concatenation of 'REGISTRY1_USERNAME:REGISTRY1_CLI_SECRET'"
required: true
description: A base64 encoded concatenation of 'REGISTRY1_USERNAME:REGISTRY1_CLI_SECRET'
prompt: true

components:
Expand All @@ -29,14 +26,14 @@ components:
- name: private-registry
namespace: flux-system
files:
- secrets/private-registry.yaml
- private-registry.yaml
- name: bigbang
required: true
extensions:
bigbang:
version: 2.0.0
valuesFiles:
- config/credentials.yaml
- config/ingress.yaml
- config/kyverno.yaml
- config/loki.yaml
- credentials.yaml
- ../config/ingress.yaml
- ../config/kyverno.yaml
- ../config/loki.yaml
4 changes: 2 additions & 2 deletions examples/big-bang/zarf.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
kind: ZarfPackageConfig
metadata:
name: big-bang-example
description: "Deploy Big Bang Core"
description: Deploy Big Bang Core
# renovate: datasource=gitlab-releases depName=big-bang/bigbang versioning=semver registryUrl=https://repo1.dso.mil/
version: 2.0.0
url: https://p1.dso.mil/products/big-bang
Expand All @@ -10,7 +10,7 @@ metadata:

variables:
- name: DOMAIN
default: "bigbang.dev"
default: bigbang.dev
prompt: false

components:
Expand Down
Loading

0 comments on commit 4d53e40

Please sign in to comment.