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

Add a variable shorthand for helm values #2133

Closed
Racer159 opened this issue Nov 8, 2023 · 3 comments
Closed

Add a variable shorthand for helm values #2133

Racer159 opened this issue Nov 8, 2023 · 3 comments
Assignees
Labels
enhancement ✨ New feature or request needs-adr PR Label - Architectural Decision Records required to merge
Milestone

Comments

@Racer159
Copy link
Contributor

Racer159 commented Nov 8, 2023

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

As Ezra I want a way to tie Zarf variables to Helm values so that I can more efficiently template values in the packages I build.

Describe the solution you'd like

  • Given I have a Helm Chart
  • And I have a variable I would like to template into its values
  • When I specify a new key on a chart under charts including the Zarf variable and the Helm value
  • Then that Zarf variable is set as that Helm value on deployments and templates of that chart.

Describe alternatives you've considered

Folks could use the existing logic and add templates but this simplifies things and allows people to more directly take advantage of Helm templating and featuresets without having to do a lot of manual wiring.

Additional context

This is being implemented in library form first through #2131

@Racer159 Racer159 added the enhancement ✨ New feature or request label Nov 8, 2023
@Racer159 Racer159 added this to the The Bucket milestone Nov 8, 2023
@Racer159
Copy link
Contributor Author

Racer159 commented Mar 6, 2024

An example of how this might look:

# yaml-language-server: $schema=https://raw.githubusercontent.com/defenseunicorns/zarf/main/zarf.schema.json
kind: ZarfPackageConfig
metadata:
  name: gitlab-common
  description: "UDS GitLab Common Package"

variables:
  - name: MIGRATIONS_RESOURCES
    description: "Gitlab Migrations Resources"
    prompt: true

components:
  - name: gitlab
    required: true
    charts:
      - name: uds-gitlab-config
        namespace: gitlab
        version: 0.1.0
        localPath: ../chart
      - name: gitlab
        namespace: gitlab
        url: https://repo1.dso.mil/big-bang/product/packages/gitlab.git
        gitPath: chart
        version: "7.9.1-bb.0"
        variables:
          - name: MIGRATIONS_RESOURCES
            description: "Gitlab Migrations Resources"
            path: "gitlab.migrations.resources"
          - name: WEBSERVICE_REPLICAS
            description: "Gitlab Webservice Min Replicas"
            path: "gitlab.webservice.minReplicas"
          - name: WEBSERVICE_RESOURCES
            description: "Gitlab Webservice Resources"
            path: "gitlab.webservice.resources"
          - name: WORKHORSE_RESOURCES
            description: "Gitlab Workhorse Resources"
            path: "gitlab.workhorse.resources"
          - name: SIDEKIQ_REPLICAS
            description: "Gitlab Sidekiq Min Replicas"
            path: "gitlab.sidekiq.minReplicas"
          - name: SIDEKIQ_RESOURCES
            description: "Gitlab Sidekiq Resources"
            path: "gitlab.sidekiq.resources"
          - name: REGISTRY_REPLICAS
            description: "Gitlab Registry Min Replicas"
            path: "registry.hpa.minReplicas"
          - name: SHELL_REPLICAS
            description: "Gitlab Shell Min Replicas"
            path: "gitlab.gitlab-shell.minReplicas"
        valuesFiles:
          - ../values/common-values.yaml

@Racer159 Racer159 added the needs-adr PR Label - Architectural Decision Records required to merge label Mar 12, 2024
@naveensrinivasan naveensrinivasan self-assigned this Mar 15, 2024
@Racer159
Copy link
Contributor Author

@Racer159
Copy link
Contributor Author

The function these get put in:

func WithDeployInfo(component types.ZarfComponent, cfg *types.PackagerConfig, cluster *cluster.Cluster, valuesOverrides map[string]any, timeout time.Duration, retries int) Modifier {

Existing TODO:

// TODO (@WSTARR): Currently this logic is library-only and is untested while it is in an experimental state - it may eventually get added as shorthand in Zarf Variables though

naveensrinivasan added a commit that referenced this issue Mar 25, 2024
- This feature allows chart deployment overrides.
- #2133

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
naveensrinivasan added a commit that referenced this issue Mar 25, 2024
- This feature allows chart deployment overrides.
- #2133

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
naveensrinivasan added a commit that referenced this issue Mar 25, 2024
- This feature allows chart deployment overrides.
- #2133

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
naveensrinivasan added a commit that referenced this issue Mar 28, 2024
- This feature allows chart deployment overrides.
- #2133

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
naveensrinivasan added a commit that referenced this issue Apr 4, 2024
- This feature allows chart deployment overrides.
- #2133

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
naveensrinivasan added a commit that referenced this issue Apr 8, 2024
- This feature allows chart deployment overrides.
- #2133

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
Noxsios added a commit that referenced this issue Apr 9, 2024
## Description
- This feature allows chart deployment overrides.

## Related Issue

Relates to #2133

## Type of change

- [ ] 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

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

---------

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
Co-authored-by: Lucas Rodriguez <lucas.rodriguez9616@gmail.com>
Co-authored-by: razzle <harry@razzle.cloud>
Co-authored-by: Austin Abro <37223396+AustinAbro321@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request needs-adr PR Label - Architectural Decision Records required to merge
Projects
No open projects
Status: No status
Development

No branches or pull requests

2 participants