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

Multi-distro support (Zarf Native Apply Work) #237

Merged
merged 88 commits into from
Feb 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
48d1d80
Multi-distro support
jeff-mccoy Jan 20, 2022
3db2768
unify init/deploy & add basic chart validation before create
jeff-mccoy Jan 21, 2022
8e81e2e
add --remove-components to remove charts installed by zarf in other n…
jeff-mccoy Jan 21, 2022
1d4b468
vendor k9s into "zarf tools k9s"
jeff-mccoy Jan 21, 2022
09d50ff
small cli UX cleanup
jeff-mccoy Jan 22, 2022
6bd3bc8
move config.<type> -> types.<type>
jeff-mccoy Jan 22, 2022
e29af10
Add docker desktop K8s support
jeff-mccoy Jan 23, 2022
0aeb10d
update Loki Stack for k8s 1.22+ support
jeff-mccoy Jan 23, 2022
593c8ef
Change pterm default out to stderr for cleaner output capture
jeff-mccoy Jan 23, 2022
7201e1e
Add "zarf prepare find-images" command for calculating image deps
jeff-mccoy Jan 23, 2022
c90a29d
secret cleanup
jeff-mccoy Jan 23, 2022
a77868b
Fix RHEL check in zarf init package to avoid infinite retry loop
YrrepNoj Jan 24, 2022
a10905c
fix tiny kafka example (must be in own ns for helm happiness)
jeff-mccoy Jan 24, 2022
2e93894
cobra aliases
jeff-mccoy Jan 24, 2022
59d35ed
cleanup helm install/upgrade/rollback logic
jeff-mccoy Jan 24, 2022
13dbc77
🧹
jeff-mccoy Jan 24, 2022
5cc854d
handle fuzzy image finding & big bang chart repos
jeff-mccoy Jan 24, 2022
ae4aa08
tiny typo
jeff-mccoy Jan 24, 2022
a1fec17
fix tiny typo
matt-strong Jan 25, 2022
cfc776f
fix packager.HandleIfURL() tempPath early deletion
jeff-mccoy Jan 25, 2022
690b413
remove traefik, have doom use default ingressclass
jeff-mccoy Jan 26, 2022
d2e4572
add multi-arch support for doom image
jeff-mccoy Jan 26, 2022
c454a94
handle arch mismatch on zarf package deploy
jeff-mccoy Jan 26, 2022
5a3b660
re-enable built-in traefik for appliance mode
jeff-mccoy Jan 26, 2022
006f309
implement svc label/annotation for dynamic zarf connect, update doom ex
jeff-mccoy Jan 27, 2022
2782daf
handle microk8s
jeff-mccoy Jan 27, 2022
10bf583
warn on arch mismatch
jeff-mccoy Jan 27, 2022
abb789e
update zarf schema file
jeff-mccoy Jan 27, 2022
24956ce
fix multi-distro destroy chart removal/ns finalizer lag
jeff-mccoy Jan 27, 2022
bc8d900
small package deploy ui cleanup
jeff-mccoy Jan 27, 2022
67f221d
fix data injection example + update for multi-arch
jeff-mccoy Jan 27, 2022
e984e18
require amd64 for bb example (no arm for iron bank)
jeff-mccoy Jan 27, 2022
528bc65
more small cli ui cleanup
jeff-mccoy Jan 27, 2022
69f287a
add kind and k3d example configs
jeff-mccoy Jan 27, 2022
ccdba25
require amd64 for postgress example due to IB usage
jeff-mccoy Jan 27, 2022
03408b0
fix arch mismatch logic / ui reporting
jeff-mccoy Jan 27, 2022
5345823
remove invalid log entry
jeff-mccoy Jan 27, 2022
9581b62
remove zarf init defaults for minimal install
jeff-mccoy Jan 27, 2022
e5afd05
add zarf connect for bb-single-package example
jeff-mccoy Jan 27, 2022
e5442c6
update kind cluster delete note
jeff-mccoy Jan 27, 2022
6ad630a
add missing files/arch for big bang examples
jeff-mccoy Jan 27, 2022
1f0a0fe
😭 move ns/secret mgmt into helm to fix raw manifest errors on ns crea…
jeff-mccoy Jan 27, 2022
72e9bb7
more updates for bb, this thing is a mess...
jeff-mccoy Jan 27, 2022
6990d15
Add default 'zarf connect' ports to Vagrantfile for dev testing
YrrepNoj Jan 27, 2022
a6c0533
Actually remove HandleIfURL tempPath early deletion
YrrepNoj Jan 27, 2022
b191492
Update e2e tests to work with native apply refactor
YrrepNoj Jan 27, 2022
5b3a059
Hybrid helm namespace management
jeff-mccoy Jan 28, 2022
ad4f644
small lint/pterm spinner cleanup
jeff-mccoy Jan 28, 2022
eb875aa
add recommended k8s managed-by labels to object creations
jeff-mccoy Jan 28, 2022
6cd0a6b
k8s secret code cleanup
jeff-mccoy Jan 28, 2022
880ad46
add kustomizations key for manifests to replace manual kustomizations
jeff-mccoy Jan 30, 2022
05e02ab
enable namespace-wide SA secret injection to remove imagepullsecrets req
jeff-mccoy Jan 30, 2022
893204e
add "zarf.dev/connect-url" annotation for url suffixes on zarf connect
jeff-mccoy Jan 30, 2022
94d3f4c
test multi-service zarf connect matching with url suffix
jeff-mccoy Jan 30, 2022
590b56b
update component flags in test to reflect k3s not being a default com…
jeff-mccoy Jan 30, 2022
526684e
add safer delay for k3s install
jeff-mccoy Jan 31, 2022
b9bddf2
update zarf game e2e test package name
jeff-mccoy Jan 31, 2022
6ae00d3
fix panic on registry catalog
jeff-mccoy Jan 31, 2022
ddad983
cleanup postgres operator example
jeff-mccoy Jan 31, 2022
c20a01b
add "secretName" key for components to change the default injected se…
jeff-mccoy Jan 31, 2022
9aee430
wip big bang testing
jeff-mccoy Jan 31, 2022
7ea32ad
add secretName to config schema
jeff-mccoy Jan 31, 2022
b91c514
operators are messy, keep imagepullsecret for tiny-kafka
jeff-mccoy Jan 31, 2022
74d139b
more postgres example cleanup
jeff-mccoy Feb 1, 2022
94486f6
update postgres example with zarf connect & secret injection
jeff-mccoy Feb 1, 2022
259b6f3
remove e2e pre-reqs no longer needed by zarf
jeff-mccoy Feb 1, 2022
631a429
e2e test cleanup
jeff-mccoy Feb 1, 2022
bbb40b6
Remove git-based helm chart test
jeff-mccoy Feb 1, 2022
7de3bff
update package deploy order to not make flux sad
jeff-mccoy Feb 1, 2022
07c45a7
increase registry limits for larger image pushes
jeff-mccoy Feb 1, 2022
6a3a3e2
simplify e2e curl command
YrrepNoj Feb 1, 2022
83ae0b9
fix spacing in logging e2e bash command
YrrepNoj Feb 1, 2022
e025dbb
slight modifications to example README's after multi-distro changes (…
YrrepNoj Feb 2, 2022
d328b69
update bb example, still image pull sadness for now
jeff-mccoy Feb 2, 2022
b8dbfc2
update e2e gitops for refactored test boilerplate
jeff-mccoy Feb 2, 2022
61150f6
Fix tool subcommand to get git credentials
YrrepNoj Feb 2, 2022
3c67c65
Fix gitops e2e test to use tunneled ports
YrrepNoj Feb 2, 2022
4ccef73
Add gitops data package creation prior to e2e test
YrrepNoj Feb 2, 2022
5170755
Update docs for native-apply branch
YrrepNoj Feb 2, 2022
a585e22
Clean up dead code and add image specs to values.yaml (#262)
RothAndrew Feb 3, 2022
53101f9
Updates for Big Bang example to PR #237 (#267)
RothAndrew Feb 4, 2022
1baf253
Multi-Distro Support - Update Docs (#289)
RothAndrew Feb 8, 2022
74c3dc8
Update gitops-data example docs (#290)
RothAndrew Feb 8, 2022
c95de62
update post-render to retry updating service account on error (#269)
YrrepNoj Feb 8, 2022
54edd51
Update tiny-kafka docs
jeff-mccoy Feb 8, 2022
864b47d
Update postgres-operator example & docs (#291)
RothAndrew Feb 8, 2022
d997ff1
update single-big-bang-package example docs
jeff-mccoy Feb 8, 2022
f4e5aa3
update data injection example docs
jeff-mccoy Feb 8, 2022
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
97 changes: 0 additions & 97 deletions .github/workflows/test-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -457,103 +457,6 @@ jobs:
GITHUB_REF: ${{ github.event.client_payload.pull_request.head.ref }}
GITHUB_OWNER: ${{ github.event.client_payload.github.payload.repository.owner.login }}

# Run the E2E test of a Git-based Helm chart
e2e-git-based-helm-chart:
runs-on: ubuntu-latest
needs: [parse, build]
if: needs.parse.outputs.run-e2e == 'true'
container: cloudposse/test-harness:latest
steps:
# Update GitHub status for pending pipeline run
- name: "Update GitHub Status for pending"
uses: docker://cloudposse/github-status-updater
with:
args: "-action update_state -ref ${{ github.event.client_payload.pull_request.head.sha }} -repo ${{ github.event.client_payload.github.payload.repository.name }}"
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
GITHUB_STATE: pending
GITHUB_CONTEXT: "/test e2e - Git-Based Helm Chart"
GITHUB_DESCRIPTION: "started by @${{ github.event.client_payload.github.actor }}"
GITHUB_TARGET_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
GITHUB_REF: ${{ github.event.client_payload.pull_request.head.ref }}
GITHUB_OWNER: ${{ github.event.client_payload.github.payload.repository.owner.login }}

# Checkout the code from GitHub Pull Request
- name: "Checkout the code"
uses: actions/checkout@v2
with:
token: ${{ secrets.PAT }}
repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }}
ref: ${{ github.event.client_payload.pull_request.head.ref }}

# Download the built artifacts
- name: "Download the built artifacts"
uses: actions/download-artifact@v2

- name: "Run E2E tests"
shell: bash -x -e -o pipefail {0}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_DEFENSEUNICORNS_COMMERCIAL_SA_ZARF }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_DEFENSEUNICORNS_COMMERCIAL_SA_ZARF }}
AWS_DEFAULT_REGION: us-east-1
run: |
# cloudposse/test-harness has golang 1.15, we need 1.16. This is the easiest way I know to do it. This should definitely be revisited and cleaned up.
git clone --branch v0.8.0 --depth 1 https://github.com/asdf-vm/asdf.git $HOME/.asdf
source ~/.asdf/asdf.sh
export PATH="$HOME/.asdf/bin:$PATH"
asdf plugin-add golang https://github.com/kennyp/asdf-golang.git
asdf install golang 1.16.7
asdf global golang 1.16.7
export GOPATH="$HOME/go"
export PATH="$PATH:$GOPATH/bin"
chmod +x build/zarf
./build/zarf tools registry login registry1.dso.mil --username "${{ secrets.REGISTRY1_USERNAME_ZARF_ROBOT }}" --password "${{ secrets.REGISTRY1_PASSWORD_ZARF_ROBOT }}"
make test-cloud-e2e-git-based-helm-chart

