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

[NET-11567] Update Helm Chart to allow snapshotagent to support extraVolumes and extraEnvionmentVars #4471

Merged

Conversation

sarahalsmiller
Copy link
Member

@sarahalsmiller sarahalsmiller commented Feb 4, 2025

Changes proposed in this PR

  • Add support for server.snapshotAgent.extraEnvironment and server.snapshotAgent.extraVolume in the helm chart to allow for configuring google application credentials

How I've tested this PR

  • Running locally against a kind cluster with the snapshot agent configured to point at a google bucket

Using the following config

Google application credentials loaded into cluster with the following secret name/secret key

   name: snapshot-agent-google-app-creds
   key: creds.json

configSecret

kubectl create secret generic snapshot-config --from-file=snapshot-agent=<path-to-config-below>/snapshotagentconfig.yaml
{
  "snapshot_agent": {
    "http_addr": "127.0.0.1:8500",
    "token": "",
    "datacenter": "",
    "ca_file": "",
    "ca_path": "",
    "cert_file": "",
    "key_file": "",
    "license_path": "",
    "tls_server_name": "",
    "login": {
      "auth_method": "",
      "bearer_token": "",
      "bearer_token_file": "",
      "meta": {}
    },
    "log": {
      "level": "INFO",
      "enable_syslog": false,
      "syslog_facility": "LOCAL0"
    },
    "snapshot": {
      "interval": "5m",
      "retain": 30,
      "stale": false,
      "service": "consul-snapshot",
      "deregister_after": "76h",
      "lock_key": "consul-snapshot/lock",
      "max_failures": 3,
      "local_scratch_path": "/home/consul"
    },
    "backup_destinations": {
      "google_storage": [
        {
          "bucket": "snapshot-test-bucket-2-4-2025"
        }
      ]
    }
  }
}

config.yaml

---
global:
  image: 'hashicorp/consul-enterprise:1.20.0-ent'
  enterpriseLicense:
    secretName: 'consul-ent-license'
    secretKey: 'key'

server:
  snapshotAgent:
    enabled: true
    interval: "30s"
    fakevalue: false
    configSecret:
      secretName: snapshot-config
      secretKey: snapshot-agent
    extraEnvironmentVars:
      GOOGLE_APPLICATION_CREDENTIALS: /consul/userconfig/snapshot-agent-google-app-creds/creds.json
    extraVolumes:
      - type: secret
        name: snapshot-agent-google-app-creds
Screenshot 2025-02-04 at 3 22 34 PM Screenshot 2025-02-04 at 3 22 51 PM

How I expect reviewers to test this PR

  • Read and verify screenshots

Checklist

@sarahalsmiller sarahalsmiller changed the title [NET-11567] WIP- Update Helm Chart to allow snapshotagent to supposed extraVolumes and extraEnvio [NET-11567] Update Helm Chart to allow snapshotagent to supposed extraVolumes and extraEnvio Feb 4, 2025
@sarahalsmiller sarahalsmiller marked this pull request as ready for review February 4, 2025 21:38
@sarahalsmiller sarahalsmiller requested review from a team as code owners February 4, 2025 21:38
@sarahalsmiller sarahalsmiller added backport/1.1.x Backport to release/1.1.x branch backport/1.4.x backport/1.5.x backport/1.6.x Changes are backported to 1.6 labels Feb 4, 2025
@sarahalsmiller sarahalsmiller changed the title [NET-11567] Update Helm Chart to allow snapshotagent to supposed extraVolumes and extraEnvio [NET-11567] Update Helm Chart to allow snapshotagent to support extraVolumes and extraEnvionmentVars Feb 4, 2025
Copy link
Collaborator

@NiniOak NiniOak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

@trujillo-adam trujillo-adam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving as a code owner to unblock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.1.x Backport to release/1.1.x branch backport/1.4.x backport/1.5.x backport/1.6.x Changes are backported to 1.6
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants