Skip to content

Commit

Permalink
Add a readme and examples
Browse files Browse the repository at this point in the history
  • Loading branch information
orf committed Nov 25, 2024
1 parent 9fd70a2 commit 2c9ac23
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repos:
- id: yamlfmt
files: .*.(yaml|yml)
exclude: (templates|.github)/
args: [--mapping, '2', --sequence, '2', --offset, '0']
args: [--mapping, '2', --sequence, '2', --offset, '0', --preserve-quotes, --preserve_null]
- repo: local
hooks:
- entry: ./scripts/bundle_schemas.sh
Expand Down
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,45 @@
# GitGuardian NHI Helm Charts

## Installation

Add the repository to Helm with:

```shell
helm repo add gg-nhi https://gitguardian.github.io/nhi-explorer-helm-charts
```

Then install the explorer, with a values file (examples below):

```shell
helm upgrade explorer gg-nhi/nhi-explorer --install --values values.yml
```

An example values file that fetches from HashiCorp Vault:

```yaml
inventory:
# Run every 15 minutes
schedule: '*/15 * * * *'
config:
sources:
vault-secrets:
type: hashicorpvault
vault_address: "https://your-vault-address-here"
# Token configuration can be read from environment variables like so:
auth_token: "${HASHICORP_VAULT_TOKEN}"
fetch_all_versions: true
path: "secret/"

# This needs to be created separately, and contain a `HASHICORP_VAULT_TOKEN` key with
# the token to use.
envFrom:
- secretRef:
name: hashicorpvault-secrets
```
Other examples can be found in [charts/nhi-explorer/examples](charts/nhi-explorer/examples).
## Development
Install the [helm unittest plugin](https://github.com/helm-unittest/helm-unittest)
Expand Down
2 changes: 1 addition & 1 deletion charts/nhi-explorer/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.5
version: 0.1.6

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
8 changes: 8 additions & 0 deletions charts/nhi-explorer/examples/k8s/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
apiVersion: v1
kind: Secret
metadata:
name: test-secret
stringData:
secret-one: "some-secret-value"
secret-two: "another-secret-value"
8 changes: 8 additions & 0 deletions charts/nhi-explorer/examples/k8s/values_k8s.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
# yaml-language-server: $schema=../../values.schema.json

inventory:
config:
sources:
vault-secrets:
type: k8s
5 changes: 3 additions & 2 deletions charts/nhi-explorer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ inventory:
version: 0.6.1
upload: false
# Schedule to run the collection on
schedule: '* * * * *'
config:
schedule: '*/15 * * * *'
# Need to add this explicitly
config: null

# This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/
image:
Expand Down

0 comments on commit 2c9ac23

Please sign in to comment.