# Update GitHub status for failing pipeline run
- name: "Update GitHub Status for failure"
if: ${{ failure() }}
uses: docker://cloudposse/github-status-updater
with:
args: "-action update_state -ref ${{ github.event.client_payload.pull_request.head.sha }} -repo ${{ github.event.client_payload.github.payload.repository.name }}"
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
GITHUB_STATE: failure
GITHUB_CONTEXT: "/test e2e - Git-Based Helm Chart"
GITHUB_DESCRIPTION: "run failed"
GITHUB_TARGET_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
GITHUB_REF: ${{ github.event.client_payload.pull_request.head.ref }}
GITHUB_OWNER: ${{ github.event.client_payload.github.payload.repository.owner.login }}

# Update GitHub status for successful pipeline run
- name: "Update GitHub Status for success"
uses: docker://cloudposse/github-status-updater
with:
args: "-action update_state -ref ${{ github.event.client_payload.pull_request.head.sha }} -repo ${{ github.event.client_payload.github.payload.repository.name }}"
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
GITHUB_STATE: success
GITHUB_CONTEXT: "/test e2e - Git-Based Helm Chart"
GITHUB_DESCRIPTION: "run passed"
GITHUB_TARGET_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
GITHUB_REF: ${{ github.event.client_payload.pull_request.head.ref }}
GITHUB_OWNER: ${{ github.event.client_payload.github.payload.repository.owner.login }}

# Update GitHub status for cancelled pipeline run
- name: "Update GitHub Status for cancelled"
if: ${{ cancelled() }}
uses: docker://cloudposse/github-status-updater
with:
args: "-action update_state -ref ${{ github.event.client_payload.pull_request.head.sha }} -repo ${{ github.event.client_payload.github.payload.repository.name }}"
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
GITHUB_STATE: error
GITHUB_CONTEXT: "/test e2e - Git-Based Helm Chart"
GITHUB_DESCRIPTION: "run cancelled"
GITHUB_TARGET_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
GITHUB_REF: ${{ github.event.client_payload.pull_request.head.ref }}
GITHUB_OWNER: ${{ github.event.client_payload.github.payload.repository.owner.login }}

# Run E2E test for general CLI stuff
e2e-general-cli:
runs-on: ubuntu-latest
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ rpms/
data/
*.vbox
bundle/
charts/
.idea/
.tool-versions
test/tf/public-ec2-instance/.test-data
test/tf/public-ec2-instance/.terraform
terraform.tfstate
terraform.tfstate.backup
.terraform.lock.hcl

.zarf*
zarf-pki
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ repos:
rev: v4.0.1
hooks:
- id: check-added-large-files
args: ['--maxkb=1024']
- id: check-merge-conflict
- id: detect-aws-credentials
args:
Expand Down
5 changes: 2 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
"program": "${workspaceFolder}/cli",
"env": {},
"args": [
"package",
"create",
"--confirm"
"connect",
"doom"
]
},

