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

Use ECR as an external registry during 'Zarf Init' #1594

Closed
YrrepNoj opened this issue Apr 12, 2023 · 4 comments · Fixed by defenseunicorns/zarf-init-aws#1
Closed

Use ECR as an external registry during 'Zarf Init' #1594

YrrepNoj opened this issue Apr 12, 2023 · 4 comments · Fixed by defenseunicorns/zarf-init-aws#1
Assignees
Labels
enhancement ✨ New feature or request
Milestone

Comments

@YrrepNoj
Copy link
Contributor

YrrepNoj commented Apr 12, 2023

Is your feature request related to a problem? Please describe.

As Ashton I want an easy way to deploy Zarf configured with ECR as an external registry so that I can take advantage of the HA benefits of running a registry out of the cluster in AWS.

Describe the solution you'd like

  • Given I have a fresh EKS cluster and IAM access to ECR
  • When I run zarf init with an ECR registry domain configured
  • Then Zarf successfully initializes the cluster
  • And Creates the ECR repositories for me
  • And (optional for this issue) Creates a mechanism to keep the private-registry credentials up to date.

Additional context

ECR has a few 'unique' quirks that make it difficult to use as an external registry at the moment.

  1. ECR credentials are only valid for 12 hours, so something within clusters would have to refresh the zarf image pull secrets so that the kubelet is able to authenticate and pull images from ECR during package deployments.

  2. ECR registries do not have the ability to 'push to create' repositories that do not exist yet. Since Zarf packages will be pushing all sorts of images into the registry when the package is being deployed, this is a pretty big blocker.

Using ECR as an external registry would be really useful for a lot of people so we should implement some solution to the two issues above.

@github-project-automation github-project-automation bot moved this to New Requests in Zarf Project Board Apr 12, 2023
Racer159 added a commit that referenced this issue Apr 18, 2023
…ushes (#1590)

## Description

This PR creates a tunnel per image push (making it easier to implement
concurrency - may do that in this PR if we can confirm that issues are
mitigated) moves the CRC from the image name to the tag and changes the
UI to use a progressbar instead of a spinner for better user feedback.

## Related Issue

Relates to #1568 , #1433, #1218, #1364

This also will make #1594 slightly easier.

(See aws/containers-roadmap#853)

Fixes: #1541

## Type of change

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

## Checklist before merging

- [X] Test, docs, adr added or updated as needed
- [X] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/CONTRIBUTING.md#developer-workflow)
followed
@Racer159 Racer159 added this to the v0.27 (m2) milestone Apr 25, 2023
@Racer159 Racer159 added the enhancement ✨ New feature or request label May 10, 2023
@Racer159
Copy link
Contributor

Racer159 commented May 10, 2023

@Racer159
Copy link
Contributor

Ideas:

This could be solved with something like a preDeploy hook and the ability to inspect a package for a list of images and repos. (would keep things out of the zarf code).

We could also have a long running pod that we call out to in a standardized way

We could include AWS specific code inside of Zarf.

@ntwkninja
Copy link
Contributor

  1. ECR credentials are only valid for 12 hours, something within clusters would have to refresh the zarf-secret so that agent is able to correctly redirect push/pull requests to the image registry

We may want to document setting up an IAM role (that can be assumed) as a pre-requisite and have zarf be opinionated to use assume-role so it doesn't need to worry about static creds and rotations

@Racer159 Racer159 modified the milestones: (2023.06.20), (2023.07.18) Jun 24, 2023
@Racer159 Racer159 modified the milestones: (2023.07.18), (2023.08.01) Jul 20, 2023
@Racer159 Racer159 assigned lucasrod16 and unassigned YrrepNoj Sep 26, 2023
@Racer159 Racer159 modified the milestones: (2023.09.12), (2023.10.10) Sep 30, 2023
Racer159 added a commit that referenced this issue Oct 2, 2023
Relates to #1594

This PR adapts the way that Zarf saves the package-secrets so that the
secrets are now updated more frequently and can be used as an indicator
of what a package is about to (and is the process of) deploying. These
more frequently updated secrets can be viewed and acted upon by a
webhook such as `Pepr`.

As Zarf updates the secrets, it will check to see if a webhook has
mutated the component webhook `status` of the secret to `Running` and
respectfully wait for the webhook to change the `status` of the secret
back to indicate whatever non-async work has been completed.

The `--skip-webhooks` flag can be used to tell Zarf to skip
checking/waiting for webhooks to complete during package deployments:

`zarf package deploy [package tarball] --skip-webhooks`

---------

Co-authored-by: Wayne Starr <Racer159@users.noreply.github.com>
Co-authored-by: Lucas Rodriguez <lucas.rodriguez@defenseunicorns.com>
Co-authored-by: Lucas Rodriguez <lucas.rodriguez9616@gmail.com>
@lucasrod16
Copy link
Contributor

Noting that the solution for this will be implemented in this repo:
https://github.com/defenseunicorns/zarf-init-aws

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request
Projects
None yet
4 participants