Expand Down
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,11 @@ test-cloud-e2e-gitops: package-example-gitops-data ## E2E test of Gitops example
test-cloud-e2e-data-injection: package-example-data-injection ## E2E test of the Data Injection example. Requires access to an AWS account. Costs money. Make sure you ran the `build-cli` and `init-package` targets first
cd test/e2e && go test ./... -run TestDataInjection -v -timeout 1200s

################ BEGIN Pending removal post-merge
.PHONY: test-cloud-e2e-git-based-helm-chart
test-cloud-e2e-git-based-helm-chart: package-example-single-big-bang-package ## E2E test of the Data Injection example. Requires access to an AWS account. Costs money. Make sure you ran the `build-cli` and `init-package` targets first
cd test/e2e && go test ./... -run TestGitBasedHelmChart -v -timeout 1200s
test-cloud-e2e-git-based-helm-chart:
echo done
################ END Pending removal post-merge

.PHONY: test-cloud-e2e-general-cli
test-cloud-e2e-general-cli: ## Runs tests of the CLI that don't need a cluster
Expand Down
37 changes: 37 additions & 0 deletions assets/charts/gitea-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
persistence:
storageClass: "###ZARF_STORAGE_CLASS###"
gitea:
admin:
username: "zarf-git-user"
password: "###ZARF_GIT_AUTH_PUSH###"
email: "zarf@localhost"
cache:
builtIn:
enabled: false
config:
APP_NAME: "Zarf Gitops Service"
server:
DISABLE_SSH: true
OFFLINE_MODE: true
database:
DB_TYPE: sqlite3
# Note that the init script checks to see if the IP & port of the database service is accessible, so make sure you set those to something that resolves as successful (since sqlite uses files on disk setting the port & ip won't affect the running of gitea).
HOST: docker-registry.zarf.svc.cluster.local:5000
security:
INSTALL_LOCK: true
service:
DISABLE_REGISTRATION: true
repository:
ENABLE_PUSH_CREATE_USER: true
FORCE_PRIVATE: true
database:
builtIn:
postgresql:
enabled: false
resources:
requests:
cpu: "200m"
memory: "512Mi"
limits:
cpu: "1"
memory: "2Gi"
31 changes: 31 additions & 0 deletions assets/charts/pgl-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
grafana:
enabled: true
adminUser: "zarf-admin"
adminPassword: "###ZARF_LOGGING_AUTH###"
grafana.ini:
server:
root_url: "%(protocol)s://%(domain)s/monitor"
serve_from_sub_path: true
promtail:
extraScrapeConfigs:
- job_name: journal
journal:
max_age: 12h
labels:
job: systemd-journal
relabel_configs:
- source_labels: ["__journal__systemd_unit"]
target_label: "unit"
- source_labels: ["__journal__hostname"]
target_label: "hostname"

# Mount journal directory into promtail pods
extraVolumes:
- name: journal
hostPath:
path: /var/log/journal

extraVolumeMounts:
- name: journal
mountPath: /var/log/journal
readOnly: true
2 changes: 2 additions & 0 deletions assets/charts/registry-values-seed.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
image:
repository: "###ZARF_SEED_REGISTRY###/library/registry"
20 changes: 20 additions & 0 deletions assets/charts/registry-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
persistence:
enabled: true
storageClass: "###ZARF_STORAGE_CLASS###"
image:
repository: "###ZARF_REGISTRY###/library/registry"
secrets:
htpasswd: "###ZARF_HTPASSWD###"
# https://github.com/containerd/containerd/blob/v1.5.8/pkg/cri/server/image_pull.go#L412
# thx containerd *magic* :-D
# tlsSecretName: tls-pem
service:
type: NodePort
nodePort: "###ZARF_REGISTRY_NODEPORT###"
resources:
requests:
cpu: "500m"
memory: "256Mi"
limits:
cpu: "3"
YrrepNoj marked this conversation as resolved.
Show resolved Hide resolved
memory: "2Gi"
74 changes: 0 additions & 74 deletions assets/manifests/gitops/gitea.yaml

This file was deleted.

68 changes: 0 additions & 68 deletions assets/manifests/logging/pgl-stack.yaml

This file was deleted.

Loading