Compare commits

..

562 commits
v0.0.1 ... main

Author SHA1 Message Date
Jan Martens
6f5aa63325
Merge pull request #23 from ipsavitsky/fix-agent-uri
Add the `.injector.agentImage.registry` to the image path
2024-11-13 09:53:23 +01:00
Ilya Savitsky
766a6a341f
Add the .injector.agentImage.registry to the image path
Signed-off-by: Ilya Savitsky <ilya.savitsky@codethink.co.uk>
2024-10-23 10:41:11 +01:00
Jan Martens
72b4014e67
Merge pull request #20 from openbao/bao-2-0-2
update chart README
2024-10-07 13:51:17 +02:00
Jan Martens
5f31acad6b
update chart README
To display the up to date values

Signed-off-by: Jan Martens <jan@martens.eu.org>
2024-10-07 11:05:13 +02:00
Jan Martens
7a7a5b3711
Merge pull request #19 from openbao/bao-2-0-2
Update OpenBao to v2.0.2
2024-10-07 10:57:59 +02:00
Jan Martens
2e7c23ce62
update chart version
Signed-off-by: Jan Martens <jan@martens.eu.org>
2024-10-06 23:51:14 +02:00
Jan Martens
4549ad2b10
fix CSI driver integration
Signed-off-by: Jan Martens <jan@martens.eu.org>
2024-10-06 23:51:14 +02:00
Jan Martens
c5b02f372f
fix secret injector integration
Signed-off-by: Jan Martens <jan@martens.eu.org>
2024-10-06 23:04:13 +02:00
Jan Martens
3dd2dec9e3
update OpenBao to v2.0.2
Signed-off-by: Jan Martens <jan@martens.eu.org>
2024-10-06 23:04:13 +02:00
Finn
a6d9d9f388
Use the CSI agent image registry from configuration (#17)
* Use the CSI agent image registry from configuration

Signed-off-by: Finn <finn@janky.solutions>

* csi-driver agent: Use BAO_LOG_LEVEL and BAO_LOG_FORMAT

Signed-off-by: Finn <finn@janky.solutions>

---------

Signed-off-by: Finn <finn@janky.solutions>
2024-09-10 09:31:43 -04:00
Jan Martens
f9daaad711
Merge pull request #16 from openbao/bao-2-0-1
update used OpenBao Version to 2.0.1
2024-09-05 00:01:52 +02:00
Jan Martens
100bfce452
update chart README
Signed-off-by: Jan Martens <jan@martens.eu.org>
2024-09-04 23:54:05 +02:00
Jan Martens
e0be4ae6de
disable injector and CSI tests
We do not provide our own images for those components yet which is
causing some incompabilites and test failures

Signed-off-by: Jan Martens <jan@martens.eu.org>
2024-09-04 23:51:49 +02:00
Jan Martens
4f63aa2373
fix acceptance tests
Signed-off-by: Jan Martens <jan@martens.eu.org>
2024-09-04 23:51:49 +02:00
Jan Martens
d6a660e868
fix chart unit tests
Signed-off-by: Jan Martens <jan@martens.eu.org>
2024-09-04 23:51:48 +02:00
Jan Martens
5fba05f8f8
fix chart verifier tests
Signed-off-by: Jan Martens <jan@martens.eu.org>
2024-09-04 23:51:48 +02:00
Jan Martens
5d545983bf
update used OpenBao Version to 2.0.1
Signed-off-by: Jan Martens <jan@martens.eu.org>
2024-09-04 23:51:48 +02:00
Jan Martens
540d8c5309
Merge pull request #15 from jorge882/patch-1
Corrected Helm values.yaml file - prometheusRules
2024-09-03 23:11:35 +02:00
jorge882
a6f8ccdfed
Corrected Helm values.yaml file - prometheusRules
Corrected the alert: valut-HighResponseTime alert rules (lines 1325-26), as well as the documentation (1324) to properly reflect a 10 minute threshold for the critical warning.

Signed-off-by: jorge882 <jorge882@gmail.com>
2024-08-23 12:24:36 -05:00
Tijmen
ad8307d533
Remove hashicorp documentation links from values.yaml (#13)
Signed-off-by: Tijmen <17317361+Btijmen@users.noreply.github.com>
2024-08-08 21:13:31 +09:00
jessebot
d5dba29bf5 more updates of vault to openbao, and more updates of old k8s versions
Signed-off-by: jessebot <jessebot@linux.com>
2024-05-29 10:43:12 -04:00
jessebot
547020f267 update all the tests to use kube-version 1.27.x instead of 1.22.x so we're supporting supported versions of kubernetes
Signed-off-by: jessebot <jessebot@linux.com>
2024-05-29 10:43:12 -04:00
jessebot
8f700eb551 fix chart dir for unit tests
Signed-off-by: jessebot <jessebot@linux.com>
2024-05-29 10:43:12 -04:00
jessebot
bfd5135800 clean up more references to vault and licensing
Signed-off-by: jessebot <jessebot@linux.com>
2024-05-29 10:43:12 -04:00
jessebot
b473c07acc update more vault to openbao everywhere
Signed-off-by: jessebot <jessebot@linux.com>
2024-05-29 10:43:12 -04:00
jessebot
f15d0f69f9 remove enterprise tests
Signed-off-by: jessebot <jessebot@linux.com>
2024-05-29 10:43:12 -04:00
jessebot
4f8924d1d7 replace vault command with bao and helm install/delete vault with openbao - part 1
Signed-off-by: jessebot <jessebot@linux.com>
2024-05-29 10:43:12 -04:00
jessebot
7b8c26e1ce update keywords for Chart.yaml to include openbao
Signed-off-by: jessebot <jessebot@linux.com>
2024-05-29 10:43:12 -04:00
jessebot
18652008f4 fix openshift values to use openbao docker images
Signed-off-by: jessebot <jessebot@linux.com>
2024-05-29 10:43:12 -04:00
JesseBot
534811b617 Update charts/openbao/Chart.yaml - fix email to be valid email address
Signed-off-by: JesseBot <jessebot@linux.com>
2024-05-29 10:43:12 -04:00
jessebot
5278ab9ced update email for chart and regenerate docs
Signed-off-by: jessebot <jessebot@linux.com>
2024-05-29 10:43:12 -04:00
jessebot
a139a100bf attempt to fix helm install in bats tests
Signed-off-by: jessebot <jessebot@linux.com>
2024-05-29 10:43:12 -04:00
jessebot
d6a7dce06c we now use /openbao/config instead of /vault/config
ref: 8283776683/Dockerfile (L45)

also change types from null to [] to be more explicit and regenerate docs

Signed-off-by: jessebot <jessebot@linux.com>
2024-05-29 10:43:12 -04:00
jessebot
754c4ee94d the command is bao not openbao 🤦
Signed-off-by: jessebot <jessebot@linux.com>
2024-05-29 10:43:12 -04:00
jessebot
2c9d040059 update the openbao helm chart test that runs after install to no longer use the vault command
Signed-off-by: jessebot <jessebot@linux.com>
2024-05-29 10:43:12 -04:00
Nathan Phelps
b59b6e55bb Issue 6: Removed Enterprise reference from chart's server-statefulset template.
Signed-off-by: Nathan Phelps <naphelps@us.ibm.com>
2024-05-20 17:43:17 -04:00
Nathan Phelps
675c249026 Issue 6: Removing Enterprise references from chart template helper.
Signed-off-by: Nathan Phelps <naphelps@us.ibm.com>
2024-05-20 17:43:17 -04:00
Nathan Phelps
c4b831e734 Issue 6: Updated the chart version to 0.3.0.
Signed-off-by: Nathan Phelps <naphelps@us.ibm.com>
2024-05-20 17:43:17 -04:00
Nathan Phelps
e5973aeff3 Issue 6: Removed Enterprise licensing references out of the chart's value configuration.
Signed-off-by: Nathan Phelps <naphelps@us.ibm.com>
2024-05-20 17:43:17 -04:00
Nathan Phelps
be6fa5a195 Issue 6: Changed some of the Hashicorp Vault refences in the docs to OpenBao.
Signed-off-by: Nathan Phelps <naphelps@us.ibm.com>
2024-05-20 17:43:17 -04:00
jessebot
7ad371f159 fix missing space in comment
Signed-off-by: jessebot <jessebot@linux.com>
2024-05-20 17:08:36 -04:00
jessebot
cb464ff650 fix linter issues with values.yaml to please chart tesitng linter
ref: https://github.com/openbao/openbao-helm/actions/runs/9139677624/job/25132235295?pr=8
Signed-off-by: jessebot <jessebot@linux.com>
2024-05-20 17:08:36 -04:00
jessebot
cbf6f461e2 actually template out the image.registry for each image map reference
Signed-off-by: jessebot <jessebot@linux.com>
2024-05-20 17:08:36 -04:00
jessebot
915f7c845c update base vault images to point at quay.io/openbao/openbao; add more helm docs
Signed-off-by: jessebot <jessebot@linux.com>
2024-05-20 17:08:36 -04:00
JesseBot
ed58ce3e78 Update charts/openbao/Chart.yaml - use default branding image
Signed-off-by: JesseBot <jessebot@linux.com>
2024-05-17 08:18:38 -04:00
JesseBot
c16fc99e7c Update charts/openbao/Chart.yaml - update the maintainer to be OpenBao
Signed-off-by: JesseBot <jessebot@linux.com>
2024-05-17 08:18:38 -04:00
JesseBot
302fdc8a22 Update charts/openbao/Chart.yaml - fix chart description OpenBao casing
Signed-off-by: JesseBot <jessebot@linux.com>
2024-05-17 08:18:38 -04:00
jessebot
00ed536f64 add official openbao security email
Signed-off-by: jessebot <jessebot@linux.com>
2024-05-17 08:18:38 -04:00
jessebot
5544941fff begin changes to using openbao everywhere instead of vault
also begin massive change over to using helm's official chart release and testing actions

Signed-off-by: jessebot <jessebot@linux.com>
2024-05-17 08:18:38 -04:00
dependabot[bot]
c5f9247828
Bump helm/kind-action from 1.8.0 to 1.9.0 (#999)
Bumps [helm/kind-action](https://github.com/helm/kind-action) from 1.8.0 to 1.9.0.
- [Release notes](https://github.com/helm/kind-action/releases)
- [Commits](dda0770415...99576bfa6d)

---
updated-dependencies:
- dependency-name: helm/kind-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-22 18:26:53 -07:00
Ben Ash
dbfb243d03
Update code owners (#1006)
- ignore scratch dir
2024-03-19 16:07:57 -04:00
Theron Voran
e439b28914
injector: add get for nodes in clusterrole (#1005)
Required for operator-lib leader logic
2024-03-18 21:55:51 -07:00
Christopher Swenson
d186b6ff29
Add annotation on config change (#1001)
When updating the Vault config (and corresponding)
configmap, we now generate a checksum of the config
and set it as an annotation on both the configmap
and the Vault StatefulSet pod template.

This allows the deployer to know what pods need to
be restarted to pick up the a changed config.

We still recommend using the standard upgrade
[method for Vault on Kubernetes](https://developer.hashicorp.com/vault/tutorials/kubernetes/kubernetes-raft-deployment-guide#upgrading-vault-on-kubernetes),
i.e., using the `OnDelete` strategy
for the Vault StatefulSet, so updating the config
and doing a `helm upgrade` should not trigger the
pods to restart, and then deleting pods one
at a time, starting with the standby pods.

With `kubectl` and `jq`, you can check check which
pods need to be updated by first getting the value
of the current configmap checksum:

```shell
kubectl get pods -o json | jq -r ".items[] | select(.metadata.annotations.\"config/checksum\" != $(kubectl get configmap vault-config -o json | jq '.metadata.annotations."config/checksum"') ) | .metadata.name"
```

Fixes #748.

---------

Co-authored-by: Tom Proctor <tomhjp@users.noreply.github.com>
2024-03-18 11:03:56 -07:00
Ben Ash
6930c378d2
Test against k8s 1.29 (#1003)
* Drop k8s 1.24
* Use latest kind version v0.22.0
2024-03-11 15:23:14 -04:00
dependabot[bot]
7a127f878a
Bump actions/setup-go from 4.1.0 to 5.0.0 (#984)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4.1.0 to 5.0.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](93397bea11...0c52d547c9)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-08 12:07:19 -08:00
Theron Voran
50f7439fb2
Update to v0.27.0 (#978) 2023-11-16 13:47:57 -08:00
Alan Tang
3e16e05ba7
Add labels for PVC template (#969) 2023-11-15 17:55:09 -08:00
Marco Lecheler
e77dce38b2
feat: ingress rules for server networkPolicy (#877)
* feat: allow server netPol to specify podSelector

* feat(test): add podSelector NetworkPolicy unittest

* chore: introduce server.networkPolicy.ingress

As suggested let users template the whole ingress object for the
networkPolicy than only the podSelector.

Co-authored-by: tvoran <444265+tvoran@users.noreply.github.com>

---------

Co-authored-by: tvoran <444265+tvoran@users.noreply.github.com>
2023-11-15 16:42:26 -08:00
dependabot[bot]
97166e5207
Bump actions/checkout from 4.1.0 to 4.1.1 (#963)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](8ade135a41...b4ffde65f4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-13 23:08:38 -08:00
Aleix Murtra
ad64f921b5
Add persistentVolumeClaimRetentionPolicy variable to values.yaml (#965)
This variable is used to set the persistentVolumeClaimRetentionPolicy
value in the server-statefulset.yaml template, which is used to
configure the retention policy for the PVCs used by the server
statefulset.
2023-11-13 11:55:33 -08:00
Thy Ton
2bb6994dd9
support exec in server liveness probe (#971)
Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
2023-11-09 13:38:59 -08:00
Kyle Schochenmaier
36dafa02c0
Prepare for release 0.26.1 (#970)
* Prepare for release 0.26.1
2023-10-30 14:26:38 -05:00
Floris Heringa
9b3ceaac99
Fix check if server.ha.replicas is a number when set in values.yaml (#961) 2023-10-30 10:16:42 -05:00
Kyle Schochenmaier
f72df27d56
prepare for 0.26.0 release (#967)
* prepare for 0.26.0 release
2023-10-27 15:18:07 -05:00
Theron Voran
6f3f107ca5
openshift/server: readiness probe passes when server uninitialized (#966)
Changes the default server readiness probe to pass when the server is
uninitialized, in order to pass the latest version of the
chart-verifier test (see #954) for details.

Also updates the chart-verifier used in our tests to 1.13.0 (latest).
2023-10-26 00:08:53 -07:00
Theron Voran
24739373fb
Update actions, k8s and vault versions, and changelog (#962)
Pin github actions to the latest trusted versions, test with k8s
1.24-1.28, update vault and vault-k8s defaults to latest releases.

---------

Co-authored-by: Tom Proctor <tomhjp@users.noreply.github.com>
2023-10-13 09:58:54 -07:00
Kyle Schochenmaier
e2990d2913
changelog++ (#959) 2023-09-26 22:50:26 -05:00
tekicat
7728f8c650
Allow additional annotations for standby and active services via config (#896)
* Allow additional annotations for standby and active services via config
Co-authored-by: Kyle Schochenmaier <kschoche@gmail.com>
2023-09-26 15:28:54 -05:00
dependabot[bot]
0f47d83f36
Bump actions/setup-go from 4.0.1 to 4.1.0 (#938)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4.0.1 to 4.1.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](fac708d667...93397bea11)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-25 10:14:19 -05:00
dependabot[bot]
d3d472f948
Bump actions/checkout from 3.5.3 to 4.1.0 (#957)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.3 to 4.1.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](c85c95e3d7...8ade135a41)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-25 10:10:15 -05:00
Theron Voran
b13201831d
changelog++ (#956) 2023-09-18 13:17:00 -07:00
Milan Rafaj
3387881451
feat: add hostAliases for statefulset (#955) 2023-09-18 08:53:00 -07:00
Theron Voran
c3b2b14ffd
changelog++ (#946) 2023-08-24 15:16:24 -07:00
Arend Lapere
377b68f13b
Add support for dual stack clusters (#833) 2023-08-24 15:14:19 -07:00
Marco Lecheler
ea1c36922b
chore(test): use vault.fullname in Helm test (#912) 2023-08-23 11:30:35 -07:00
Tanmay Pereira Naik
c7353d1aea
docs: Update outdated vaultproject.io/docs/ links (#935)
Signed-off-by: Tanmay Pereira Naik <59953366+tanmay-pnaik@users.noreply.github.com>
2023-08-22 12:16:41 -07:00
gillcaleb
1e12d49d74
Add optional long lived SA token (#923)
---------

Co-authored-by: Caleb Gill <cgill@stavvy.com>
2023-08-17 14:05:50 +01:00
Johannes Siebel
ec964a33ea
Allow scale to zero (#943) 2023-08-15 10:50:25 +01:00
KhizerJaan
9a16496e86
Allows the release namespace to be overridden (#909) 2023-07-04 14:30:35 +01:00
Tom Proctor
e2711a2002
Prepare for 0.25.0 release (#916)
* Prepare for 0.25.0 release
* Update CSI acceptance test assertion

Starting in 1.4.0, the CSI provider caches Vault tokens locally. The main thing
we want to check is that the Agent cache is being used so that it's doing the
renewal legwork for any leased secrets, so check for the renewal log message instead
because CSI won't auth over and over anymore.
2023-06-26 16:00:04 +01:00
Daniel Kimsey
a86803d5c8
ci: Fix yq command syntax (#881)
The original CCI version used an older version of yq. The syntax changed and this was missed when ported.

Co-authored-by: Tom Proctor <tomhjp@users.noreply.github.com>
2023-06-19 15:57:16 +01:00
dependabot[bot]
785a5e7c12
Bump actions/setup-go from 4.0.0 to 4.0.1 (#891)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](4d34df0c23...fac708d667)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-14 11:24:45 +01:00
dependabot[bot]
38335f81c6
Bump actions/checkout from 3.5.2 to 3.5.3 (#910)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.2 to 3.5.3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](8e5e7e5ab8...c85c95e3d7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-14 10:54:53 +01:00
Theron Voran
cd30d9890a
csi: update affinity and nodeselector schema (#907)
array -> object
2023-06-06 22:51:14 -07:00
hashicorp-copywrite[bot]
1be10380d1
[COMPLIANCE] Add Copyright and License Headers (#905)
Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
2023-06-05 15:50:09 -07:00
Toninh0
3ce721fca4
CSI configurable nodeSelector and affinity (#862) 2023-06-01 10:38:22 +01:00
Tom Proctor
a56c27c892
Fix syntax for actionlint workflow (#903)
* Fix syntax for actionlint workflow
* Move .github/workflows/setup-test-tools/ -> .github/actions/setup-test-tools/
* Fix reported actionlint failures
2023-05-31 12:27:18 +01:00
Tom Proctor
da34c6c986
publishNotReadyAddresses for headless service always true (#902) 2023-05-30 15:54:00 +01:00
Theron Voran
3640daaf65
ci: upgrade kind-action and kind version (#899)
kind-action v1.5.0 -> v1.7.0
kind v0.17.0 -> v0.19.0

Add k8s 1.27 to testing, and update the rest of the kind image
versions.
2023-05-23 13:16:42 -07:00
risson
a276600b71
Default prometheusRules.rules should be an empty list (#886)
Support for prometheus-operator was added in
https://github.com/hashicorp/vault-helm/pull/772 and a default empty
set of rules was defined as an empty map `{}`. However, as evidenced
by the commented out rule examples below that very same values.yaml,
this is expected to be a list, so `rules:` value should be set to an
empty list `[]`.

Co-authored-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
Co-authored-by: Vitaliy <vitaliyf@users.noreply.github.com>
2023-05-17 22:01:22 -07:00
Krishnadas M
b9096ee15b
Make injected Agent ephemeral storage configurable through injector.agentDefaults (#798) 2023-05-17 13:59:05 +01:00
Ashish Kumar
582e7d0c3b
spelling fix (#888) 2023-05-15 09:54:41 -07:00
hashicorp-tsccr[bot]
14585a1331
Result of tsccr-helper -pin-all-workflows . (#882)
Co-authored-by: hashicorp-tsccr[bot] <hashicorp-tsccr[bot]@users.noreply.github.com>
2023-04-21 10:12:31 -07:00
Tom Proctor
a5d803ad3c
Fix chart version for 0.24.1 release (#880) 2023-04-17 18:48:39 +01:00
Tom Proctor
677c932e35
Prepare for 0.24.1 release (#879) 2023-04-17 18:14:59 +01:00
Tom Proctor
9954df5e68
Add role for creating CSI's HMAC secret key (#872) 2023-04-14 13:31:41 +01:00
Daniel Kimsey
ded705d732
Remove CircelCI (#871)
Follow-up of #861 and hashicorp/gha-migration#158
2023-04-12 17:18:40 +01:00
hc-github-team-es-release-engineering
bb9a069c06
Convert hashicorp/vault-helm to GitHub Actions (#861)
* Add workflow hashicorp/vault-helm/update-helm-charts-index

* Add workflow hashicorp/vault-helm/manual-trigger-update-helm-charts-index

* SHA-pin all 3rd-party actions

* Restrict workflow permissions

* Add actionslint

* Add dependabot

* Add CODEOWNERS

* Replace deprecated references

* fixup: First pass at cleaning up update-helm-charts-index

* fixup: move to self-hosted for access to vault

* fixup: remove vault bits, correct GHA action

* fixup: Remove manual invocation

* fixup: update CODEOWNERS

* Update CODEOWNERS

* Fix CODEOWNERS syntax

* Use common workflow for action lint

* fixup: address review feedback

* fixup: codeowners set

* Apply suggestions from code review

Co-authored-by: Alvin Huang <17609145+alvin-huang@users.noreply.github.com>

* fixup: remove slack status action

* fixup: more clear error message and correct syntax

* fixup: limit actionlint trigger to GHA paths

* fixup: glob

* fixup: incorporate emily's superior syntax

---------

Co-authored-by: Daniel Kimsey <daniel.kimsey@hashicorp.com>
Co-authored-by: Tom Proctor <tomhjp@users.noreply.github.com>
Co-authored-by: Daniel Kimsey <90741+dekimsey@users.noreply.github.com>
Co-authored-by: Alvin Huang <17609145+alvin-huang@users.noreply.github.com>
2023-04-12 09:19:02 -05:00
Theron Voran
1307dbea76
add copyright header to csi-agent-configmap.yaml (#870) 2023-04-11 11:00:47 -07:00
Christopher Swenson
d52c4a519d
Prepare for 0.24.0 release (#868) 2023-04-06 15:38:23 -07:00
Tom Proctor
0fe916481c
Add Vault Agent sidecar to CSI Provider (#749)
Adds Agent as a sidecar for the CSI Provider to:

* Cache k8s auth login leases
* Cache secret leases
* Automatically renew renewable leases in the background
2023-04-06 19:45:10 +01:00
Kyle Schochenmaier
fc7d4326fc
Add changelog for #831 (#867)
* Add changelog for #831
* fixes bats test
2023-04-04 10:21:42 -05:00
Bhargav Akhani
9f189801a6
Add portnumber (#831)
* Add configurable Port Number in readinessProbe and livenessProbe for the server-statefulset. 
Co-authored-by: Kyle Schochenmaier <kyle.schochenmaier@hashicorp.com>
2023-04-04 09:17:24 -05:00
Theron Voran
2c4cd3a3c3
Updating GHA and default Vault version (#863)
Test with latest kind k8s versions 1.22-1.26. Remove support for old
disruptionbudget and ingress APIs (pre 1.22).

Pin all actions to SHAs, and use the common jira sync.

Update the default Vault version to v1.13.1.

Update chart-verifier used in tests to 1.10.1, also add an openshift
name annotation to Chart.yaml (one of the required checks).
2023-04-03 16:44:13 -07:00
Thy Ton
932891778f
feat: make injector livenessProbe and readinessProbe configurable and add configurable startupProbe (#852) 2023-03-16 12:03:27 -07:00
Thy Ton
f4f05aaa74
fix: remove k8s 1.16 from acceptance testing (#848)
* remove 1.16 from the versions tested in .github/workflows/acceptance.yaml as kind no longer supports creating a k8s 1.16 cluster
* update vault-helm's minimum support k8s version to 1.20 in README and Chart.yaml
* refactor server-ingress's templating and unit tests applied to k8s versions < 1.20
2023-02-27 12:04:17 -08:00
Dimitar Zafirov
e31e70ea0b
Add extraPorts property (#841) 2023-02-16 10:49:07 -08:00
jordanfelle
34d8650cca
Fix typo in telemetry example (#846)
Also in the telemetry test
2023-02-16 09:07:41 -08:00
Theron Voran
742ddb1c52
adding SPDX copyright headers (#844) 2023-02-13 08:48:20 -08:00
Mariano Asselborn
c5c28cb385
Call helm publish workflow by file name without path (#843) 2023-02-13 10:58:13 -05:00
claire labry
a4e076b132
swap helm charts call to GHA (#840)
* swap helm charts call to GHA

* fix path for gh utility
2023-02-03 17:41:49 -06:00
Douglas Thomson
72914d873c
Amending docs (#828) 2023-01-12 09:38:29 -08:00
Tom Proctor
2d7fd5d565
Prepare for 0.23.0 release (#814) 2022-11-28 23:33:08 +00:00
Tom Proctor
c13151a6ac
server: Allow disabling the instance selector for services (#813) 2022-11-17 19:54:18 +00:00
Tom Proctor
21ce5245a3
Support selectively disabling active/standby services and service discovery role (#811) 2022-11-14 14:10:21 +00:00
Steven Kriegler
0110f977b2
Quote .server.ha.clusterAddr value (#810) 2022-11-09 14:19:38 -08:00
Aleksandr Titov
ab5b471c27
Add extraLabels for Vault server serviceAccount (#806) 2022-11-02 18:01:35 -07:00
Tom Proctor
46e6fb5ad1
Fix CircleCI config (#804)
* Fix CircleCI config

* Add manual trigger option
2022-10-27 11:37:38 +01:00
Tom Proctor
5d7014c7bb
Prepare to release to 0.22.1 (#803)
* Prepare to release to 0.22.1

* Revert chart verifier update for now

* Remove unused jobs from CircleCI config
2022-10-26 20:32:46 +01:00
hashicorp-copywrite[bot]
a3bbaea599
[COMPLIANCE] Add MPL 2.0 LICENSE (#800)
Co-authored-by: hashicorp-copywrite[bot] <noreply@hashicorp.com>
2022-10-12 14:55:30 -07:00
Tom Proctor
7e21a09ebd
Add server.hostNetwork option (#775) 2022-09-12 15:17:24 +01:00
Christopher Swenson
c15d83e397
Prepare for 0.22.0 release (#785)
Prepare for 0.21.1 release

* Update Vault to 1.11.3
2022-09-08 11:59:17 -07:00
Christopher Swenson
99d745ca0c
Update vault-k8s to 1.0.0 (#784)
Update vault-k8s to 1.0.0

Also update Kubernetes versions tested against, including adding 1.25

Update consul in tests for Kubernetes 1.25 support
2022-09-07 17:21:47 -07:00
Ben Ash
04074311f7
Add support for the Prometheus Operator (#772)
support collecting Vault server metrics by deploying PrometheusOperator
CustomResources.

Co-authored-by: Sam Weston <weston.sam@gmail.com>
Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
2022-09-01 13:07:49 -06:00
Ben Ash
8a6872e36d
CI: run acceptance tests on push to any (#781) 2022-09-01 12:39:38 -06:00
Theron Voran
85562b47c4
update values comments for server.securityContext (#778)
Since container is empty for openshift.
2022-08-26 10:05:44 -07:00
Alex Khaerov
9fa4c6c322
DOC: Minor typos fixes (#669)
Co-authored-by: Tom Proctor <tomhjp@users.noreply.github.com>
2022-08-16 20:39:59 +01:00
Christopher Swenson
eca526b1ce
Prepare for 0.21.0 release (#771)
Prepare for 0.21.0 release

CHANGES:
* `vault-k8s` updated to 0.17.0. (this)
* `vault-csi-provider` updated to 1.2.0 (this)
* `vault` updated to 1.11.2 (this)
* Start testing against Kubernetes 1.24. [GH-744](https://github.com/hashicorp/vault-helm/pull/744)
* Deprecated `injector.externalVaultAddr`. Added `global.externalVaultAddr`, which applies to both the Injector and the CSI Provider. [GH-745](https://github.com/hashicorp/vault-helm/pull/745)
* CSI Provider pods now set the `VAULT_ADDR` environment variable to either the internal Vault service or the configured external address. [GH-745](https://github.com/hashicorp/vault-helm/pull/745)

Features:
* server: Add `server.statefulSet.securityContext` to override pod and container `securityContext`. [GH-767](https://github.com/hashicorp/vault-helm/pull/767)
* csi: Add `csi.daemonSet.securityContext` to override pod and container `securityContext`. [GH-767](https://github.com/hashicorp/vault-helm/pull/767)
* injector: Add `injector.securityContext` to override pod and container `securityContext`. [GH-750](https://github.com/hashicorp/vault-helm/pull/750) and [GH-767](https://github.com/hashicorp/vault-helm/pull/767)
* Add `server.service.activeNodePort` and `server.service.standbyNodePort` to specify the `nodePort` for active and standby services. [GH-610](https://github.com/hashicorp/vault-helm/pull/610)
* Support for setting annotations on the injector's serviceAccount [GH-753](https://github.com/hashicorp/vault-helm/pull/753)
2022-08-10 14:54:49 -07:00
Christopher Swenson
9efd98a30f
csi/server.statefulset: custom security context (#767)
csi/server.statefulset: custom security context

This adds flexibility to have custom pod template and container
`securityContext` and preserves current default values and behavior.

Fixes https://github.com/hashicorp/vault-helm/issues/663.

This also is a way to address https://github.com/hashicorp/vault-helm/pull/599
so that people can specify, for example, the CSI to run in a privileged
container for OpenShift.

This is a follow-up to https://github.com/hashicorp/vault-helm/pull/750
and builds on the same principles.

Side note: I am not able to run `helm schema-gen` since it is
unmaintained and does not work with M1 Macs.
2022-08-08 12:48:28 -07:00
Ben Ash
8bc160489f
Update jira sync (#768) 2022-08-05 19:12:21 -04:00
Theron Voran
91b6c64f1f
changelog++ and json schema update (#762)
Changelog updates for #750, and json schema update.
2022-08-03 11:25:33 -07:00
Christopher Swenson
6931720454
Changelog and schema update for active/standby node port (#761)
* Changelog and schema update for active/standby node port

Follow-up to https://github.com/hashicorp/vault-helm/pull/610
2022-08-02 11:06:31 -07:00
ChrisFraun
eb95ac5d20
Feat/adding pod and container security context (#750)
Allow the injector's pod- and container-level securityContext to be
fully specified by the user, via new options
`injector.securityContext.pod` and
`injector.securityContext.container` with more complete
defaults. Deprecates `injector.uid` and `injector.gid`.

If `injector.uid` or `injector.gid` are set by the user, the old pod
securityContext settings will be used. Otherwise the new defaults and
settings are used.

Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
2022-08-01 23:00:29 -07:00
Jack Halford
553af862ea
Add support for nodePort for active and standby services (#610) 2022-08-01 13:16:51 -07:00
Theron Voran
999b0b7ec3
jira-sync: transition to "Closed" not "Close" (#758) 2022-07-19 09:26:50 -07:00
Theron Voran
324d68956a
changelog++ (#757) 2022-07-18 14:52:16 -07:00
Bruno Padilha
6c14d9d656
Support to add annotations in injector serviceaccount (#753) 2022-07-11 17:11:30 +01:00
Tom Proctor
44a07b8970
Set VAULT_ADDR env var for CSI Provider pods (#745) 2022-06-07 10:16:37 +01:00
Aleksey
d78a292f47
Update .helmignore (#732)
Review .helmignore file, ignore CI in chart
2022-06-02 14:25:52 -07:00
Christopher Swenson
48f4ab8aa4
Start testing against Kubernetes 1.24 (#744)
Start testing against Kubernetes 1.24

Update .github/workflows/acceptance.yaml

Remove skip csi

Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
2022-06-02 09:07:45 -07:00
Theron Voran
80560f5564
Mention minimum helm version in changelog (#742)
Also add a features section to 0.20.0
2022-06-01 10:25:19 -07:00
Christopher Swenson
45897a67fb
Prepare for release 0.20.1 (#739)
Prepare for release 0.20.1

Improvements:
* `vault-k8s` updated to 0.16.1

CHANGES:
* `vault` service account is now created even if the server is set to disabled, as per before 0.20.0 [GH-737](https://github.com/hashicorp/vault-helm/pull/737)
* Mutating webhook will no longer target the agent injector pod [GH-736](https://github.com/hashicorp/vault-helm/pull/736)

Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
2022-05-26 09:13:32 -07:00
Christopher Swenson
daa2b3b236
Set default object selector for webhooks to exclude injector itself (#736)
Set default object selector for webhooks to exclude injector itself

If `injector.failurePolicy` is set to `Fail`, there is a race condition
where if the mutating webhook config is setup before the injector, then
the injector can fail to start because it tries to inject itself.

We can work around this by ignoring the injector pod in in the webhook
by default.

Thanks to @joeyslalom for the object selector to exclude the pod.

Fixes https://github.com/hashicorp/vault-k8s/issues/258
2022-05-24 09:48:01 -07:00
Christopher Swenson
830761a293
Restore missing 'vault' service account (#737)
Our tutorials rely on this service account being present even if we are
using an external Vault.

The `values.yaml` also states that external Vaults are expected to use
this service account.

For example,
https://learn.hashicorp.com/tutorials/vault/kubernetes-external-vault?in=vault/kubernetes#install-the-vault-helm-chart-configured-to-address-an-external-vault
2022-05-24 08:27:17 -07:00
Theron Voran
3dcc3fd612
Update minimum required helm version in readme (#730)
Co-authored-by: Tom Proctor <tomhjp@users.noreply.github.com>
2022-05-19 23:23:09 -07:00
Tom Proctor
86b30098ae
Fix CSI acceptance tests (#728) 2022-05-16 18:19:15 +01:00
Tom Proctor
6ca2f72f34
Prepare v0.20.0 release (#727) 2022-05-16 17:28:31 +01:00
Christopher Swenson
eba754814a
Update the changelog with changes from 614 and 652 (#723)
* Update the changelog with changes from 614 and 652

* Update CHANGELOG.md

Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>

Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
2022-04-28 12:05:31 -07:00
Eric Miller
4005767e87
Implement support for Topology Spread Constraints (#652)
* Implemented support for topology spread constraints

* Update values.yaml

Co-authored-by: Ben Ash <32777270+benashz@users.noreply.github.com>

* Update values.yaml

Co-authored-by: Ben Ash <32777270+benashz@users.noreply.github.com>

* Add topologySpreadConstraints to values schema

* Implement injector deployment topology spread UTs

* also remove string from the relevant schema types

* Implement injector statefulset topology spread UTs

* Implement injector HA statefulset topology UTs

* Allow topologySpreadConstraints to be a string

Co-authored-by: Ellis Tarn <ellistarn@gmail.com>
Co-authored-by: Ben Ash <32777270+benashz@users.noreply.github.com>
Co-authored-by: Christopher Swenson <swenson@swenson.io>
2022-04-28 10:47:40 -07:00
Christopher Swenson
9b43054901
VUALT-5838 Restore Secrets Store CSI driver to 1.0.0 (#722)
1.0.1+ seems to only support Kubernetes 1.19+, so we break support for
1.16 if we upgrade
2022-04-27 09:58:56 -07:00
Christopher Swenson
230bba4706
VAULT-5838 Update CSI provider to 1.1.0 (#721)
* VAULT-5838 Update CSI provider to 1.1.0

* Update test/acceptance/csi.bats

Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>

Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
2022-04-27 09:22:50 -07:00
Stephen Herd
87e456754b
Issue 629: updated to allow customization of the CLUSTER_ADDR the same… (#709)
* Issue #629 Updates to allow customization of the CLUSTER_ADDR and unit tests to go with it

* Issue-#629 removing extra whitespace I added accidently.

* Issue-#629 fixing extra whitespace added.

* Update values.yaml

Co-authored-by: Joaco Muleiro Beltran <joaquinmuleirobeltran@gmail.com>

* Issue #629 adding changelog

Co-authored-by: Joaco Muleiro Beltran <joaquinmuleirobeltran@gmail.com>
2022-04-14 15:16:39 -07:00
Ethan J. Brown
4ae52c8bd3
Remove unncessary template calls (#712)
- As part of VAULT-571 / #703 in 7109159, a new vault.serverEnabled
   template was added (and included in vault.mode)

   Various templates were updated accordingly, but those that were
   already calling vault.mode had an additonal call to
   vault.serverEnabled made which was unnecessary

   Remove those
2022-04-12 22:54:54 -07:00
Stephen Herd
12444bffb6
Support policy/v1 disruptionbudget beyond kube 1.21 (#710)
Issue #667, adding updates to the disruptionbudget to support new
non beta spec beyond kube 1.21
2022-04-04 22:26:16 -07:00
gw0
4da0638f3e
Fix values schema to support config in YAML (#684) 2022-03-28 12:20:36 +01:00
Theron Voran
460b5e1b65
Update k8s versions (#706)
* tests: updating the four most recent k8s versions

* bump oldest version to 1.16

* docs, Chart.yaml, and changelog for 1.14 -> 1.16
2022-03-21 10:29:03 -07:00
Christopher Swenson
710915952e
VAULT-571 Matching documented behavior and consul (#703)
VAULT-571 Matching documented behavior and consul

Consul's helm template defaults most of the enabled to the special value
`"-"`, which means to inherit from global. This is what is implied
should happen in Vault as well according to the documentation for the
helm chart:

> [global.enabled] The master enabled/disabled configuration. If this is
> true, most components will be installed by default. If this is false,
> no components will be installed by default and manually opting-in is
> required, such as by setting server.enabled to true.

(https://www.vaultproject.io/docs/platform/k8s/helm/configuration#enabled)

We also simplified the chart logic using a few template helpers.

Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
2022-03-21 09:50:23 -07:00
Remco Buddelmeijer
56a253ba97
Maintain pre-existing Mutating Webhook default values for Kubernetes 1.22 (#692)
* Prepare default values for MutatingWebhookConfiguration #691
* Add values.yaml values to injector-mutating-webhook.yaml #691
* Duplicate and deprecate top-level webhook settings and put them in a webhook object
* Made the new values default with the fallback to the old values.yaml
* Fix _helpers.tpl to support both old and new webhook annotations
* Add new tests and deprecate old ones for injector webhook configuration
* Old tests now work with old values.yaml
* Add all new fields showing that they have priority over old ones
* Add deprecation note to injector.failurePolicy #691
2022-03-18 14:15:43 +00:00
Viacheslav Vasilyev
549d9b87b2
allow to configure publishNotReadyAddresses on server services (#694) 2022-03-17 17:52:53 +00:00
Christian
f59f3d4b13
Add namespace to injector-leader-elector role, rolebinding and secret (#683) 2022-03-16 15:31:59 -07:00
Alvin Huang
a81a992b14
change helm trigger branch from master to main (#700) 2022-03-03 10:10:42 -08:00
Tom Proctor
4f5c01f50b
changelog++ (#699) 2022-03-02 16:45:11 +00:00
lion24
a7e56d8741
vault: bump image to 1.9.3 (#695)
Signed-off-by: Lionel H <me@nullbyte.be>
2022-03-01 17:30:07 -08:00
Tom Proctor
19b417cbaa
Fix unit test assertions (#693) 2022-02-25 19:01:04 +00:00
Troy Fluegge
b447a92bd7
Updated hashicorp/vault-csi-provider image to v1.0.0 (#689) 2022-02-25 12:29:30 +00:00
Michael Schuett
a2d9a0144f
Add extraLabels for CSI DaemonSet (#690) 2022-02-25 12:18:45 +00:00
Theron Voran
b0528fce49
Release 0.19.0 (#687) 2022-01-20 15:54:24 -08:00
Michele Baldessari
92da512577
allow injection of TLS config for OpenShift routes (#686)
* Add some tests on top of #396

* convert server-route.yaml to unix newlines

* changelog

Co-authored-by: André Becker <andre@arestless.com>
Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
2022-01-19 22:37:26 -08:00
Ethan J. Brown
e629dc9d65
Add volumes and env vars to helm hook test pod (#673)
* Fix test typo

* Add basic server-test Pod tests

 - This covers all existing functionality that matches what's
   present in server-statefulset.bats

* Fix server-test helm hook Pod rendering

 - Properly adhere to the global.enabled flag and the presence of
   the injector.externalVaultAddr setting, the same way that
   the servers StatefulSet behaves

* Add volumes and env vars to helm hook test pod

 - Uses the same extraEnvironmentVars, volumes and volumeMounts set on
   the server statefulset to configure the Vault server test pod used by
   the helm test hook
 - This is necessary in situations where TLS is configured, but the
   certificates are not affiliated with the k8s CA / part of k8s PKI

 - Fixes GH-665
2022-01-19 18:55:56 -08:00
Jacob Mammoliti
a84a61fdb6
add namespace support for openshift route (#679) 2022-01-14 15:19:22 -08:00
Theron Voran
d6e1cd0835
update CONTRIBUTING.md (#677)
Link to the discuss forum instead of the old google group and irc
channel. Add info about the CLA.
2022-01-12 10:12:19 -08:00
Theron Voran
0a1f8d1457
Disable unit and acceptance tests in CircleCI (#675) 2022-01-11 11:33:09 -08:00
nikstur
c511d30043
Fixed a small typo (#672) 2022-01-07 14:37:51 -08:00
Vadim Grek
0043023c09
csi: ability to set priorityClassName for csi daemonset pods (#670) 2022-01-04 14:10:56 -08:00
Theron Voran
0c0b6e34f4
injector: ability to set deployment update strategy (continued) (#661)
Co-authored-by: Jason Hancock <jhancock@netskope.com>
2021-12-16 11:21:36 -08:00
Takumi Sue
248397f663
Make terminationGracePeriodSeconds configurable (#659)
Make terminationGracePeriodSeconds configurable for server pod
2021-12-14 18:15:11 -08:00
Eric Miller
b4a92492d0
Fix spelling error in server disruptionbudget test (#654) 2021-12-13 23:39:39 -08:00
Eric Miller
609444d9d9
Configurable PodDisruptionBudget for Injector (#653) 2021-12-13 23:38:00 -08:00
Theron Voran
48eebb0b09
Run CI tests in github workflows (#657)
Ports the bats unit, chart-verifier, and bats acceptance tests to use
github workflows and actions. The acceptance tests run using kind, and
run for multiple k8s versions, on pushes to the main branch.

Adds a SKIP_CSI env check in the CSI acceptance test, set in the
workflow if K8s version is less than 1.16.

Adds kubeAdmConfigPatches to the kind config to allow testing the CSI
provider on K8s versions prior to 1.21.

Updates the Secrets Store CSI driver to 1.0.0 in tests.

Makes the HA Vault tests more robust by waiting for all consul client
pods to be Ready, and waits with a timeout for Vault to start
responding as sealed (since the tests on GitHub runners were often
failing at that point).

Co-authored-by: Tom Proctor <tomhjp@users.noreply.github.com>
2021-12-10 17:11:35 -08:00
Theron Voran
9fa25e97c8
vault-helm 0.18.0 release (#650) 2021-11-17 15:46:28 -08:00
Theron Voran
0375b184b3
remove support for the leader-elector container (#649) 2021-11-17 13:06:03 -08:00
Tom Proctor
21cc21f9cd
Update jira action (#644)
* No longer check for Vault team membership
* Tweak jira states and search parameters
2021-11-16 14:50:16 -08:00
Kaito Ii
c47ff33551
add staticSecretRenderInterval to injector (#621)
* make staticSecretRenderInterval default to empty string

* update values schema to add staticSecretRenderInterval

* add test for default value

* adding changelog entry

Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
2021-11-05 19:07:25 -07:00
Gary Frederick
4db9e831ad
v0.17.1 (#637) 2021-10-25 15:31:07 -07:00
Gary Frederick
a186036e7d
changelog++ (#636) 2021-10-25 13:58:15 -07:00
Tim Collins
c09c50f9d6
Add option for Ingress pathType (#634) 2021-10-25 11:30:06 -04:00
Theron Voran
dc08ab6324
note a regression in 0.17.0 (#635) 2021-10-22 18:00:29 -07:00
Theron Voran
91ac2eedbc
vault-helm 0.17.0 release (#632) 2021-10-21 12:12:45 -07:00
Theron Voran
3b1bb783be
Add server.ingress.ingressClassName (#630)
Co-authored-by: Joel Cressy <joel@jtcressy.net>
2021-10-21 09:23:45 -07:00
Ben Ash
4aa01e8986
Update changelog for #626 and #628 (#631) 2021-10-21 12:14:31 -04:00
Toni Tauro
6914c4d877
fix(csi-ds): mountpoint-dir same mountpath in pod (#628)
* fix(csi-ds): mountpoint-dir same mountpath in pod

Signed-off-by: Toni Tauro <toni.tauro@adfinis.com>

* Update Chart.yaml

Co-authored-by: Ben Ash <32777270+benashz@users.noreply.github.com>
2021-10-19 15:06:07 -04:00
Ben Ash
d96a4287fa
Feat: add externalTrafficPolicy support (#626)
- externalTrafficPolicy can be set for both the ui and server services.
  It is only supported for NodePort or LoadBalancer service types.
2021-10-18 09:45:52 -04:00
Theron Voran
96b8c98b3b
Updating acceptance tests (#624)
GKE's stable K8s version is now 1.19. Also adding VAULT_LICENSE_CI to
the `make test-acceptance` target to make it easier to run the
acceptance tests manually, and mentioned it in the test README.
2021-10-11 14:12:55 -07:00
Theron Voran
ffd5086157
changelog++ (#623) 2021-10-11 10:28:37 +01:00
Vladislav Rumjantsev
72c485dd2c
ingress stable networking api (#590)
* Moved ingress to stable networking api

* lower versions support

* ingress disabled by default

* added tests for old k8s
2021-10-08 17:13:21 -07:00
Theron Voran
9758666262
fix chart publish job (#620)
The branch parameter isn't for this repo
2021-09-29 18:01:14 -07:00
Theron Voran
5dfc3515c1
vault-helm 0.16.1 release (#619) 2021-09-29 16:28:37 -07:00
Theron Voran
b69e3d9276
vault-helm default branch is now main (#618)
Updated the circleci config to use the `main` branch, and also changed
a couple mentions in the contributing guide.
2021-09-27 21:40:09 -07:00
Theron Voran
cd2059147d
vault 0.16.0 release (#612) 2021-09-16 09:39:59 -07:00
Theron Voran
78a355bffc
changelog++ 2021-09-15 18:59:34 -07:00
Theron Voran
5a864f7cbb
Adding support for the old leader-elector (#607)
Adds the leader-elector container support that was removed in
PR #568. The new vault-k8s uses an internal mechanism for leader
determination, so this is just for backwards compatibility, and can
be removed in the near future.

* mark the endpoint as deprecated

* add a new useContainer option for leaderElector

Default to not deploying the old leader-elector container, unless
injector.leaderElector.useContainer is `true`.
2021-09-15 18:43:04 -07:00
Ben Ash
dd3b3f06e0
changelog++ 2021-09-15 14:22:35 -04:00
Ben Ash
c267805dea
changelog++ 2021-09-15 14:22:02 -04:00
Toni Tauro
23e0348842
feat(csi): make provider hostPaths configurable (#603)
*  add configurable values for providersDir and kubeletRootDir

Signed-off-by: Toni Tauro <toni.tauro@adfinis.com>

Co-authored-by: Ben Ash <32777270+benashz@users.noreply.github.com>
2021-09-15 14:12:24 -04:00
Theron Voran
8932c372b7
Fix the CSI acceptance test (#608)
The `master` branch was renamed to `main` for
kubernetes-sigs/secrets-store-csi-driver

* use a specific version in the URL

* use csi driver 0.2.0
2021-09-07 18:09:30 -07:00
Theron Voran
87a0a56ad9
changelog++ 2021-08-31 15:21:49 -07:00
Theron Voran
d31f942d3e
Support vault-k8s internal leader election (#568) 2021-08-31 15:16:06 -07:00
Theron Voran
c820454dd5
vault-helm 0.15.0 release (#598) 2021-08-23 08:51:52 -07:00
Theron Voran
22df6c0d9b
changelog++ 2021-08-16 13:50:47 -07:00
Theron Voran
f7ab37fd50
Add injector.webhookAnnotations chart option (#584) 2021-08-16 13:49:26 -07:00
Theron Voran
277317524a
changelog++ 2021-08-11 17:03:26 -07:00
Maxime Bruneau
c9c23b1a9b
Add imagePullSecrets on server test (#572)
Co-authored-by: Ben Ash <32777270+benashz@users.noreply.github.com>
Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
2021-08-11 17:01:58 -07:00
Theron Voran
bfc01c1e5d
Update chart verifier (#579)
The test names now have "v1.0/" prepended. chart-verifier docker
images are now tagged too.
2021-07-29 14:51:35 -07:00
Theron Voran
a5c85627b3
vault-helm 0.14.0 release (#578) 2021-07-28 14:44:28 -07:00
Ben Ash
86ff773249
++changelog 2021-07-23 13:00:50 -04:00
Ben Ash
64b4d88c72
feature: imagePullSecrets from string array. (#576)
* allow configuring imagePullSecrets from an array of strings in
  addition to the already supported array of maps
2021-07-23 12:05:24 -04:00
Jason O'Donnell
43656864c6
changelog++ 2021-07-15 14:18:08 -04:00
Jason O'Donnell
255cdc7d26
Add ingress/route configurable to specify active/general service (#570)
* Add ingress/route configurable to specify active/general service

* Update test/unit/server-ingress.bats

Co-authored-by: Ben Ash <32777270+benashz@users.noreply.github.com>

* values.schema.json

Co-authored-by: Ben Ash <32777270+benashz@users.noreply.github.com>
2021-07-15 14:15:46 -04:00
Ben Ash
a0d7b84ec2
++changelog 2021-07-12 17:33:03 -04:00
Ben Ash
4a4295da81
Update acceptance tests to use the new stable GKE version 1.18.x (#569) 2021-07-12 15:47:07 -04:00
Ben Ash
2d420856a4
Update the default vault agent image to come from the hashicorp docker organization. (#567)
* Default to hashicorp/vault for vault agent image.

* Add support for running acceptance tests against a kind cluster

* make the injector-leader-elector a bit more reliable when run locally
2021-07-12 13:00:12 -04:00
Ben Ash
f5ef752e9a
++changelog 2021-07-07 19:32:02 -04:00
Ben Ash
1e4709cc46
feature: Support configuring various properties as YAML directly. (#565)
* feature: Support configuring various properties as YAML directly.
Supported properties include: pod tolerations, pod affinity, and node selectors.
2021-07-07 19:07:58 -04:00
Calvin Leung Huang
14d1f97edd
injector: add templateConfig.exitOnRetryFailure annotation (#560)
* injector: add templateConfig.exitOnRetryFailure annotation

* update values.schema.json
2021-07-06 09:49:48 -07:00
Theron Voran
f67b844d30
Update to v0.13.0 (#554) 2021-06-17 10:52:21 -07:00
Theron Voran
7509bc739d
changelog++ 2021-06-16 13:57:16 -07:00
Theron Voran
0f832e01fc
Add openshift overrides (#549)
Adds default overrides for OpenShift (values.openshift.yaml) and uses
them in the chart-verifier tests.
2021-06-16 13:54:22 -07:00
Theron Voran
3a6e097ae5
changelog++ 2021-06-11 13:31:41 -07:00
Theron Voran
4d23074cd3
Adding server.enterpriseLicense (#547)
Sets up a vault-enterprise license for autoloading on vault
startup. Mounts an existing secret to /vault/license and sets
VAULT_LICENSE_PATH appropriately.
2021-06-11 13:29:30 -07:00
Theron Voran
bb63d73b5a
changelog++ 2021-06-10 15:34:49 -07:00
Ricardo Gândara Pinto
d27121c223
Added webhook-certs volume mount to sidecar injector (#545)
* Removed webhook-certs volume mount from leader-elector container

* Added test: injector deployment manual TLS adds volume mount
2021-06-10 15:32:22 -07:00
Theron Voran
637087fa70
use vault-helm-test:0.2.0 (#543) 2021-06-02 09:12:15 -07:00
Theron Voran
ad9a46ae66
changelog++ 2021-06-01 10:52:44 -07:00
Rule88
458876007a
change maxUnavailable to integer (#535)
change maxUnavailable from `null` to `integer` to enable upgrade from
0.11.0 to 0.12.0 when using the specific variable.

* Also allow null value

Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>

* add test for server.ha.disruptionBudget.maxUnavailable

Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
2021-06-01 10:51:18 -07:00
Theron Voran
828b31287b
changelog++ 2021-06-01 10:42:21 -07:00
Theron Voran
af25981752
fix ui.serviceNodePort schema (#537)
UI service nodePort defaults to null, but is set as an integer
2021-06-01 10:41:02 -07:00
Theron Voran
3afcb463f8
changelog++ 2021-05-27 17:11:17 -07:00
Theron Voran
3593739160
Adding helm test for vault server (#531)
Also adds acceptance test for 'helm test' and updates the
chart-verifier version.
2021-05-27 17:09:50 -07:00
Jason O'Donnell
b21b37b07a
Update to v0.12.0 (#532)
* Update to v0.12.0

* Update values.schema.json

* Fix schema types

* revert image repo
2021-05-25 13:46:48 -04:00
Jason O'Donnell
d53b011ae9
changelog++ 2021-05-25 10:21:01 -04:00
Iñigo Horcajo
4c71c268b9
Add UI targetPort option (#437)
Use custom `targetPort` for UI service. See the usecase in https://github.com/hashicorp/vault-helm/issues/385#issuecomment-749560213
2021-05-25 10:20:23 -04:00
Theron Voran
e206fadd9e
add schema unit tests (#530) 2021-05-25 10:16:29 -04:00
Tom Proctor
23ff8a1d83
changelog++ 2021-05-21 12:50:44 +01:00
Tom Proctor
030d3cd89d
Add extraArgs value for CSI (#526) 2021-05-21 12:48:21 +01:00
Theron Voran
dbd99b10c0
changelog++ 2021-05-17 17:16:34 -07:00
mehmetsalgar
0ab15dfb84
[Issue-520] tolerations for csi-daemonset (#521)
Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
2021-05-17 17:14:19 -07:00
Theron Voran
e817b1d254
changelog++ 2021-05-14 10:49:37 -07:00
Theron Voran
ed38f6d3a6
added values json schema (#513)
Generated the schema using the helm schema-gen plugin, and added extra
data types to fields that allow it, such as annotations, tolerations,
enabled, etc. Enabled the "contains-value-schema" chart-verifier test.

Co-authored-by: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com>
2021-05-14 08:59:36 -07:00
Sarah Thompson
f226051e53
updating to use new dedicated context and token (#515) 2021-05-13 11:56:01 +01:00
Arie Lev
2a70a9f50d
fix CONTRIBUTING.md (#501) 2021-05-12 10:44:11 -04:00
Tom Proctor
1505e7754b
changelog++ 2021-05-12 12:11:42 +01:00
Tom Proctor
f84fc7e30b
changelog++ 2021-05-12 12:11:15 +01:00
mehmetsalgar
92aed2cbee
Add ImagePullSecrets to CSI daemonset (#519) 2021-05-12 12:06:54 +01:00
Theron Voran
6e8ef40840
match kubeVersion on semver pre-releases (#512)
Since clouds like GKE set their kubeVersion as a
pre-release (e.g. v1.17.17-gke.6700)
2021-05-11 08:25:50 -07:00
Theron Voran
794a86a28b
changelog++ 2021-05-10 16:58:25 -07:00
Theron Voran
b59cbf6dc6
Set kubeVersion and added chart-verifier tests (#510)
Set min kubeVersion in Chart.yaml to 1.14. Added a chart-verifier bats
test, and configured to run it in CI. Some verification tests that
haven't been addressed yet are skipped.
2021-05-10 16:56:31 -07:00
Arie Lev
dcb4b10283
Add container based tests documentation (#492)
* update documentation with running unit tests using container

* promote bats version to 1.3.0

* Update CONTRIBUTING.md

Co-authored-by: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com>

* Update CONTRIBUTING.md

Co-authored-by: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com>

Co-authored-by: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com>
2021-04-14 13:05:38 -04:00
Jason O'Donnell
27338595e8
Update to v0.11.0 (#497) 2021-04-14 10:26:33 -04:00
Tom Proctor
be1721fc84
Remove redundant logic (#434) 2021-04-14 14:53:52 +01:00
Jason O'Donnell
5f2e1d470f
Fix injector unit test failing (#496)
* Fix injector unit test failing

* Add null check

* Add default if unset for CI
2021-04-14 08:23:50 -04:00
Jason O'Donnell
f2e3d57a65
changelog++ 2021-04-13 11:21:08 -04:00
Javier Criado Marcos
088ce89dc1
[injector] Add port name in injector service (#495)
* [injector] Add port name in injector service

* [injector] Hardcore port to https
2021-04-13 11:20:31 -04:00
Jason O'Donnell
366cf23a75
changelog++ 2021-04-12 17:02:16 -04:00
Jason O'Donnell
bf5783ef6b
Add injector agent default overrides (#493)
* Add injector agent default overrides

* Update test/unit/injector-deployment.bats

Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>

* Update test/unit/injector-deployment.bats

Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>

* Update test/unit/injector-deployment.bats

Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>

Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
2021-04-12 17:01:14 -04:00
Jason O'Donnell
b838d4b843
changelog++ 2021-04-12 17:00:51 -04:00
Hamza ZOUHAIR
d8c2d2058c
Custom value of agent port (#489)
* configure the agent port

* add unit test

* remove default

* remove default

* Update values.yaml

Co-authored-by: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com>

Co-authored-by: Jason O'Donnell <2160810+jasonodonnell@users.noreply.github.com>
2021-04-12 16:59:38 -04:00
Jason O'Donnell
dc696bb1f3
changelog++ 2021-04-08 11:21:25 -04:00
Jason O'Donnell
ec67b5dd45
Add logLevel and logFormat values for Vault (#488)
* Add logLevel and logFormat values for Vault

* Add configurable tests

* Update order of log levels

* Update values.yaml

* Update per review

* Update test/unit/server-statefulset.bats

Co-authored-by: Tom Proctor <tomhjp@users.noreply.github.com>

* Update test/unit/server-statefulset.bats

Co-authored-by: Tom Proctor <tomhjp@users.noreply.github.com>

Co-authored-by: Tom Proctor <tomhjp@users.noreply.github.com>
2021-04-08 11:18:16 -04:00
Jason O'Donnell
ccebde9dae
changelog++ 2021-04-08 10:10:01 -04:00
Sam Marshall
bfbeba256a
feat(ingress): Extra paths to prepend to the ingress host configuration for annotation based services (#460)
Refs #361
2021-04-08 10:09:19 -04:00
Jason O'Donnell
6e46bcf529
changelog++ 2021-04-08 10:05:47 -04:00
Paul Witt
a2a07b2a02
add hostNetwork value to injector deployment (#471)
* add hostNetwork value to injector deployment

* adding unit tests
2021-04-08 10:03:56 -04:00
Tom Proctor
b24457323b
changelog++ 2021-04-07 14:24:00 +01:00
Arie Lev
7a71c0fec4
fix csi helm deployment (#486)
* fix serviceaccount and clusterrole name reference (full name)

* add server.enabled option, align with documentation

* add unit tests

* update server.enabled behaviour to explicit true and update tests
2021-04-06 14:56:11 +01:00
Paul
a6856646aa
Remove extra word in readme (#482) 2021-03-29 18:12:09 -07:00
Jason O'Donnell
703ba50d47
changelog++ 2021-03-25 10:56:59 -04:00
Jason O'Donnell
7fd6959cdc
Add volumes and mounts support for CSI (#479)
* Remove extraVolumes from CSI, add volumes and mounts

* Add better example
2021-03-25 10:21:21 -04:00
Jason O'Donnell
f75b19f068
Update to 0.10.0 (#477)
* Update to v0.10.0

* Fix typo

* Add csi link in changelog
2021-03-25 10:19:31 -04:00
Tom Proctor
102f9e49e2
Target vault-csi-provider release 0.1.0 (#475) 2021-03-25 09:02:36 -04:00
Tom Proctor
2ddac08c51
changelog++ 2021-03-24 14:03:21 +00:00
Theron Voran
3e36bb70d5
updating acceptance tests to k8s 1.17 on gke (#473) 2021-03-24 09:20:06 -04:00
Tom Proctor
4c1d79f46e
Add CSI secrets store provider (#461) 2021-03-19 14:14:38 +00:00
Jason O'Donnell
ff735774c4
changelog++ 2021-02-19 23:03:15 -05:00
guru1306
690ee410ef
Add objectSelector to webhookconfiguration (#456) 2021-02-19 23:02:04 -05:00
Theron Voran
84a1dd9fbe
0.9.1 release updates (#455)
Changelog, chart metadata, and image versions
2021-02-02 11:06:40 -08:00
Jason O'Donnell
f399130112
changelog++ 2021-01-21 12:41:44 -05:00
Theron Voran
f59fd68780
changelog++ 2021-01-15 15:45:38 -08:00
Theron Voran
69a3dc618d
Set VAULT_DEV_LISTEN_ADDRESS in dev mode (#446)
Binds vault to 0.0.0.0 in dev mode so that external traffic is
accepted.
2021-01-15 15:42:50 -08:00
Theron Voran
91e9446bfc
Update version of consul-helm in server-ha test (#444)
consul-helm v0.16.2 doesn't work with newer versions of helm (like
3.4).
2021-01-12 11:07:55 -08:00
Theron Voran
2451b5fb65
Increase the timeout for leader elector ready (#443)
Bumps the timeout waiting for the injector replicas (with
leader-elector containers) to be "Ready" to 5 minutes. Default was 30
seconds.
2021-01-12 11:06:00 -08:00
Theron Voran
e69efc018d
changelog++ 2021-01-11 17:53:07 -08:00
Bruno FERNANDO
6c99e107c6
fix(injector): label component (app.kubernetes.io/name) value in anti-affinity rule (#442) 2021-01-11 17:51:13 -08:00
Theron Voran
5230d3e528
changelog++ 2021-01-08 18:00:00 -08:00
Bruno FERNANDO
53f31be205
fix(injector): label component value in anti-affinity rule (#441) 2021-01-08 17:55:47 -08:00
Theron Voran
7b5e08c4a8
0.9.0 release updates (#439)
Changelog, chart metadata, and image versions
2021-01-05 10:52:56 -08:00
Jason O'Donnell
3cc33172d9
Add extra time to initial probe delay (#440) 2021-01-05 13:51:28 -05:00
Tom Proctor
7a122dd811
changelog++ 2021-01-05 18:08:48 +00:00
Tom Proctor
278044dbd9
changelog++ 2021-01-05 18:06:20 +00:00
Tom Proctor
e6b4969acc
Support deploying multiple injector replicas with auto-TLS (#436) 2021-01-05 11:14:00 +00:00
Jason O'Donnell
818ed117b0
changelog++ 2020-12-16 12:32:51 -05:00
Volodymyr Stoiko
f8e6aab4ee
Allow configurable egress for server network policy (#389)
* Allow configurable egress

* Add test for networkpolicy egress in server

* Allow egress configuration

* Fix test

* Fix networkPolicy test

* Fix test
2020-12-16 12:30:24 -05:00
Jason O'Donnell
9067c4e2f5
changelog++ 2020-12-14 14:15:30 -05:00
Jason O'Donnell
cc20c0b3c1
Add allowPrivilegeEscalation=false to pods (#429)
* Add allowPrivilegeEscalation=false to pods

* Add openshift check

* Add injector openshift check
2020-12-14 14:14:29 -05:00
Jason O'Donnell
d80432a7d5
changelog++ 2020-12-07 11:29:17 -05:00
Logi
a11a75d1b5
support extraLabels for vault-agent-injector (#428)
* support extraLabels for vault-agent-injector

* added unit test for extraLabels

* fix test

* added injector.extraLabels as empty map to values file
2020-12-07 11:28:06 -05:00
Jason O'Donnell
136fe024c9
changelog++ 2020-12-07 10:33:06 -05:00
Bruno FERNANDO
73e90a1308
feat: add annotations to injector service (#425) 2020-12-07 10:31:54 -05:00
Jason O'Donnell
0101816d8d
changelog++ 2020-12-07 10:20:18 -05:00
Yong Wen Chua
94adad8335
Update mutating webhook API Version (#408)
* Update mutating webhook API Version

* Set to ignore by default

* Remove extra `-`

* Add required fields
2020-12-07 10:18:25 -05:00
Jason O'Donnell
be48291bcf
changelog++ 2020-12-07 10:10:44 -05:00
Piotr Hryszko
e2b609817f
don't set VAULT_DEV_ROOT_TOKEN_ID by default in dev mode (#415)
* don't set VAULT_DEV_ROOT_TOKEN_ID by default in dev mode

* don't template environment variables that no longer exist

* fix tests after removing VAULT_DEV_ROOT_TOKEN_ID env variable

* removed a typo

* allow overriding VAULT_DEV_ROOT_TOKEN_ID in dev mode

* correct ambiguous description

* don't set default values in templates for visibility, update tests and set uncomment devRootToken in values.yaml

* Update devRootToken description
2020-12-07 10:09:38 -05:00
Jason O'Donnell
a8c1b4b0c5
changelog++ 2020-12-07 10:08:56 -05:00
Chris Pieper
f780877e1d
Update rbac api version to v1 (#395)
* fix(rbac): update api version on rbac

* Update templates/server-clusterrolebinding.yaml

Co-authored-by: Yong Wen Chua <lawliet89@users.noreply.github.com>

* Update server-discovery-rolebinding.yaml

Co-authored-by: Yong Wen Chua <lawliet89@users.noreply.github.com>
2020-12-07 10:07:02 -05:00
Jason O'Donnell
f6c9d5837b
changelog++ 2020-11-30 16:32:06 -05:00
Jason O'Donnell
a8c42428b0
Add extraArgs support to dev mode (#421) 2020-11-30 16:31:02 -05:00
Michele Degges
b544e01391
Use docker mirror (#409) 2020-11-23 16:47:25 -08:00
Tom Proctor
93e4f521f1
Update jira sync github action (#411) 2020-11-16 11:38:03 +00:00
Jason O'Donnell
ee4e532159
Update to 0.8.0 (#405)
* Update to 0.8.0

* Fix changelog formatting
2020-10-20 13:58:41 -04:00
Jason O'Donnell
addf8a4f65
changelog++ 2020-10-20 09:35:49 -04:00
Jean-François Roche
c45f9b997d
Enable Vault to review kube tokens when using external Vault (#392)
We want Vault to perform token reviews with Kubernetes even if we are
using an external Vault.

We need to create the ServiceAccount, Secret and ClusterRoleBinding with
the system:auth-delegator role to enable delegated authentication and
authorization checks [1].

These SA and RBAC objects are created when we deploy the Vault server.
In order to enable the creation of these objects when using an external
Vault, we remove the condition on external mode.

User might want to provide a sensible name (in global.serviceAccount.name) to the service
account such as: vault-auth.

refs #376

[1] https://www.vaultproject.io/docs/auth/kubernetes#configuring-kubernetes
2020-10-20 09:34:48 -04:00
Anton Kaymakchi
f6123b8ed2
Fix misspelings in values.yaml file (#402) 2020-10-20 09:05:29 -04:00
Jason O'Donnell
994797cff4
changelog++ 2020-10-16 10:48:41 -04:00
gw0
29a77e82d1
Improve config variables (#398) 2020-10-16 10:47:31 -04:00
Jason O'Donnell
618d4b3b39
changelog++ 2020-10-13 09:22:17 -04:00
Ori Rawlings
5eb0ba5865
Add configurable failurePolicy for injector's webhook (#400)
Fixes #399
2020-10-13 09:20:06 -04:00
Jason O'Donnell
5242cfe6a7
changelog++ 2020-10-05 16:23:04 -04:00
Jason O'Donnell
73c70c0ba0
changelog++ 2020-10-01 11:07:48 -04:00
Michael Parker
1968526f0d
add ability to set pod annotations for injector (#394)
* add ability to set pod annotations for injector

* add missing unit tests
2020-10-01 11:06:53 -04:00
Jason O'Donnell
54f58b9c01
changelog++ 2020-10-01 09:34:25 -04:00
Jason O'Donnell
13ef8db3b5
Add configurable mountPath for audit/data storage (#393) 2020-10-01 09:32:46 -04:00
Jason O'Donnell
c16905edca
changelog++ 2020-09-24 12:41:51 -04:00
Theron Voran
1705536ee5
changelog++ 2020-09-15 23:47:01 -07:00
Volodymyr Stoiko
66ea34c702
Allow explicit network policy enablement (#381)
* Disable default network policy

* Make network policy configurable by explicit flag only
2020-09-15 23:40:56 -07:00
Jason O'Donnell
fc8ebfdd4e
Add configurable probe values (#387)
* Add configurable probe values

* Remove template defaults

* Update values.yaml

Co-authored-by: Tom Proctor <tomhjp@users.noreply.github.com>

* Update values.yaml

Co-authored-by: Tom Proctor <tomhjp@users.noreply.github.com>

* Update values.yaml

Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>

* Switch timeout and period defaults

Co-authored-by: Tom Proctor <tomhjp@users.noreply.github.com>
Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
2020-09-15 16:24:38 -04:00
Tom Proctor
3975d2c331
Update Jira sync action versions (#386)
These versions bring a few fixes:

* The action now supports converting the most common bits of markdown syntax into Jira formatting directives
* Replaces Atlassian's comment action, which tries to interpolate bits of text from comments wrapped in {{ github.event_name }} as templates, usually causing an error (in the case I've put there, if I wasn't a vault team member, it would replace the template with `pull_request_target`)
* Remove trailing comma after link that broke the link target Jira selects
2020-09-14 16:50:46 +01:00
Tom Proctor
798ac9c597
Update notes template to be helm v3 compatible (#378)
`helm get {{ .Release.Name }}` is replaced by `vault get all {{ .Release.Name }}` in helm v3, but `all` doesn't exist in v2.
2020-08-27 16:34:25 +01:00
Tom Proctor
d2c5ff8fcc
Add Jira sync action (#373) 2020-08-25 14:27:48 +01:00
Jason O'Donnell
cfe3bccf8e
Update to 0.7.0 (#374)
Update to 0.7.0
2020-08-24 14:19:12 -04:00
Jason O'Donnell
a29f98dcc7
changelog++ 2020-08-20 19:05:58 -04:00
Jason O'Donnell
117fff79bc
Add vault-k8s metrics configurable (#372) 2020-08-20 19:03:12 -04:00
Jason O'Donnell
4d6e79df45
changelog++ 2020-08-20 14:40:40 -04:00
Yong Wen Chua
5dc29f6c84
Add configuration options for Vault UI service (#285)
* Add configuration options for Vault UI service

- Configure to select active Vault pod only
- Configure to not publish unready address

* Create active label only on HA
2020-08-20 14:39:46 -04:00
Jason O'Donnell
f0c073e3ee
changelog++ 2020-08-20 14:03:26 -04:00
Scott Hawkins
622690e68b
Add volume claim annotations (#364)
* Add templates for annotations to apply to PV.

* Fix spacing for template injection.

* Fix template logic, add unit tests.
2020-08-20 14:02:27 -04:00
Jason O'Donnell
0faf7cf21a
changelog++ 2020-08-20 13:46:18 -04:00
Dawson Mortenson
f40cc89467
allow server annotations with dev mode (#371) 2020-08-20 13:45:36 -04:00
Theron Voran
986191117e
changelog++ 2020-08-18 19:16:30 -07:00
Sergei Zyubin
9fbe720f6b
Make serviceAccount name a configuration option (#367)
* Make serviceAccount name a configuration option

Follow Helm Best Practices when defining serviceAccount names
https://helm.sh/docs/chart_best_practices/#using-rbac-resources

* Use enabled instead of create for consistency

* Add unit tests for user-defined service account name

* ServiceAccount under server

Co-authored-by: David Holsgrove <david@apnic.net>

* Update ServiceAccount in RoleBindings

to address https://github.com/hashicorp/vault-helm/pull/56#pullrequestreview-297856433

Co-authored-by: David Holsgrove <david@apnic.net>

* Update tests for helm template arg --show-only

Co-authored-by: David Holsgrove <david@apnic.net>

* Fix server-serviceaccount tests

* serviceAccount: rename enabled to create

* statefulSet: add tests for serviceAccount

Co-authored-by: Nick Satterly <nick@diabol.se>
Co-authored-by: David Holsgrove <david@apnic.net>
2020-08-18 19:13:02 -07:00
Theron Voran
25749a7518
changelog++ 2020-08-14 15:06:03 -07:00
Sam Weston
ed0b918bf6
Add an option to set annotations on the StatefulSet (#199)
* Add tests for adding StatefulSet annotations

Signed-off-by: Sam Weston <weston.sam@gmail.com>
Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
2020-08-14 15:04:52 -07:00
Jason O'Donnell
7a8180862e
changelog++ 2020-07-30 10:24:07 -04:00
Lukas Grossar
ec69e1cccb
Remove tolerate-unready-endpoints annotation (#363)
This annotation has been deprecated since Kuberneets 1.8 and the
publishNotReadyAddresses parameter replacing it has been correctly
implemented in Kubernetes 1.11 (see https://github.com/kubernetes/kubernetes/pull/63742)
2020-07-30 10:23:02 -04:00
killuazhu
25c6fe1f81
Minor updates for Makefile (#355)
Make reference more consistent, also list all targets are phony target.
2020-07-30 10:16:47 -04:00
Jason O'Donnell
cd15ea91e3
changelog++ 2020-07-30 10:06:18 -04:00
Erik DeLamarter
f965826a66
missing enabled checks for injector-network-policy (#358) 2020-07-30 10:05:01 -04:00
Jason O'Donnell
0c28645748
changelog++ 2020-07-14 10:24:53 -04:00
georgekaz
8c741f6276
add support for more flexible volume mounts. Include example values for init container (#314)
add unit tests

add missing braces
2020-07-14 10:23:08 -04:00
Jason O'Donnell
5110f0f930
changelog++ 2020-07-14 10:10:18 -04:00
Yong Wen Chua
85b52694f7
Allow overriding VAULT_API_ADDR (#290) 2020-07-14 10:09:43 -04:00
Jason O'Donnell
ef7df3da77
changelog++ 2020-07-14 09:54:18 -04:00
Steven Merrill
70cfec3fc8
Force caBundle to always be quoted (#352)
This fixes issues when you do not provide a value for caBundle that
causes validation issues.
2020-07-14 09:53:33 -04:00
Theron Voran
3e463a4bbe
Add issue templates (#351) 2020-07-06 17:03:57 -07:00
Theron Voran
93f5190a60
changelog++ 2020-06-26 18:04:59 -07:00
Octavian Ionescu
7dc56ca86f
Fix python dependency in test image (#336) (#337)
In latest alpine release (3.12) there was an intentional change
to drop python support without specify required version: python2
or python3.

Signed-off-by: Octavian Ionescu <itavyg@gmail.com>
2020-06-26 18:03:14 -07:00
Theron Voran
6b9da1c418
changelog++ 2020-06-25 23:46:05 -07:00
Yong Wen Chua
adf5bf65a9
Support PodSecurityPolicy (#177)
* Add PSP for server

* Add PSP for Injector

* Allow annotations to be templated

Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
2020-06-25 23:42:52 -07:00
Jason O'Donnell
ebed731222
changelog++ 2020-06-11 10:51:44 -04:00
Omer Levi Hevroni
5a7e10cf08
allow to set extra volume mode (#321) 2020-06-11 10:50:16 -04:00
Jason O'Donnell
62380cc24a
Add note to config about sensitive configs (#323)
* Add note to config about sensitive configs

* Update README.md

Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>

Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
2020-06-04 13:37:31 -04:00
Jason O'Donnell
e7736defa1
Update to v0.6.0 (#320) 2020-06-03 10:03:10 -04:00
Jason O'Donnell
b42c0c53b5
changelog++ 2020-06-02 22:12:02 -04:00
Jason O'Donnell
853cb06842
Add OpenShift beta support (#319)
* Initial commit

* Added openshift flag

* added self signed certificate for service annotation

* added OpenShift flag

* Added OpenShift flag

* cleanup

* Cleanup

* Further cleanup

* Further cleanup

* reverted security context on injector

* Extra corrections

* cleanup

* Removed Raft config for OpenShift, removed generated certs for ha and standby services

* Add openshift flag to global block, route disabled by default, condition for injector in network policy

* Added Unit tests for OpenShift

* Fixed unit test for HA statefulset for OpenShift

* Removed debug log level from stateful set

* Added port 8201 to networkpolicy

* Updated injector image

* Add openshift beta support

* Add openshift beta support

* Remove comments from configs

* Remove vault-k8s note from values

* Change route to use active service when HA

Co-authored-by: Radu Domnu <radu.domnu@sixdx.com>
Co-authored-by: Radu Domnu <radu.domnu@gmail.com>
2020-06-02 22:10:41 -04:00
Alvin Huang
7f7fb7bad0
check that git tag == chart tag on tagged releases (#316) 2020-06-02 11:38:59 -04:00
Jason O'Donnell
d1ad4ff403
changelog++ 2020-06-02 10:12:13 -04:00
ttinkr
4f81ac070b
imagePullSecrets in injector-deployment (#298)
Co-authored-by: ttinkr <thomas.fellinger@nts.eu>
2020-06-02 10:09:48 -04:00
Theron Voran
8e982a6c9d
Allow setting HA services type (#317)
Making the types for active and standby services configurable (just
like the main vault service).
2020-06-02 10:06:50 -04:00
lukemassa
78ca71d2eb
Removing namespace from yaml of non-namespaced objects (#300) 2020-05-28 22:47:41 -04:00
Jason O'Donnell
cd7591b0f8
changelog++ 2020-05-28 14:55:47 -04:00
Theron Voran
e58051e3c6
changelog++ 2020-05-28 11:54:52 -07:00
Jason O'Donnell
4215316818
Add postStart lifecycle hook (#315)
* Add postStart lifecycle hook

* Update values.yaml

Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>

Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
2020-05-28 14:53:46 -04:00
georgekaz
d755ad1ba0
Use active service on ingress when ha (#270)
Added some logic that points the ingress at the active server
when in ha mode. There are times that pointing at the standby
pods causes problems.
2020-05-28 11:51:25 -07:00
Sarah Thompson
7002cc664b
Get acceptance tests running against GKE in CI - merges to master only. (#291)
* Get acceptance tests running against GKE in CI - merges to master only.

* Adding README.md
2020-05-27 17:21:16 +01:00
Theron Voran
7cc905e00e
changelog++ 2020-05-26 19:31:06 -07:00
Gorka Maiztegi
6b77840e22
Update ingress apiVersion (#310)
The apiVersion `extensions/v1beta1` for ingresses has been removed in Kubernetes 1.16 and the new `networking.k8s.io/v1beta1` has to be used now. This conditional keeps compatibility with older Kubernetes versions while using the new apiVersion when available.
2020-05-26 19:28:15 -07:00
Josh Keife
9a835c40f1
Update comment in standby service (#299) 2020-05-21 11:58:53 -04:00
Theron Voran
7e5ed6bae9
changelog++ 2020-05-20 09:18:54 -07:00
Theron Voran
7b744295cf
Update default values (#309)
Updating some of the default values to match how they're used in
the templates.
2020-05-20 09:16:54 -07:00
Theron Voran
dd8e3a230c
updated readme with the helm repo info (#308) 2020-05-20 09:15:55 -07:00
Jason O'Donnell
ac6089c45e
changelog++ 2020-05-08 14:36:56 -04:00
Adrienne Cohea
0cc1af1876
Add init containers to support TLS certificate introduction and other dynamic configuration use cases. (#258) 2020-05-08 14:35:39 -04:00
Jason O'Donnell
08a6f929b8
Revert "Add support for priorityClassName (#165)" (#287)
This reverts commit 2af6f9b44f.
2020-05-05 11:29:09 -04:00
Brian Choy
2af6f9b44f
Add support for priorityClassName (#165)
* Add support for priorityClassName

* Add unit tests

* Remove comment

* Update comment, accidentally deleted comment

* Remove whitespace
2020-05-05 11:10:17 -04:00
Theron Voran
24b13630f0
Update CHANGELOG.md 2020-04-30 18:38:42 -07:00
Yong Wen Chua
c8b18d1876
Support setting priorityClassName on pods (#282) 2020-04-30 18:37:27 -07:00
Alvin Huang
ee2827f710
add API trigger for helm charts index (#281) 2020-04-29 14:37:18 -04:00
Jason O'Donnell
c045ad89aa
Fix raft acceptance test (#279) 2020-04-27 14:49:09 -04:00
Jason O'Donnell
138b9217a5
changelog++ 2020-04-27 11:39:22 -04:00
Yong Wen Chua
8cc3fdb167
Add support for setting VAULT_RAFT_NODE_ID environment variable (#269)
* Add support for setting VAULT_RAFT_NODE_ID environment variable

* Update server-statefulset.yaml

* Update server-ha-statefulset.bats
2020-04-27 11:38:26 -04:00
Theron Voran
accbd222ec
changelog++ 2020-04-27 08:31:25 -07:00
Theron Voran
e09de0dc63
Allow both yaml and multi-line string annotations (#272)
Changed/added helper functions to detect if the annotations value
is a string or yaml, and apply `tpl` or `toYaml`
accordingly. Defaults are left as `{}` since yaml is more likely
to be used with helm on the command line. This means a warning
will be shown when setting an annotation to a multi-line
string (which has been the existing behavior).
2020-04-27 08:28:50 -07:00
Jason O'Donnell
7880c3b973
changelog++ 2020-04-27 10:47:28 -04:00
David Moreno García
0f36ee3a5b
Change config specification (#213)
* Change config specification

As it is right now, the specification of the config is done through an
string. When using storage backends like PostgreSQL, the password for the
database has to be included in the config variable of the values file.

This change allows to specify the configuration through a map, making
the chart GitOps friendly. Now, sensitive values can be stored in a
different values file or passed on deployment time with --set.

To have a very generic specification:
- I've assumed that the combination stanza (eg. storage) name (eg. file)
is unique.
- Quoted values for all stanza parameters. I tested a generated
configuration in a vault docker image and it seems to work just fine.

* Change config format to json

* Add conditional formatting

* Add config for raft mode
2020-04-27 10:45:56 -04:00
Theron Voran
1be24460f3
changelog++ 2020-04-21 08:20:41 -07:00
Theron Voran
2072bf2dcd
Fix ha standby and active service annotations (#268)
* service: fix annotations for HA standby/active services

* added unit tests

Co-authored-by: yotsub <63680950+yotsub@users.noreply.github.com>
2020-04-21 08:19:17 -07:00
Theron Voran
39631aad6b
changelog++ 2020-04-13 10:17:49 -07:00
Javad Karabi
374ea22c02
use port names that map to vault.scheme (#223)
* use port names that map to vault.scheme

* prefix internal/replication port names with vault.scheme

* port names must be 'no more than 15 characters'

* test vault server service port names are prefixed with vault scheme

* test vault server statefulset port names are prefixed with vault scheme

* test vault ui service port names are prefixed with vault scheme

* formatting: replace double quote with single quote

* uncomment accidentally-commented lines

* always set internal port name to https-internal, since it is always https

* prefix headless service internal port name with https
2020-04-13 08:48:23 -07:00
Denys Vitali
0e115513c2
docs(REAMDE): Fix Vault K8s dead link (#256) 2020-04-10 10:43:14 -04:00
Jason O'Donnell
c869fa8651
changelog++ 2020-04-09 12:51:35 -04:00
Jared Allard
27a3a76513
fix(templates/server): ingress has default paths of / (#224)
* fix(templates/server): ingress has default paths of /

* fix: array -> list

It's been awhile since I wrote Helm templates :/
2020-04-09 12:48:42 -04:00
Petter Abrahamsson
497daa5f60
Remove IPC_LOCK capability (#198)
* Remove IPC_LOCK capability

* Remove tests for IPC_LOCK
2020-04-09 12:47:17 -04:00
Jason O'Donnell
13f6df4e6a
Update to 0.5.0 (#253)
* Update to 0.5.0

* Add changelog for k8s service discovery
2020-04-09 09:51:37 -04:00
Jason O'Donnell
6d5a2174d8
Add Vault Helm ent support, service discovery (#250)
* Add Vault Helm ent support, service discovery

* Fix unit test

* Update test/acceptance/server-ha-enterprise-dr.bats

Co-Authored-By: Theron Voran <tvoran@users.noreply.github.com>

* Update test/acceptance/server-ha-enterprise-dr.bats

Co-Authored-By: Theron Voran <tvoran@users.noreply.github.com>

* Update test/acceptance/server-ha-enterprise-perf.bats

Co-Authored-By: Theron Voran <tvoran@users.noreply.github.com>

* Update test/acceptance/server-ha-enterprise-perf.bats

Co-Authored-By: Theron Voran <tvoran@users.noreply.github.com>

* Update values.yaml

Co-Authored-By: Theron Voran <tvoran@users.noreply.github.com>

Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
2020-04-09 09:26:58 -04:00
Luiz Muller
2b137c95d2
fix link to documentation (#247) 2020-04-03 17:47:33 -07:00
Jason O'Donnell
e97f4a579f
Fix hardcoded service name in raft enfv (#240) 2020-03-26 17:19:26 -04:00
Daniel Mittelman
ac64feb0eb
Clarified documentation about Raft PV creation (#239) 2020-03-26 10:15:08 -04:00
Jason O'Donnell
d57bd7cb6e
Fix bug with api server env (#237) 2020-03-23 12:10:47 -04:00
Theron Voran
0550623c21
Fix server-headless-service annotations (#236)
`Values.server.service.annotations` are now being treated as multi-line
strings, to match the other annotations in the chart, and to support
templating within the annotations.
2020-03-20 10:54:32 -07:00
Theron Voran
04df47159d
Update CHANGELOG.md 2020-03-20 08:39:56 -07:00
Theron Voran
2a37c571d7
Making all annotations multi-line strings (#227)
Annotations for various objects were either multi-line strings or yaml
maps strings, so this is making them all multi-line strings for
consistency. Also updated the doc comment for namespaceSelector, since
it's being read as a yaml map (toYaml).
2020-03-20 08:37:40 -07:00
Theron Voran
127b95d6f9
changelog++ 2020-03-19 22:45:58 -07:00
Theron Voran
1a8d9de511
Injector scheduler options (#234)
Adds affinity, tolerations, and nodeSelector options for the
injector deployment that are separate from those options on the vault
server statefulset.

Co-authored-by: Sergei Shishov <sergei.shishov@dubizzle.com>
2020-03-19 22:43:52 -07:00
Theron Voran
aeaeaa02fb
changelog++ 2020-03-18 21:32:45 -07:00
Theron Voran
fa13c47858
Add injector.extraEnvironmentVars (#232)
Allows user-specified environment variables to be set in the injector
deployment.
2020-03-18 21:30:22 -07:00
Jason O'Donnell
9e0030d70a
changelog++ 2020-03-18 15:50:53 -04:00
Jason O'Donnell
58b96dbc10
Add Raft HA support (#229)
* Add raft support

* Add acceptance test

* Update templates/server-headless-service.yaml

Co-Authored-By: Theron Voran <tvoran@users.noreply.github.com>

* Add notes to raft configurables

Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
2020-03-18 15:49:14 -04:00
Jason O'Donnell
d0f89fced8
Change revoke from bool to string (#221) 2020-03-06 16:59:59 -05:00
Jason O'Donnell
b8fc51b2be
changelog++ 2020-03-06 15:10:41 -05:00
Jason O'Donnell
9d1693ad13
Add new vault-k8s environment variables (#219)
* Add new vault-k8s envs

* update vault image

* Add default tests for envs

* Add note about supported log parameters

* Fix typo in test name
2020-03-06 15:03:58 -05:00
Theron Voran
9d92922c9d
changelog++ 2020-03-03 10:37:47 -08:00
Bruno FERNANDO
1ccc64788a
feat: add AGENT_INJECT_VAULT_AUTH_PATH option to the injector (#185)
* Add related unit tests
2020-03-03 10:32:50 -08:00
Jason O'Donnell
8a6419e623
Update to 0.4.0 (#211) 2020-02-21 14:56:30 -05:00
Theron Voran
2b0d91d614
Fix the injector deployment unit test (#212)
Set namespace manually, so the test service will have a known
namespace.
2020-02-21 11:39:41 -08:00
Theron Voran
088331f246
changelog++
missed a couple brackets
2020-02-21 08:25:17 -08:00
Theron Voran
71fad856a1
changelog++
Also added links
2020-02-21 08:23:57 -08:00
Theron Voran
2b2b0dd2fa
Added support for external vault (#207)
Uses Values.injector.externalVaultAddr to control the vault address
env variable and server yaml rendering.

If injector.externalVaultAddr is empty, both the injector and vault
are deployed, with the injector using the local vault. If
injector.externalVaultAddr is not empty, only the injector is
deployed, and it uses the vault at the address specified in
injector.externalVaultAddr.
2020-02-21 08:16:33 -08:00
Theron Voran
872ae7a48f
changelog++ 2020-02-06 08:46:09 -08:00
Theron Voran
77b973c17f
Helm 3 support (#195)
Update chart and tests to Helm 3

Co-authored-by: Matt Piekunka <mpiekunk@users.noreply.github.com>
Co-authored-by: Mike Brancato <mbrancato@users.noreply.github.com>
2020-02-06 08:44:38 -08:00
Theron Voran
1f94e221c3
changelog++ 2020-01-30 09:49:29 -08:00
Theron Voran
45c9118782
Adding sleep in the preStop lifecycle step (#188)
Aims to make vault pod termination more graceful with respect to user
requests.
2020-01-30 09:39:08 -08:00
Jason O'Donnell
7a6e8c3648
changelog++ 2020-01-18 07:38:00 -05:00
Yong Wen Chua
eccd71bfe2 Allow configure StatefulSet updateStrategy (#172) 2020-01-18 07:36:45 -05:00
Jason O'Donnell
0099ea8a94
changelog++ 2020-01-15 10:16:28 -05:00
fischerman
4209cbcc2d make shareProcessNamespace configurable (#174)
* make shareProcessNamespace configurable

* add unit tests
2020-01-15 05:06:54 -05:00
fischerman
1f68852dc2 add lifecycle to vault instead of extra container (#179) 2020-01-15 05:03:20 -05:00
Jason O'Donnell
80027d3bda
Update to v0.3.3 (#178)
* Update to v0.3.3

* Reorder changelog
2020-01-14 14:14:27 -05:00
Jason O'Donnell
b8978603db
changelog++ 2020-01-14 10:18:08 -05:00
Jason O'Donnell
e8e804d873
changelog++ 2020-01-14 10:12:40 -05:00
Jason O'Donnell
ac2925d250
Add extraArgs configurable (#176) 2020-01-14 10:09:20 -05:00
Ryan Eschinger
4ee82fd984 fix injector env var names for manual tls config (#171)
AGENT_INJECT_CERT_FILE -> AGENT_INJECT_TLS_CERT_FILE
AGENT_INJECT_KEY_FILE -> AGENT_INJECT_TLS_KEY_FILE

see
611492d04b/subcommand/injector/flags.go (L56)

fixes #170
2020-01-13 12:49:13 -05:00
Jason O'Donnell
551f292b6f
Update to 0.3.2 (#166) 2020-01-08 10:05:06 -05:00
Jason O'Donnell
98e7e0a7c9
Update to 0.3.1 (#162) 2020-01-02 12:18:22 -05:00
Jason O'Donnell
3e91343f6d
Update CONTRIBUTING.md 2019-12-20 09:30:58 -05:00
Jason O'Donnell
7d8ae7df46
Update to 0.3.0 (#154) 2019-12-19 11:49:50 -05:00
Jason O'Donnell
16bb8999ae
changelog++ 2019-12-19 10:58:28 -05:00
Jason O'Donnell
82083061a0
Add vault agent injector (#150)
* Add vault agent injector

* Fix bug with agent image env

* Fix terraform GKE code

* Cleanup label

* Improve test reliablity

* Lower sleep times in tests

* Standardize image values

* Update values

* Update vault tag
2019-12-19 10:57:51 -05:00
Jason O'Donnell
268c2418d3
Add configurable nodeport (#152) 2019-12-18 12:22:19 -05:00
Jason O'Donnell
36d6c283e4
Update CHANGELOG.md 2019-12-16 18:09:05 -05:00
Darren Clark
ba6cfe675e Statefulset Liveness Probe failing on standby nodes due to SSL, initial delay and 429 response #137 (#138)
livenessProbe

 * Set the scheme for vault.scheme to ensure that the check works if tls enabled or not

 * Allow a configurable value initialDelaySeconds rather than the set 5 seconds

 * Set the default initialDelaySeconds to 60 seconds before the probe starts to allow for vault unsealing

 * Set the path to /v1/sys/health?standbyok=true to ensure a 200 response on standbys

readinessProbe

 * Set the path comment to /v1/sys/health?standbyok=true to ensure a 200 response on standbys

 * Set the scheme for vault.scheme to ensure that the check works if tls enabled or not

 * Statefulset liveness probe path check set to /v1/sys/health?standbyok=true

 * Server Statefulset test added for livenessProbe.initialDelaySeconds
2019-12-16 18:07:23 -05:00
Michael Golowka OR 1=1); DROP TABLE users; --
35f198f35f
Update CHANGELOG.md 2019-12-11 14:07:44 -07:00
Michael Golowka OR 1=1); DROP TABLE users; --
c390b3f6df Fix typo: serviceaccount -> serviceAccount (#147)
* Fix typo: serviceaccount -> serviceAccount

* Fix typo in test
2019-12-11 16:04:57 -05:00
Jason O'Donnell
e1ecb0d8ad
Update CHANGELOG.md 2019-12-09 16:52:23 -05:00
Daniel Mittelman
4a743f655e Promote Docker image version to 1.3.0 (#136) 2019-12-06 09:38:49 -05:00
Jason O'Donnell
37e92331b9
Add publishNotReadyAddresses to UI service (#131) 2019-12-03 14:55:33 -05:00
Jason O'Donnell
938c874e77
Update CHANGELOG.md 2019-12-02 17:22:15 -05:00
Jason O'Donnell
1c9c64c8f8
Remove chart from labels (#128) 2019-12-02 17:14:59 -05:00
Jason O'Donnell
8eac1ed98e
Update CHANGELOG.md 2019-11-28 19:09:42 -05:00
Holden Omans
a0325cfd14 Configure pod probes (#104)
* Added option for enabling a livenessprobe

* added option for using http for readinessProbe

* added tests
2019-11-28 18:24:41 -05:00
Janusz Bialy
2ff7d47c07 Use a standard way to define the container image (#103)
* use a standard way to define image repo and tag

Signed-off-by: Janusz Bialy <jbialy@gmail.com>

* add tests

Signed-off-by: Janusz Bialy <jbialy@gmail.com>

* bump chart version

Signed-off-by: Janusz Bialy <jbialy@gmail.com>

* Revert "bump chart version"

This reverts commit 74cbc984a7d4cf9098acf78977cdc8598c557550.

Signed-off-by: Janusz Bialy <jbialy@gmail.com>

* nest image block inside server

Signed-off-by: Janusz Bialy <jbialy@gmail.com>
2019-11-28 17:39:28 -05:00
Jason O'Donnell
52f3686c12
Update CHANGELOG.md 2019-11-21 14:21:23 -05:00
Shahbaz Nazir
faf5a84c5e Add possibility to run sidecars with vault (#87)
* Add extra containers

* fix template

* add unit tests

* resolve conflicts

* remove duplicate docs

* fix unit tests
2019-11-21 14:07:41 -05:00
Ivan Aracki
6bef1e19df Fix server.dataStorage explanation link (#115) 2019-11-18 11:59:15 -05:00
Jason O'Donnell
fbe3c154a5
Update to 0.2.1 (#111) 2019-11-12 19:59:31 -05:00
Jason O'Donnell
3fbbf7b8df
Remove readOnlyRootFilesystem configurable (#110) 2019-11-12 19:55:31 -05:00
Jason O'Donnell
a5331f5b38
Update for 0.2.0 release (#102) 2019-11-11 10:51:00 -05:00
Sergii
ea0e66760f Add extra label to Ingress (#108) 2019-11-07 11:23:56 -05:00
Jason O'Donnell
50addb76c5
changelog++ 2019-11-06 11:08:28 -05:00
Jason O'Donnell
a9e6a0a938
Add preStop lifecycle hook (#105)
* Add preStop lifecycle hook

* Fix typo in comment
2019-11-06 11:06:57 -05:00
Jason O'Donnell
e3c771a467
changelog++ 2019-10-29 11:19:37 -04:00
Luke Barton
04303baa5f Fix bad GCP environment variable example (#101) 2019-10-28 11:56:29 -04:00
Janusz Bialy
a2b2d32e92 Add support for image pull policy and secrets (#92)
* add image pull policy and pull secrets

Signed-off-by: Janusz Bialy <jbialy@gmail.com>

* add unit tests

Signed-off-by: Janusz Bialy <jbialy@gmail.com>
2019-10-24 12:58:32 -04:00
Jason O'Donnell
e1b89d6396
Make readOnlyRootFilesystem configurable (#93) 2019-10-24 12:40:19 -04:00
Jason O'Donnell
2ca3fd2214
changelog++ (#94) 2019-10-21 17:08:42 -04:00
Yves Blusseau
75ceb1af5a Fix PodDisruptionBudget template (#88)
* Fix bad selectors.
* Fix bad calculation of maxUnavailable.

Signed-off-by: JrCs <90z7oey02@sneakemail.com>
2019-10-21 09:51:02 -04:00
Jason O'Donnell
b41d36c621
Require vault to run as non root (#80)
* Require vault to run as non root

* Fix unit tests

* Make uid/gid configurable, remove home emptydir
2019-10-18 12:42:25 -04:00
savagete2860
f7aa2576d0 Add load balancer source range for UI service (#83)
* add load balancer source range for UI service

* add load balancer source range for UI service

* adding unit test

* adding unit test
2019-10-18 12:41:53 -04:00
Jason O'Donnell
9fd0ad6e20
Fix audit storage mount in HA mode (#79)
* Fix audit storage mount in HA mode

* Add explicit fsgroup
2019-10-10 10:03:44 -04:00
Jason O'Donnell
789a806485
Fix affinity labels in values (#74) 2019-10-07 12:55:52 -04:00
Ryan Wholey
f957c52acc Add support for setting service type (#65) 2019-10-06 16:06:45 -04:00
Alejandro Garrido Mota
b52b0d3c15 Added unit tests for generic annotations (#64) 2019-10-06 15:58:49 -04:00
StupidScience
c6adb89d4b added possibility to add extraLabels for server pod (#59) 2019-10-06 15:50:48 -04:00
Jason O'Donnell
d696408fae Allow annotations on ui dev service 2019-09-27 09:20:30 -07:00
Alejandro Garrido Mota
9dd6bad741 Support for ingress (#48)
* Added ingress support

* Added small header with documentation about ingress

* Added unit tests
2019-09-27 10:42:24 -05:00
malnick
b1e4660555 build: add circleci config for executing bats unit tests 2019-09-26 20:22:44 -07:00
malnick
5cb28fbc95 test: add test targets for running bats via docker to Makefile 2019-09-26 20:00:57 -07:00
Jeff Malnick
1773a5759d
Merge pull request #52 from mogaal/service-annotations
Service annotations support
2019-09-26 19:45:51 -07:00
Jason O'Donnell
09f56da548
Remove privileged, add mlock configurable (#50) 2019-09-23 01:11:04 -04:00
Jason O'Donnell
8f382aab65
Fix ui annotation test (#57) 2019-09-23 00:44:25 -04:00
Alejandro Garrido Mota
865b98f55d Added support for service annotations 2019-09-11 16:39:25 +01:00
Arun Kumar
3f5b0b7b7e Changed vault service port and targetPort to values file (#43)
* Changed vault service port and targetPort to values file

* Fixed typo in vaules, adding server-service changes and tests

* Changed port and targetPort to server.service
2019-09-06 11:13:23 -04:00
Vincent Desjardins
2852fbba9b annotation configuration on service account (#47)
Signed-off-by: Vincent Desjardins <vdesjardins@gmail.com>
2019-09-06 10:48:12 -04:00
Alexander Schramm
5a64f9cc9e feat: allow setting loadBalancerIP and externalPort for service-ui (#44)
* feat: allow setting loadBalancerIP and externalPort for service-ui

* test: remove tests with wrong value

There is no `ui.service.enabled` field, `ui.enabled` is used to create
the service and that is tested in line 29.

* test: loadBalancerIP is used if set.
2019-09-06 10:27:31 -04:00
Sophian Mehboub
bb7ce9409b add namespace in vault manifest definition (#38) 2019-08-28 09:58:48 -04:00
Jason O'Donnell
0c86c6420a
Add privileged for mlock requirements (#35)
* Add privilged for mlock requirements

* Update Chart version
2019-08-22 16:32:30 -04:00
Miroslav E. Hadzhiev
4b12c39099 Address K8s Deprecation of Kubelet security controls. Remove Whitespaces. (#24) 2019-08-22 11:05:31 -04:00
Jason O'Donnell
10046f8886
Update changelog for 0.1.2 (#34) 2019-08-22 10:53:22 -04:00
Jason O'Donnell
a6c17ed48a
Remove step-down preStop (#31) 2019-08-21 17:34:31 -04:00
Sri Hari Vignesh
e99b03855c Correct volume indents (#28) 2019-08-21 11:15:47 -04:00
Dat Truong
54c7c34af7 Use correct name label for UI Service object (#30) 2019-08-21 10:06:05 -04:00
Jason O'Donnell
acd1638b28
Add VAULT_API_ADDR as environment var (#26) 2019-08-20 17:09:06 -04:00
Jason O'Donnell
abb2b6e56e
Remove version label from resources (#27) 2019-08-20 17:08:49 -04:00
Dat Truong
c0f5c7acc0 Add TLS support (#21)
* Add Secret env vars

* Add custom path for volume mounting

* Add HTTPS support

* Add test for tls

* Simplify network setup

* Make tls_disable true as default

* Update values variable to camelCase
2019-08-20 11:40:47 -04:00
Amos Kyler
e312f00a03 Support UI service annotations (#19)
* support ui service annotations

* Update templates/ui-service.yaml

Co-Authored-By: Dat Truong <mr.anhdat@gmail.com>

* fix service annotation indent and write unit tests
2019-08-16 11:59:51 -04:00
JoeStack
a049b48379 Update ui-service.yaml (#23)
port 80 doesn't work in case of https. So the default behavior in all of our docs is to use <vault-ip>:8200
2019-08-16 11:58:35 -04:00
Dat Truong
2154e341ea Add secret env vars and custom mounting path (#16)
* Add Secret env vars

* Add custom path for volume mounting
2019-08-14 16:29:07 -04:00
Alexandre Garcia
be6e58375b fix ui service selector (#15) 2019-08-12 10:04:08 -04:00
Alexandre Garcia
0b2218d1d9 Only include clusterIp on vault service if set in values (#12) 2019-08-12 09:57:56 -04:00
Jason O'Donnell
0b8aacb590
Add clusterrolebinding, fix service, update Vault (#10)
* Add clusterrolebinding, fix service, update Vault

* Change authDelegator to false by default

* Clarify clusterIP comment
2019-08-08 14:14:58 -04:00
Khris Richardson
bd02c9ba5f remove field only valid for pod from container securityContext (#9) 2019-08-07 19:23:51 -04:00
Jason O'Donnell
db571d8dda
Update helm labels (#8) 2019-08-07 14:55:32 -04:00
Jason O'Donnell
0342358c94
Update changelog (#6) 2019-08-05 17:47:37 -04:00
Jason O'Donnell
8e1bd927f2
Add tolerations, nodeselector and annotations (#5) 2019-08-05 12:31:06 -04:00
Justin Weissig
21eee8e76d bump to 1.2 (#4) 2019-08-02 16:17:26 -04:00
Jason O'Donnell
b7469914e2
Refactor chart for 1.0, add tests, update TF (#2)
* Refactor chart for 1.0, add tests, update TF

* Fix typo in helper comment

* Add NOTES for post install instructions

* Fix typo in NOTES

* Fix replication port for enterprise

* Change updateStrategy to OnDelete

* Add icon

* Remove cluster address from config

* Update README, add contributing doc

* Update README

* Change HA replicas to 3
2019-07-31 14:26:12 -04:00
Jason O'Donnell
ca40087add
Remove unused DNS service (#1) 2019-07-02 13:29:36 -04:00
Clint Shryock
51d8b51e14
update readme to remove links to docs we don't have yet 2018-12-03 16:12:51 -06:00
Clint Shryock
001ff9450f
comment out the auto-unseal blocks 2018-12-03 16:08:20 -06:00
Clint Shryock
b70470d917
add note about auto-unseal 2018-12-03 16:06:17 -06:00
Clint Shryock
0e61f4f581
add/update how disruption budget works 2018-12-03 11:30:50 -06:00
Clint Shryock
51ffe193f8
rename to match HA 2018-12-03 10:44:53 -06:00
Clint Shryock
1d20f9f11f
create seperate configmap test for HA 2018-12-03 10:44:02 -06:00
Clint Shryock
38d245d343
update ha server unit tests 2018-11-30 16:44:38 -06:00
Clint Shryock
81b11691ae
add service disruption back for HA setup 2018-11-30 16:29:46 -06:00
Clint Shryock
21216ec700
remove debug code 2018-11-30 16:05:59 -06:00
Clint Shryock
3dc9474ffc
update defaults for ui-service test 2018-11-30 16:05:40 -06:00
Clint Shryock
dc808dc106
rename extra config file generated 2018-11-30 16:02:53 -06:00
Clint Shryock
fa95b2df84
ha stateful set tests 2018-11-30 16:02:33 -06:00
Clint Shryock
b653371214
update tests 2018-11-30 16:01:25 -06:00
Clint Shryock
b8878a696c
no client 2018-11-29 15:50:49 -06:00
Clint Shryock
20fd374531
update terraform config: specific scopes needed to use auto-unseal. Right now a pre-made service account is used, but will be replaced later 2018-11-29 15:48:02 -06:00
Clint Shryock
0c4195e707
fix typo 2018-11-28 16:55:51 -06:00
Clint Shryock
8156a94a02
update ha vs non-ha test names 2018-11-28 16:54:03 -06:00
Clint Shryock
42600a73fc
update single server acc test, add HA test that installs Consul and runs HA mode 2018-11-28 16:40:37 -06:00
Clint Shryock
6688814862
update acceptance test to check vault single server boots, and is running but sealed and uninitialized 2018-11-28 11:43:24 -06:00
Clint Shryock
66211943e8
update values, single-server and test 2018-11-27 15:45:32 -06:00
Clint Shryock
c4d630f38f
default single server mode 2018-11-27 15:26:48 -06:00
Clint Shryock
34e0b377d9
rename consulHA to serverHA; add dev mode, update config and values 2018-11-26 16:12:03 -06:00
Clint Shryock
666cdb75cc
add dev mode 2018-11-26 15:35:52 -06:00
Clint Shryock
bcc8a8db5f
re-add seperate config map file for single server. Update config/values and statefulsets. Add auto-unseal config to single server 2018-11-26 11:44:05 -06:00
Clint Shryock
616e262518
update values to default 1 server, for easier init/setup 2018-11-20 16:23:39 -06:00
Clint Shryock
3b31f76981
update values to use gcpkms key for auto-unseal 2018-11-20 16:23:16 -06:00
Clint Shryock
678c50bb72
update config - only on HA for now, may need to split things out 2018-11-19 15:09:59 -06:00
Clint Shryock
b0944d48df
consolidate config-map 2018-11-19 14:49:30 -06:00
Clint Shryock
0d3280254c
update values, correct security spot for contianers 2018-11-16 16:46:29 -06:00
Clint Shryock
5a4c3e69b1
refactoring for statefulset 2018-11-16 16:34:10 -06:00
Clint Shryock
180ba0cd6c
rename deployment to stateful set; just the filename though 2018-11-16 16:08:17 -06:00
Clint Shryock
61f1b646ea
use '-' for default server 2018-11-16 16:08:00 -06:00
Clint Shryock
70c3d04430
update beta version 2018-11-16 15:52:25 -06:00
Clint Shryock
4011d88c27
snapshot 2018-10-29 10:36:53 -05:00
Clint Shryock
5d0ffcabe0
snapshot of dev before I switched tasks 2018-10-29 10:36:23 -05:00
Clint Shryock
9e8d74de04
Add stateless configuration. Assumes a consul deployed 2018-10-08 16:35:20 -05:00
Clint Shryock
2061e199d4
probably wrong format values 2018-10-05 16:34:07 -05:00
Clint Shryock
a23a7982a9
add consul
HA section
2018-10-05 16:33:42 -05:00
156 changed files with 18634 additions and 1357 deletions

46
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View file

@ -0,0 +1,46 @@
---
name: Bug report
about: Let us know about a bug!
title: ''
labels: bug
assignees: ''
---
<!-- Please reserve GitHub issues for bug reports and feature requests.
**Please note**: We take OpenBao's security and our users' trust very seriously. If
you believe you have found a security issue in OpenBao Helm, _please responsibly disclose_
by contacting us at [openbao-security@lists.lfedge.org](mailto:openbao-security@lists.lfedge.org).
-->
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Install chart
2. Run bao command
3. See error (openbao logs, etc.)
Other useful info to include: openbao pod logs, `kubectl describe statefulset openbao` and `kubectl get statefulset openbao -o yaml` output
**Expected behavior**
A clear and concise description of what you expected to happen.
**Environment**
* Kubernetes version:
* Distribution or cloud vendor (OpenShift, EKS, GKE, AKS, etc.):
* Other configuration options or runtime services (istio, etc.):
* openbao-helm version:
Chart values:
```yaml
# Paste your user-supplied values here (`helm get values <release>`).
# Be sure to scrub any sensitive values!
```
**Additional context**
Add any other context about the problem here.

6
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View file

@ -0,0 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
contact_links:
- name: Ask a question
url: https://chat.lfx.linuxfoundation.org/#/room/#openbao-questions:chat.lfx.linuxfoundation.org

View file

@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

View file

@ -0,0 +1,24 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
name: Setup common testing tools
description: Install bats and python-yq
runs:
using: "composite"
steps:
- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: '16'
- run: npm install -g bats@${BATS_VERSION}
shell: bash
env:
BATS_VERSION: '1.8.2'
- run: bats -v
shell: bash
- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
with:
python-version: '3.10'
- run: pip install yq
shell: bash
permissions:
contents: read

7
.github/dependabot.yml vendored Normal file
View file

@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"

22
.github/workflows/acceptance.yaml vendored Normal file
View file

@ -0,0 +1,22 @@
name: Acceptance Tests
on: [push, workflow_dispatch]
jobs:
kind:
strategy:
fail-fast: false
matrix:
kind-k8s-version: [1.27.11, 1.28.7, 1.29.2]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup test tools
uses: ./.github/actions/setup-test-tools
- name: Create K8s Kind Cluster
uses: helm/kind-action@99576bfa6ddf9a8e612d83b513da5a75875caced # v1.9.0
with:
config: test/kind/config.yaml
node_image: kindest/node:v${{ matrix.kind-k8s-version }}
version: v0.22.0
- run: bats --tap --timing ./test/acceptance
permissions:
contents: read

47
.github/workflows/lint-chart.yml vendored Normal file
View file

@ -0,0 +1,47 @@
name: Lint and Test Chart
on:
pull_request:
paths:
- 'charts/**'
permissions:
contents: read
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: "0"
- name: Install Helm
uses: azure/setup-helm@v4
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.6.1
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Run chart-testing (lint)
id: lint
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --target-branch ${{ github.event.repository.default_branch }}
- name: Create kind cluster
uses: helm/kind-action@v1.10.0
if: steps.list-changed.outputs.changed == 'true'
- name: Run chart-testing (install)
id: install
if: steps.list-changed.outputs.changed == 'true'
run: ct install --target-branch ${{ github.event.repository.default_branch }}

38
.github/workflows/release-chart.yml vendored Normal file
View file

@ -0,0 +1,38 @@
name: Release
on:
push:
branches:
- main
paths:
- 'charts/**'
jobs:
release:
environment: helm-release
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Install Helm
uses: azure/setup-helm@v3.5
id: helm-install
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run chart-releaser
id: helm-release
uses: helm/chart-releaser-action@v1.6.0
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_GENERATE_RELEASE_NOTES: true

24
.github/workflows/tests.yaml vendored Normal file
View file

@ -0,0 +1,24 @@
name: Tests
on: [push, workflow_dispatch]
jobs:
bats-unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: ./.github/actions/setup-test-tools
- run: bats --tap --timing ./test/unit
chart-verifier:
runs-on: ubuntu-latest
env:
CHART_VERIFIER_VERSION: "1.13.7"
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup test tools
uses: ./.github/actions/setup-test-tools
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: "1.22.5"
- run: go install "github.com/redhat-certification/chart-verifier@${CHART_VERIFIER_VERSION}"
- run: bats --tap --timing ./test/chart
permissions:
contents: read

8
.gitignore vendored
View file

@ -4,3 +4,11 @@
terraform.tfstate*
terraform.tfvars
values.dev.yaml
vaul-helm-dev-creds.json
./test/acceptance/vaul-helm-dev-creds.json
./test/terraform/vaul-helm-dev-creds.json
./test/unit/vaul-helm-dev-creds.json
./test/acceptance/values.yaml
./test/acceptance/values.yml
.idea
scratch/

View file

@ -1,4 +0,0 @@
.git/
.terraform/
bin/
test/

View file

@ -1,14 +1,531 @@
## 0.2.0 (September 26, 2018)
## Unreleased
FEATURES:
Bugs:
* injector: add missing `get` `nodes` permission to ClusterRole [GH-1005](https://github.com/hashicorp/vault-helm/pull/1005)
* `syncCatalog` can install the [service catalog sync](https://www.hashicorp.com/blog/consul-and-kubernetes-service-catalog-sync)
functionality.
## 0.27.0 (November 16, 2023)
IMPROVEMENTS:
Changes:
* server: support `storageClass` [GH-7]
* Default `vault` version updated to 1.15.2
## 0.1.0
Features:
* server: Support setting `persistentVolumeClaimRetentionPolicy` on the StatefulSet [GH-965](https://github.com/hashicorp/vault-helm/pull/965)
* server: Support setting labels on PVCs [GH-969](https://github.com/hashicorp/vault-helm/pull/969)
* server: Support setting ingress rules for networkPolicy [GH-877](https://github.com/hashicorp/vault-helm/pull/877)
Improvements:
* Support exec in the server liveness probe [GH-971](https://github.com/hashicorp/vault-helm/pull/971)
## 0.26.1 (October 30, 2023)
Bugs:
* Fix templating of `server.ha.replicas` when set via override file. The `0.26.0` chart would ignore `server.ha.replicas` and always deploy 3 server replicas when `server.ha.enabled=true` unless overridden by command line when issuing the helm command: `--set server.ha.replicas=<some_number>`. Fixed in [GH-961](https://github.com/hashicorp/vault-helm/pull/961)
## 0.26.0 (October 27, 2023)
Changes:
* Default `vault` version updated to 1.15.1
* Default `vault-k8s` version updated to 1.3.1
* Default `vault-csi-provider` version updated to 1.4.1
* Tested with Kubernetes versions 1.24-1.28
* server: OpenShift default readiness probe returns 204 when uninitialized [GH-966](https://github.com/hashicorp/vault-helm/pull/966)
Features:
* server: Add support for dual stack clusters [GH-833](https://github.com/hashicorp/vault-helm/pull/833)
* server: Support `hostAliases` for the StatefulSet pods [GH-955](https://github.com/hashicorp/vault-helm/pull/955)
* server: Add `server.service.active.annotations` and `server.service.standby.annotations` [GH-896](https://github.com/hashicorp/vault-helm/pull/896)
* server: Add long-lived service account token option [GH-923](https://github.com/hashicorp/vault-helm/pull/923)
Bugs:
* csi: Add namespace field to `csi-role` and `csi-rolebindings`. [GH-909](https://github.com/hashicorp/vault-helm/pull/909)
Improvements:
* global: Add `global.namespace` to override the helm installation namespace. [GH-909](https://github.com/hashicorp/vault-helm/pull/909)
* server: use vault.fullname in Helm test [GH-912](https://github.com/hashicorp/vault-helm/pull/912)
* server: Allow scaling HA replicas to zero [GH-943](https://github.com/hashicorp/vault-helm/pull/943)
## 0.25.0 (June 26, 2023)
Changes:
* Latest Kubernetes version tested is now 1.27
* server: Headless service ignores `server.service.publishNotReadyAddresses` setting and always sets it as `true` [GH-902](https://github.com/hashicorp/vault-helm/pull/902)
* `vault` updated to 1.14.0 [GH-916](https://github.com/hashicorp/vault-helm/pull/916)
* `vault-csi-provider` updated to 1.4.0 [GH-916](https://github.com/hashicorp/vault-helm/pull/916)
Improvements:
* CSI: Make `nodeSelector` and `affinity` configurable for CSI daemonset's pods [GH-862](https://github.com/hashicorp/vault-helm/pull/862)
* injector: Add `ephemeralLimit` and `ephemeralRequest` as options for configuring Agent's ephemeral storage resources [GH-798](https://github.com/hashicorp/vault-helm/pull/798)
* Minimum kubernetes version for chart reverted to 1.20.0 to allow installation on clusters older than the oldest tested version [GH-916](https://github.com/hashicorp/vault-helm/pull/916)
Bugs:
* server: Set the default for `prometheusRules.rules` to an empty list [GH-886](https://github.com/hashicorp/vault-helm/pull/886)
## 0.24.1 (April 17, 2023)
Bugs:
* csi: Add RBAC required by v1.3.0 to create secret for HMAC key used to generate secret versions [GH-872](https://github.com/hashicorp/vault-helm/pull/872)
## 0.24.0 (April 6, 2023)
Changes:
* Earliest Kubernetes version tested is now 1.22
* `vault` updated to 1.13.1 [GH-863](https://github.com/hashicorp/vault-helm/pull/863)
* `vault-k8s` updated to 1.2.1 [GH-868](https://github.com/hashicorp/vault-helm/pull/868)
* `vault-csi-provider` updated to 1.3.0 [GH-749](https://github.com/hashicorp/vault-helm/pull/749)
Features:
* server: New `extraPorts` option for adding ports to the Vault server statefulset [GH-841](https://github.com/hashicorp/vault-helm/pull/841)
* server: Add configurable Port Number in readinessProbe and livenessProbe for the server-statefulset [GH-831](https://github.com/hashicorp/vault-helm/pull/831)
* injector: Make livenessProbe and readinessProbe configurable and add configurable startupProbe [GH-852](https://github.com/hashicorp/vault-helm/pull/852)
* csi: Add an Agent sidecar to Vault CSI Provider pods to provide lease caching and renewals [GH-749](https://github.com/hashicorp/vault-helm/pull/749)
## 0.23.0 (November 28th, 2022)
Changes:
* `vault` updated to 1.12.1 [GH-814](https://github.com/hashicorp/vault-helm/pull/814)
* `vault-k8s` updated to 1.1.0 [GH-814](https://github.com/hashicorp/vault-helm/pull/814)
* `vault-csi-provider` updated to 1.2.1 [GH-814](https://github.com/hashicorp/vault-helm/pull/814)
Features:
* server: Add `extraLabels` for Vault server serviceAccount [GH-806](https://github.com/hashicorp/vault-helm/pull/806)
* server: Add `server.service.active.enabled` and `server.service.standby.enabled` options to selectively disable additional services [GH-811](https://github.com/hashicorp/vault-helm/pull/811)
* server: Add `server.serviceAccount.serviceDiscovery.enabled` option to selectively disable a Vault service discovery role and role binding [GH-811](https://github.com/hashicorp/vault-helm/pull/811)
* server: Add `server.service.instanceSelector.enabled` option to allow selecting pods outside the helm chart deployment [GH-813](https://github.com/hashicorp/vault-helm/pull/813)
Bugs:
* server: Quote `.server.ha.clusterAddr` value [GH-810](https://github.com/hashicorp/vault-helm/pull/810)
## 0.22.1 (October 26th, 2022)
Changes:
* `vault` updated to 1.12.0 [GH-803](https://github.com/hashicorp/vault-helm/pull/803)
* `vault-k8s` updated to 1.0.1 [GH-803](https://github.com/hashicorp/vault-helm/pull/803)
## 0.22.0 (September 8th, 2022)
Features:
* Add PrometheusOperator support for collecting Vault server metrics. [GH-772](https://github.com/hashicorp/vault-helm/pull/772)
Changes:
* `vault-k8s` to 1.0.0 [GH-784](https://github.com/hashicorp/vault-helm/pull/784)
* Test against Kubernetes 1.25 [GH-784](https://github.com/hashicorp/vault-helm/pull/784)
* `vault` updated to 1.11.3 [GH-785](https://github.com/hashicorp/vault-helm/pull/785)
## 0.21.0 (August 10th, 2022)
CHANGES:
* `vault-k8s` updated to 0.17.0. [GH-771](https://github.com/hashicorp/vault-helm/pull/771)
* `vault-csi-provider` updated to 1.2.0 [GH-771](https://github.com/hashicorp/vault-helm/pull/771)
* `vault` updated to 1.11.2 [GH-771](https://github.com/hashicorp/vault-helm/pull/771)
* Start testing against Kubernetes 1.24. [GH-744](https://github.com/hashicorp/vault-helm/pull/744)
* Deprecated `injector.externalVaultAddr`. Added `global.externalVaultAddr`, which applies to both the Injector and the CSI Provider. [GH-745](https://github.com/hashicorp/vault-helm/pull/745)
* CSI Provider pods now set the `VAULT_ADDR` environment variable to either the internal Vault service or the configured external address. [GH-745](https://github.com/hashicorp/vault-helm/pull/745)
Features:
* server: Add `server.statefulSet.securityContext` to override pod and container `securityContext`. [GH-767](https://github.com/hashicorp/vault-helm/pull/767)
* csi: Add `csi.daemonSet.securityContext` to override pod and container `securityContext`. [GH-767](https://github.com/hashicorp/vault-helm/pull/767)
* injector: Add `injector.securityContext` to override pod and container `securityContext`. [GH-750](https://github.com/hashicorp/vault-helm/pull/750) and [GH-767](https://github.com/hashicorp/vault-helm/pull/767)
* Add `server.service.activeNodePort` and `server.service.standbyNodePort` to specify the `nodePort` for active and standby services. [GH-610](https://github.com/hashicorp/vault-helm/pull/610)
* Support for setting annotations on the injector's serviceAccount [GH-753](https://github.com/hashicorp/vault-helm/pull/753)
## 0.20.1 (May 25th, 2022)
CHANGES:
* `vault-k8s` updated to 0.16.1 [GH-739](https://github.com/hashicorp/vault-helm/pull/739)
Improvements:
* Mutating webhook will no longer target the agent injector pod [GH-736](https://github.com/hashicorp/vault-helm/pull/736)
Bugs:
* `vault` service account is now created even if the server is set to disabled, as per before 0.20.0 [GH-737](https://github.com/hashicorp/vault-helm/pull/737)
## 0.20.0 (May 16th, 2022)
CHANGES:
* `global.enabled` now works as documented, that is, setting `global.enabled` to false will disable everything, with individual components able to be turned on individually [GH-703](https://github.com/hashicorp/vault-helm/pull/703)
* Default value of `-` used for injector and server to indicate that they follow `global.enabled`. [GH-703](https://github.com/hashicorp/vault-helm/pull/703)
* Vault default image to 1.10.3
* CSI provider default image to 1.1.0
* Vault K8s default image to 0.16.0
* Earliest Kubernetes version tested is now 1.16
* Helm 3.6+ now required
Features:
* Support topologySpreadConstraints in server and injector. [GH-652](https://github.com/hashicorp/vault-helm/pull/652)
Improvements:
* CSI: Set `extraLabels` for daemonset, pods, and service account [GH-690](https://github.com/hashicorp/vault-helm/pull/690)
* Add namespace to injector-leader-elector role, rolebinding and secret [GH-683](https://github.com/hashicorp/vault-helm/pull/683)
* Support policy/v1 PodDisruptionBudget in Kubernetes 1.21+ for server and injector [GH-710](https://github.com/hashicorp/vault-helm/pull/710)
* Make the Cluster Address (CLUSTER_ADDR) configurable [GH-629](https://github.com/hashicorp/vault-helm/pull/709)
* server: Make `publishNotReadyAddresses` configurable for services [GH-694](https://github.com/hashicorp/vault-helm/pull/694)
* server: Allow config to be defined as a YAML object in the values file [GH-684](https://github.com/hashicorp/vault-helm/pull/684)
* Maintain default MutatingWebhookConfiguration values from `v1beta1` [GH-692](https://github.com/hashicorp/vault-helm/pull/692)
## 0.19.0 (January 20th, 2022)
CHANGES:
* Vault image default 1.9.2
* Vault K8s image default 0.14.2
Features:
* Added configurable podDisruptionBudget for injector [GH-653](https://github.com/hashicorp/vault-helm/pull/653)
* Make terminationGracePeriodSeconds configurable for server [GH-659](https://github.com/hashicorp/vault-helm/pull/659)
* Added configurable update strategy for injector [GH-661](https://github.com/hashicorp/vault-helm/pull/661)
* csi: ability to set priorityClassName for CSI daemonset pods [GH-670](https://github.com/hashicorp/vault-helm/pull/670)
Improvements:
* Set the namespace on the OpenShift Route [GH-679](https://github.com/hashicorp/vault-helm/pull/679)
* Add volumes and env vars to helm hook test pod [GH-673](https://github.com/hashicorp/vault-helm/pull/673)
* Make TLS configurable for OpenShift routes [GH-686](https://github.com/hashicorp/vault-helm/pull/686)
## 0.18.0 (November 17th, 2021)
CHANGES:
* Removed support for deploying a leader-elector container with the [vault-k8s injector](https://github.com/hashicorp/vault-k8s) injector since vault-k8s now uses an internal mechanism to determine leadership [GH-649](https://github.com/hashicorp/vault-helm/pull/649)
* Vault image default 1.9.0
* Vault K8s image default 0.14.1
Improvements:
* Added templateConfig.staticSecretRenderInterval chart option for the injector [GH-621](https://github.com/hashicorp/vault-helm/pull/621)
## 0.17.1 (October 25th, 2021)
Improvements:
* Add option for Ingress PathType [GH-634](https://github.com/hashicorp/vault-helm/pull/634)
## 0.17.0 (October 21st, 2021)
KNOWN ISSUES:
* The chart will fail to deploy on Kubernetes 1.19+ with `server.ingress.enabled=true` because no `pathType` is set
CHANGES:
* Vault image default 1.8.4
* Vault K8s image default 0.14.0
Improvements:
* Support Ingress stable networking API [GH-590](https://github.com/hashicorp/vault-helm/pull/590)
* Support setting the `externalTrafficPolicy` for `LoadBalancer` and `NodePort` service types [GH-626](https://github.com/hashicorp/vault-helm/pull/626)
* Support setting ingressClassName on server Ingress [GH-630](https://github.com/hashicorp/vault-helm/pull/630)
Bugs:
* Ensure `kubeletRootDir` volume path and mounts are the same when `csi.daemonSet.kubeletRootDir` is overridden [GH-628](https://github.com/hashicorp/vault-helm/pull/628)
## 0.16.1 (September 29th, 2021)
CHANGES:
* Vault image default 1.8.3
* Vault K8s image default 0.13.1
## 0.16.0 (September 16th, 2021)
CHANGES:
* Support for deploying a leader-elector container with the [vault-k8s injector](https://github.com/hashicorp/vault-k8s) injector will be removed in version 0.18.0 of this chart since vault-k8s now uses an internal mechanism to determine leadership. To enable the deployment of the leader-elector container for use with vault-k8s 0.12.0 and earlier, set `useContainer=true`.
Improvements:
* Make CSI provider `hostPaths` configurable via `csi.daemonSet.providersDir` and `csi.daemonSet.kubeletRootDir` [GH-603](https://github.com/hashicorp/vault-helm/pull/603)
* Support vault-k8s internal leader election [GH-568](https://github.com/hashicorp/vault-helm/pull/568) [GH-607](https://github.com/hashicorp/vault-helm/pull/607)
## 0.15.0 (August 23rd, 2021)
Improvements:
* Add imagePullSecrets on server test [GH-572](https://github.com/hashicorp/vault-helm/pull/572)
* Add injector.webhookAnnotations chart option [GH-584](https://github.com/hashicorp/vault-helm/pull/584)
## 0.14.0 (July 28th, 2021)
Features:
* Added templateConfig.exitOnRetryFailure chart option for the injector [GH-560](https://github.com/hashicorp/vault-helm/pull/560)
Improvements:
* Support configuring pod tolerations, pod affinity, and node selectors as YAML [GH-565](https://github.com/hashicorp/vault-helm/pull/565)
* Set the default vault image to come from the hashicorp organization [GH-567](https://github.com/hashicorp/vault-helm/pull/567)
* Add support for running the acceptance tests against a local `kind` cluster [GH-567](https://github.com/hashicorp/vault-helm/pull/567)
* Add `server.ingress.activeService` to configure if the ingress should use the active service [GH-570](https://github.com/hashicorp/vault-helm/pull/570)
* Add `server.route.activeService` to configure if the route should use the active service [GH-570](https://github.com/hashicorp/vault-helm/pull/570)
* Support configuring `global.imagePullSecrets` from a string array [GH-576](https://github.com/hashicorp/vault-helm/pull/576)
## 0.13.0 (June 17th, 2021)
Improvements:
* Added a helm test for vault server [GH-531](https://github.com/hashicorp/vault-helm/pull/531)
* Added server.enterpriseLicense option [GH-547](https://github.com/hashicorp/vault-helm/pull/547)
* Added OpenShift overrides [GH-549](https://github.com/hashicorp/vault-helm/pull/549)
Bugs:
* Fix ui.serviceNodePort schema [GH-537](https://github.com/hashicorp/vault-helm/pull/537)
* Fix server.ha.disruptionBudget.maxUnavailable schema [GH-535](https://github.com/hashicorp/vault-helm/pull/535)
* Added webhook-certs volume mount to sidecar injector [GH-545](https://github.com/hashicorp/vault-helm/pull/545)
## 0.12.0 (May 25th, 2021)
Features:
* Pass additional arguments to `vault-csi-provider` using `csi.extraArgs` [GH-526](https://github.com/hashicorp/vault-helm/pull/526)
Improvements:
* Set chart kubeVersion and added chart-verifier tests [GH-510](https://github.com/hashicorp/vault-helm/pull/510)
* Added values json schema [GH-513](https://github.com/hashicorp/vault-helm/pull/513)
* Ability to set tolerations for CSI daemonset pods [GH-521](https://github.com/hashicorp/vault-helm/pull/521)
* UI target port is now configurable [GH-437](https://github.com/hashicorp/vault-helm/pull/437)
Bugs:
* CSI: `global.imagePullSecrets` are now also used for CSI daemonset [GH-519](https://github.com/hashicorp/vault-helm/pull/519)
## 0.11.0 (April 14th, 2021)
Features:
* Added `server.enabled` to explicitly skip installing a Vault server [GH-486](https://github.com/hashicorp/vault-helm/pull/486)
* Injector now supports enabling host network [GH-471](https://github.com/hashicorp/vault-helm/pull/471)
* Injector port is now configurable [GH-489](https://github.com/hashicorp/vault-helm/pull/489)
* Injector Vault Agent resource defaults are now configurable [GH-493](https://github.com/hashicorp/vault-helm/pull/493)
* Extra paths can now be added to the Vault ingress service [GH-460](https://github.com/hashicorp/vault-helm/pull/460)
* Log level and format can now be set directly using `server.logFormat` and `server.logLevel` [GH-488](https://github.com/hashicorp/vault-helm/pull/488)
Improvements:
* Added `https` name to injector service port [GH-495](https://github.com/hashicorp/vault-helm/pull/495)
Bugs:
* CSI: Fix ClusterRole name and DaemonSet's service account to properly match deployment name [GH-486](https://github.com/hashicorp/vault-helm/pull/486)
## 0.10.0 (March 25th, 2021)
Features:
* Add support for [Vault CSI provider](https://github.com/hashicorp/vault-csi-provider) [GH-461](https://github.com/hashicorp/vault-helm/pull/461)
Improvements:
* `objectSelector` can now be set on the mutating admission webhook [GH-456](https://github.com/hashicorp/vault-helm/pull/456)
## 0.9.1 (February 2nd, 2021)
Bugs:
* Injector: fix labels for default anti-affinity rule [GH-441](https://github.com/hashicorp/vault-helm/pull/441), [GH-442](https://github.com/hashicorp/vault-helm/pull/442)
* Set VAULT_DEV_LISTEN_ADDRESS in dev mode [GH-446](https://github.com/hashicorp/vault-helm/pull/446)
## 0.9.0 (January 5th, 2021)
Features:
* Injector now supports configurable number of replicas [GH-436](https://github.com/hashicorp/vault-helm/pull/436)
* Injector now supports auto TLS for multiple replicas using leader elections [GH-436](https://github.com/hashicorp/vault-helm/pull/436)
Improvements:
* Dev mode now supports `server.extraArgs` [GH-421](https://github.com/hashicorp/vault-helm/pull/421)
* Dev mode root token is now configurable with `server.dev.devRootToken` [GH-415](https://github.com/hashicorp/vault-helm/pull/415)
* ClusterRoleBinding updated to `v1` [GH-395](https://github.com/hashicorp/vault-helm/pull/395)
* MutatingWebhook updated to `v1` [GH-408](https://github.com/hashicorp/vault-helm/pull/408)
* Injector service now supports `injector.service.annotations` [425](https://github.com/hashicorp/vault-helm/pull/425)
* Injector now supports `injector.extraLabels` [428](https://github.com/hashicorp/vault-helm/pull/428)
* Added `allowPrivilegeEscalation: false` to Vault and Injector containers [429](https://github.com/hashicorp/vault-helm/pull/429)
* Network Policy now supports `server.networkPolicy.egress` [389](https://github.com/hashicorp/vault-helm/pull/389)
## 0.8.0 (October 20th, 2020)
Improvements:
* Make server NetworkPolicy independent of OpenShift [GH-381](https://github.com/hashicorp/vault-helm/pull/381)
* Added configurables for all probe values [GH-387](https://github.com/hashicorp/vault-helm/pull/387)
* MountPath for audit and data storage is now configurable [GH-393](https://github.com/hashicorp/vault-helm/pull/393)
* Annotations can now be added to the Injector pods [GH-394](https://github.com/hashicorp/vault-helm/pull/394)
* The injector can now be configured with a failurePolicy [GH-400](https://github.com/hashicorp/vault-helm/pull/400)
* Added additional environment variables for rendering within Vault config [GH-398](https://github.com/hashicorp/vault-helm/pull/398)
* Service account for Vault K8s auth is automatically created when `injector.externalVaultAddr` is set [GH-392](https://github.com/hashicorp/vault-helm/pull/392)
Bugs:
* Fixed install output using Helm V2 command [GH-378](https://github.com/hashicorp/vault-helm/pull/378)
## 0.7.0 (August 24th, 2020)
Features:
* Added `volumes` and `volumeMounts` for mounting _any_ type of volume [GH-314](https://github.com/hashicorp/vault-helm/pull/314).
* Added configurable to enable prometheus telemetery exporter for Vault Agent Injector [GH-372](https://github.com/hashicorp/vault-helm/pull/372)
Improvements:
* Added `defaultMode` configurable to `extraVolumes`[GH-321](https://github.com/hashicorp/vault-helm/pull/321)
* Option to install and use PodSecurityPolicy's for vault server and injector [GH-177](https://github.com/hashicorp/vault-helm/pull/177)
* `VAULT_API_ADDR` is now configurable [GH-290](https://github.com/hashicorp/vault-helm/pull/290)
* Removed deprecated tolerate unready endpoint annotations [GH-363](https://github.com/hashicorp/vault-helm/pull/363)
* Add an option to set annotations on the StatefulSet [GH-199](https://github.com/hashicorp/vault-helm/pull/199)
* Make the vault server serviceAccount name a configuration option [GH-367](https://github.com/hashicorp/vault-helm/pull/367)
* Removed annotation striction from `dev` mode [GH-371](https://github.com/hashicorp/vault-helm/pull/371)
* Add an option to set annotations on PVCs [GH-364](https://github.com/hashicorp/vault-helm/pull/364)
* Added service configurables for UI [GH-285](https://github.com/hashicorp/vault-helm/pull/285)
Bugs:
* Fix python dependency in test image [GH-337](https://github.com/hashicorp/vault-helm/pull/337)
* Fix caBundle not being quoted causing validation issues with Helm 3 [GH-352](https://github.com/hashicorp/vault-helm/pull/352)
* Fix injector network policy being rendered when injector is not enabled [GH-358](https://github.com/hashicorp/vault-helm/pull/358)
## 0.6.0 (June 3rd, 2020)
Features:
* Added `extraInitContainers` to define init containers for the Vault cluster [GH-258](https://github.com/hashicorp/vault-helm/pull/258)
* Added `postStart` lifecycle hook allowing users to configure commands to run on the Vault pods after they're ready [GH-315](https://github.com/hashicorp/vault-helm/pull/315)
* Beta: Added OpenShift support [GH-319](https://github.com/hashicorp/vault-helm/pull/319)
Improvements:
* Server configs can now be defined in YAML. Multi-line string configs are still compatible [GH-213](https://github.com/hashicorp/vault-helm/pull/213)
* Removed IPC_LOCK privileges since swap is disabled on containers [[GH-198](https://github.com/hashicorp/vault-helm/pull/198)]
* Use port names that map to vault.scheme [[GH-223](https://github.com/hashicorp/vault-helm/pull/223)]
* Allow both yaml and multi-line string annotations [[GH-272](https://github.com/hashicorp/vault-helm/pull/272)]
* Added configurable to set the Raft node name to hostname [[GH-269](https://github.com/hashicorp/vault-helm/pull/269)]
* Support setting priorityClassName on pods [[GH-282](https://github.com/hashicorp/vault-helm/pull/282)]
* Added support for ingress apiVersion `networking.k8s.io/v1beta1` [[GH-310](https://github.com/hashicorp/vault-helm/pull/310)]
* Added configurable to change service type for the HA active service [GH-317](https://github.com/hashicorp/vault-helm/pull/317)
Bugs:
* Fixed default ingress path [[GH-224](https://github.com/hashicorp/vault-helm/pull/224)]
* Fixed annotations for HA standby/active services [[GH-268](https://github.com/hashicorp/vault-helm/pull/268)]
* Updated some value defaults to match their use in templates [[GH-309](https://github.com/hashicorp/vault-helm/pull/309)]
* Use active service on ingress when ha [[GH-270](https://github.com/hashicorp/vault-helm/pull/270)]
* Fixed bug where pull secrets weren't being used for injector image [GH-298](https://github.com/hashicorp/vault-helm/pull/298)
## 0.5.0 (April 9th, 2020)
Features:
* Added Raft support for HA mode [[GH-228](https://github.com/hashicorp/vault-helm/pull/229)]
* Now supports Vault Enterprise [[GH-250](https://github.com/hashicorp/vault-helm/pull/250)]
* Added K8s Service Registration for HA modes [[GH-250](https://github.com/hashicorp/vault-helm/pull/250)]
* Option to set `AGENT_INJECT_VAULT_AUTH_PATH` for the injector [[GH-185](https://github.com/hashicorp/vault-helm/pull/185)]
* Added environment variables for logging and revocation on Vault Agent Injector [[GH-219](https://github.com/hashicorp/vault-helm/pull/219)]
* Option to set environment variables for the injector deployment [[GH-232](https://github.com/hashicorp/vault-helm/pull/232)]
* Added affinity, tolerations, and nodeSelector options for the injector deployment [[GH-234](https://github.com/hashicorp/vault-helm/pull/234)]
* Made all annotations multi-line strings [[GH-227](https://github.com/hashicorp/vault-helm/pull/227)]
## 0.4.0 (February 21st, 2020)
Improvements:
* Allow process namespace sharing between Vault and sidecar containers [[GH-174](https://github.com/hashicorp/vault-helm/pull/174)]
* Added configurable to change updateStrategy [[GH-172](https://github.com/hashicorp/vault-helm/pull/172)]
* Added sleep in the preStop lifecycle step [[GH-188](https://github.com/hashicorp/vault-helm/pull/188)]
* Updated chart and tests to Helm 3 [[GH-195](https://github.com/hashicorp/vault-helm/pull/195)]
* Adds Values.injector.externalVaultAddr to use the injector with an external vault [[GH-207](https://github.com/hashicorp/vault-helm/pull/207)]
Bugs:
* Fix bug where Vault lifecycle was appended after extra containers. [[GH-179](https://github.com/hashicorp/vault-helm/pull/179)]
## 0.3.3 (January 14th, 2020)
Security:
* Added `server.extraArgs` to allow loading of additional Vault configurations containing sensitive settings [GH-175](https://github.com/hashicorp/vault-helm/issues/175)
Bugs:
* Fixed injection bug where wrong environment variables were being used for manually mounted TLS files
## 0.3.2 (January 8th, 2020)
Bugs:
* Fixed injection bug where TLS Skip Verify was true by default [VK8S-35]
## 0.3.1 (January 2nd, 2020)
Bugs:
* Fixed injection bug causing kube-system pods to be rejected [VK8S-14]
## 0.3.0 (December 19th, 2019)
Features:
* Extra containers can now be added to the Vault pods
* Added configurability of pod probes
* Added Vault Agent Injector
Improvements:
* Moved `global.image` to `server.image`
* Changed UI service template to route pods that aren't ready via `publishNotReadyAddresses: true`
* Added better HTTP/HTTPS scheme support to http probes
* Added configurable node port for Vault service
* `server.authDelegator` is now enabled by default
Bugs:
* Fixed upgrade bug by removing chart label which contained the version
* Fixed typo on `serviceAccount` (was `serviceaccount`)
* Fixed readiness/liveliness HTTP probe default to accept standbys
## 0.2.1 (November 12th, 2019)
Bugs:
* Removed `readOnlyRootFilesystem` causing issues when validating deployments
## 0.2.0 (October 29th, 2019)
Features:
* Added load balancer support
* Added ingress support
* Added configurable for service types (ClusterIP, NodePort, LoadBalancer, etc)
* Removed root requirements, now runs as Vault user
Improvements:
* Added namespace value to all rendered objects
* Made ports configurable in services
* Added the ability to add custom annotations to services
* Added docker image for running bats test in CircleCI
* Removed restrictions around `dev` mode such as annotations
* `readOnlyRootFilesystem` is now configurable
* Image Pull Policy is now configurable
Bugs:
* Fixed selector bugs related to Helm label updates (services, affinities, and pod disruption)
* Fixed bug where audit storage was not being mounted in HA mode
* Fixed bug where Vault pod wasn't receiving SIGTERM signals
## 0.1.2 (August 22nd, 2019)
Features:
* Added `extraSecretEnvironmentVars` to allow users to mount secrets as
environment variables
* Added `tlsDisable` configurable to change HTTP protocols from HTTP/HTTPS
depending on the value
* Added `serviceNodePort` to configure a NodePort value when setting `serviceType`
to "NodePort"
Improvements:
* Changed UI port to 8200 for better HTTP protocol support
* Added `path` to `extraVolumes` to define where the volume should be
mounted. Defaults to `/vault/userconfig`
* Upgraded Vault to 1.2.2
Bugs:
* Fixed bug where upgrade would fail because immutable labels were being
changed (Helm Version label)
* Fixed bug where UI service used wrong selector after updating helm labels
* Added `VAULT_API_ADDR` env to Vault pod to fixed bug where Vault thinks
Consul is the active node
* Removed `step-down` preStop since it requires authentication. Shutdown signal
sent by Kube acts similar to `step-down`
## 0.1.1 (August 7th, 2019)
Features:
* Added `authDelegator` Cluster Role Binding to Vault service account for
bootstrapping Kube auth method
Improvements:
* Added `server.service.clusterIP` to `values.yml` so users can toggle
the Vault service to headless by using the value `None`.
* Upgraded Vault to 1.2.1
## 0.1.0 (August 6th, 2019)
Initial release

248
CONTRIBUTING.md Normal file
View file

@ -0,0 +1,248 @@
# Contributing to OpenBao Helm
**Please note:** We take OpenBao's security and our users' trust very seriously.
If you believe you have found a security issue in OpenBao, please responsibly
disclose by contacting us at openbao-security@lists.lfedge.org.
**First:** if you're unsure or afraid of _anything_, just ask or submit the
issue or pull request anyways. You won't be yelled at for giving it your best
effort. The worst that can happen is that you'll be politely asked to change
something. We appreciate any sort of contributions, and don't want a wall of
rules to get in the way of that.
That said, if you want to ensure that a pull request is likely to be merged,
talk to us! You can find out our thoughts and ensure that your contribution
won't clash or be obviated by OpenBao's normal direction. A great way to do this
is via the [Linux Foundation Element chat server][1], or [mailing list][2].
This document will cover what we're looking for in terms of reporting issues.
By addressing all the points we're looking for, it raises the chances we can
quickly merge or address your contributions.
[1]: https://chat.lfx.linuxfoundation.org
[2]: https://lists.lfedge.org/g/openbao
## Issues
### Reporting an Issue
* Make sure you test against the latest released version. It is possible
we already fixed the bug you're experiencing. Even better is if you can test
against `main`, as bugs are fixed regularly but new versions are only
released every few months.
* Provide steps to reproduce the issue, and if possible include the expected
results as well as the actual results. Please provide text, not screen shots!
* Respond as promptly as possible to any questions made by the OpenBao
team to your issue. Stale issues will be closed periodically.
### Issue Lifecycle
1. The issue is reported.
2. The issue is verified and categorized by a OpenBao Helm collaborator.
Categorization is done via tags. For example, bugs are marked as "bugs".
3. Unless it is critical, the issue may be left for a period of time (sometimes
many weeks), giving outside contributors -- maybe you!? -- a chance to
address the issue.
4. The issue is addressed in a pull request or commit. The issue will be
referenced in the commit message so that the code that fixes it is clearly
linked.
5. The issue is closed. Sometimes, valid issues will be closed to keep
the issue tracker clean. The issue is still indexed and available for
future viewers, or can be re-opened if necessary.
## Testing
The Helm chart ships with both unit and acceptance tests.
The unit tests don't require any active Kubernetes cluster and complete
very quickly. These should be used for fast feedback during development.
The acceptance tests require a Kubernetes cluster with a configured `kubectl`.
### Test Using Docker Container
The following are the instructions for running bats tests using a Docker container.
#### Prerequisites
* Docker installed
* `openbao-helm` checked out locally
#### Test
**Note:** the following commands should be run from the `openbao-helm` directory.
First, build the Docker image for running the tests:
```shell
docker build -f ${PWD}/test/docker/Test.dockerfile ${PWD}/test/docker/ -t openbao-helm-test
```
Next, execute the tests with the following commands:
```shell
docker run -it --rm -v "${PWD}:/test" openbao-helm-test bats /test/test/unit
```
It's possible to only run specific bats tests using regular expressions.
For example, the following will run only tests with "injector" in the name:
```shell
docker run -it --rm -v "${PWD}:/test" openbao-helm-test bats /test/test/unit -f "injector"
```
### Test Manually
The following are the instructions for running bats tests on your workstation.
#### Prerequisites
* [Bats](https://github.com/bats-core/bats-core)
```bash
brew install bats-core
```
* [yq](https://pypi.org/project/yq/)
```bash
brew install python-yq
```
* [helm](https://helm.sh)
```bash
brew install kubernetes-helm
```
#### Test
To run the unit tests:
bats ./test/unit
To run the acceptance tests:
bats ./test/acceptance
If the acceptance tests fail, deployed resources in the Kubernetes cluster
may not be properly cleaned up. We recommend recycling the Kubernetes cluster to
start from a clean slate.
**Note:** There is a Terraform configuration in the
[`test/terraform/`](https://github.com/openbao/openbao-helm/tree/main/test/terraform) directory
that can be used to quickly bring up a GKE cluster and configure
`kubectl` and `helm` locally. This can be used to quickly spin up a test
cluster for acceptance tests. Unit tests _do not_ require a running Kubernetes
cluster.
### Writing Unit Tests
Changes to the Helm chart should be accompanied by appropriate unit tests.
#### Formatting
- Put tests in the test file in the same order as the variables appear in the `values.yaml`.
- Start tests for a chart value with a header that says what is being tested, like this:
```
#--------------------------------------------------------------------
# annotations
```
- Name the test based on what it's testing in the following format (this will be its first line):
```
@test "<section being tested>: <short description of the test case>" {
```
When adding tests to an existing file, the first section will be the same as the other tests in the file.
#### Test Details
[Bats](https://github.com/bats-core/bats-core) provides a way to run commands in a shell and inspect the output in an automated way.
In all of the tests in this repo, the base command being run is [helm template](https://docs.helm.sh/helm/#helm-template) which turns the templated files into straight yaml output.
In this way, we're able to test that the various conditionals in the templates render as we would expect.
Each test defines the files that should be rendered using the `--show-only` flag, then it might adjust chart values by adding `--set` flags as well.
The output from this `helm template` command is then piped to [yq](https://pypi.org/project/yq/).
`yq` allows us to pull out just the information we're interested in, either by referencing its position in the yaml file directly or giving information about it (like its length).
The `-r` flag can be used with `yq` to return a raw string instead of a quoted one which is especially useful when looking for an exact match.
The test passes or fails based on the conditional at the end that is in square brackets, which is a comparison of our expected value and the output of `helm template` piped to `yq`.
The `| tee /dev/stderr ` pieces direct any terminal output of the `helm template` and `yq` commands to stderr so that it doesn't interfere with `bats`.
#### Test Examples
Here are some examples of common test patterns:
- Check that a value is disabled by default
```
@test "ui/Service: no type by default" {
cd `chart_dir`
local actual=$(helm template \
--show-only templates/ui-service.yaml \
. | tee /dev/stderr |
yq -r '.spec.type' | tee /dev/stderr)
[ "${actual}" = "null" ]
}
```
In this example, nothing is changed from the default templates (no `--set` flags), then we use `yq` to retrieve the value we're checking, `.spec.type`.
This output is then compared against our expected value (`null` in this case) in the assertion `[ "${actual}" = "null" ]`.
- Check that a template value is rendered to a specific value
```
@test "ui/Service: specified type" {
cd `chart_dir`
local actual=$(helm template \
--show-only templates/ui-service.yaml \
--set 'ui.serviceType=LoadBalancer' \
. | tee /dev/stderr |
yq -r '.spec.type' | tee /dev/stderr)
[ "${actual}" = "LoadBalancer" ]
}
```
This is very similar to the last example, except we've changed a default value with the `--set` flag and correspondingly changed the expected value.
- Check that a template value contains several values
```
@test "server/standalone-StatefulSet: custom resources" {
cd `chart_dir`
local actual=$(helm template \
--show-only templates/server-statefulset.yaml \
--set 'server.standalone.enabled=true' \
--set 'server.resources.requests.memory=256Mi' \
--set 'server.resources.requests.cpu=250m' \
. | tee /dev/stderr |
yq -r '.spec.template.spec.containers[0].resources.requests.memory' | tee /dev/stderr)
[ "${actual}" = "256Mi" ]
local actual=$(helm template \
--show-only templates/server-statefulset.yaml \
--set 'server.standalone.enabled=true' \
--set 'server.resources.limits.memory=256Mi' \
--set 'server.resources.limits.cpu=250m' \
. | tee /dev/stderr |
yq -r '.spec.template.spec.containers[0].resources.limits.memory' | tee /dev/stderr)
[ "${actual}" = "256Mi" ]
```
*Note:* If testing more than two conditions, it would be good to separate the `helm template` part of the command from the `yq` sections to reduce redundant work.
- Check that an entire template file is not rendered
```
@test "syncCatalog/Deployment: disabled by default" {
cd `chart_dir`
local actual=$( (helm template \
--show-only templates/server-statefulset.yaml \
--set 'global.enabled=false' \
. || echo "---") | tee /dev/stderr |
yq 'length > 0' | tee /dev/stderr)
[ "${actual}" = "false" ]
}
```
Here we are check the length of the command output to see if the anything is rendered.
This style can easily be switched to check that a file is rendered instead.
## Contributor License Agreement
We require that all contributors sign our Contributor License Agreement ("CLA")
before we can accept the contribution.
[Learn more about why HashiCorp requires a CLA and what the CLA includes](https://www.hashicorp.com/cla)

View file

@ -1,8 +0,0 @@
apiVersion: v1
name: vault
version: 0.1.0
description: Install and configure Vault on Kubernetes.
home: https://www.vaultproject.io
sources:
- https://github.com/hashicorp/vault
- https://github.com/hashicorp/vault-helm

View file

@ -1,3 +1,5 @@
Copyright (c) 2018 HashiCorp, Inc.
Mozilla Public License, version 2.0
1. Definitions

102
Makefile
View file

@ -1,6 +1,100 @@
TEST_IMAGE?=consul-helm-test
TEST_IMAGE?=openbao-helm-test
GOOGLE_CREDENTIALS?=openbao-helm-test.json
CLOUDSDK_CORE_PROJECT?=openbao-helm-dev-246514
# set to run a single test - e.g acceptance/server-ha-enterprise-dr.bats
ACCEPTANCE_TESTS?=acceptance
test-docker:
@docker build --rm -t '$(TEST_IMAGE)' -f $(CURDIR)/test/docker/Test.dockerfile $(CURDIR)
# filter bats unit tests to run.
UNIT_TESTS_FILTER?='.*'
.PHONY: test-docker
# set to 'true' to run acceptance tests locally in a kind cluster
LOCAL_ACCEPTANCE_TESTS?=false
# kind cluster name
KIND_CLUSTER_NAME?=openbao-helm
# kind k8s version
KIND_K8S_VERSION?=v1.29.2
# Generate json schema for chart values. See test/README.md for more details.
values-schema:
helm schema-gen values.yaml > values.schema.json
test-image:
@docker build --rm -t $(TEST_IMAGE) -f $(CURDIR)/test/docker/Test.dockerfile $(CURDIR)
test-unit:
@docker run --rm -it -v ${PWD}:/helm-test $(TEST_IMAGE) bats -f $(UNIT_TESTS_FILTER) /helm-test/test/unit
test-bats: test-unit test-acceptance
test: test-image test-bats
# run acceptance tests on GKE
# set google project/credential vars above
test-acceptance:
ifeq ($(LOCAL_ACCEPTANCE_TESTS),true)
make setup-kind acceptance
else
@docker run -it -v ${PWD}:/helm-test \
-e GOOGLE_CREDENTIALS=${GOOGLE_CREDENTIALS} \
-e CLOUDSDK_CORE_PROJECT=${CLOUDSDK_CORE_PROJECT} \
-e KUBECONFIG=/helm-test/.kube/config \
-w /helm-test \
$(TEST_IMAGE) \
make acceptance
endif
# destroy GKE cluster using terraform
test-destroy:
@docker run -it -v ${PWD}:/helm-test \
-e GOOGLE_CREDENTIALS=${GOOGLE_CREDENTIALS} \
-e CLOUDSDK_CORE_PROJECT=${CLOUDSDK_CORE_PROJECT} \
-w /helm-test \
$(TEST_IMAGE) \
make destroy-cluster
# provision GKE cluster using terraform
test-provision:
@docker run -it -v ${PWD}:/helm-test \
-e GOOGLE_CREDENTIALS=${GOOGLE_CREDENTIALS} \
-e CLOUDSDK_CORE_PROJECT=${CLOUDSDK_CORE_PROJECT} \
-e KUBECONFIG=/helm-test/.kube/config \
-w /helm-test \
$(TEST_IMAGE) \
make provision-cluster
# this target is for running the acceptance tests
# it is run in the docker container above when the test-acceptance target is invoked
acceptance:
ifneq ($(LOCAL_ACCEPTANCE_TESTS),true)
gcloud auth activate-service-account --key-file=${GOOGLE_CREDENTIALS}
endif
bats --tap --timing test/${ACCEPTANCE_TESTS}
# this target is for provisioning the GKE cluster
# it is run in the docker container above when the test-provision target is invoked
provision-cluster:
gcloud auth activate-service-account --key-file=${GOOGLE_CREDENTIALS}
terraform init test/terraform
terraform apply -var project=${CLOUDSDK_CORE_PROJECT} -var init_cli=true -auto-approve test/terraform
# this target is for removing the GKE cluster
# it is run in the docker container above when the test-destroy target is invoked
destroy-cluster:
terraform destroy -auto-approve
# create a kind cluster for running the acceptance tests locally
setup-kind:
kind get clusters | grep -q "^${KIND_CLUSTER_NAME}$$" || \
kind create cluster \
--image kindest/node:${KIND_K8S_VERSION} \
--name ${KIND_CLUSTER_NAME} \
--config $(CURDIR)/test/kind/config.yaml
kubectl config use-context kind-${KIND_CLUSTER_NAME}
# delete the kind cluster
delete-kind:
kind delete cluster --name ${KIND_CLUSTER_NAME} || :
.PHONY: values-schema test-image test-unit test-bats test test-acceptance test-destroy test-provision acceptance provision-cluster destroy-cluster

View file

@ -1,72 +1,34 @@
# Vault Helm Chart
# OpenBao Helm Chart
------
## WIP - forked from vault-Helm and under heavy development
------
> :warning: **Please note**: We take OpenBao's security and our users' trust very seriously. If
you believe you have found a security issue in OpenBao Helm, _please responsibly disclose_
by contacting us at [openbao-security@lists.lfedge.org](mailto:openbao-security@lists.lfedge.org).
This repository contains the official HashiCorp Helm chart for installing
and configuring Vault on Kubernetes. This chart supports multiple use
cases of Vault on Kubernetes depending on the values provided.
For full documentation on this Helm chart along with all the ways you can
use Vault with Kubernetes, please see the
[Vault and Kubernetes documentation](https://www.vault.io/docs/platform/k8s/index.html).
This repository contains the OpenBao Helm chart for installing
and configuring OpenBao on Kubernetes. This chart supports multiple use
cases of OpenBao on Kubernetes depending on the values provided.
## Prerequisites
To use the charts here, [Helm](https://helm.sh/) must be installed in your
Kubernetes cluster. Setting up Kubernetes and Helm and is outside the scope
of this README. Please refer to the Kubernetes and Helm documentation.
To use the charts here, [Helm](https://helm.sh/) must be configured for your
Kubernetes cluster. Setting up Kubernetes and Helm is outside the scope of
this README. Please refer to the Kubernetes and Helm documentation.
The versions required are:
* **Helm 2.10+** - This is the earliest version of Helm tested. It is possible
it works with earlier versions but this chart is untested for those versions.
* **Kubernetes 1.9+** - This is the earliest version of Kubernetes tested.
* **Helm 3.12+** - Earliest verison tested
* **Kubernetes 1.28+** - This is the earliest version of Kubernetes tested.
It is possible that this chart works with earlier versions but it is
untested. Other versions verified are Kubernetes 1.10, 1.11.
untested.
## Usage
For now, we do not host a chart repository. To use the charts, you must
download this repository and unpack it into a directory. Either
[download a tagged release](https://github.com/hashicorp/vault-helm/releases) or
use `git checkout` to a tagged release.
Assuming this repository was unpacked into the directory `vault-helm`, the chart can
then be installed directly:
To install the latest version of this chart, add the OpenBao helm repository and run `helm install`:
helm install ./vault-helm
```console
helm repo add openbao https://openbao.github.io/openbao-helm
Please see the many options supported in the `values.yaml`
file. These are also fully documented directly on the
[Vault website](https://www.vault.io/docs/platform/k8s/helm.html).
helm install openbao openbao/openbao
```
## Testing
The Helm chart ships with both unit and acceptance tests.
The unit tests don't require any active Kubernetes cluster and complete
very quickly. These should be used for fast feedback during development.
The acceptance tests require a Kubernetes cluster with a configured `kubectl`.
Both require [Bats](https://github.com/bats-core/bats-core) and `helm` to be
installed and available on the CLI. The unit tests also require the correct
version of [yq](https://pypi.org/project/yq/) if running locally.
To run the unit tests:
bats ./test/unit
To run the acceptance tests:
bats ./test/acceptance
If the acceptance tests fail, deployed resources in the Kubernetes cluster
may not be properly cleaned up. We recommend recycling the Kubernetes cluster to
start from a clean slate.
**Note:** There is a Terraform configuration in the
[test/terraform/ directory](https://github.com/hashicorp/vault-helm/tree/master/test/terraform)
that can be used to quickly bring up a GKE cluster and configure
`kubectl` and `helm` locally. This can be used to quickly spin up a test
cluster for acceptance tests. Unit tests _do not_ require a running Kubernetes
cluster.
Please see the many options supported in the [`values.yaml`](./charts/openbao/values.yaml) file. These are also fully documented directly in the [openbao README](./charts/openbao/README.md) along with more detailed installation instructions.

View file

@ -0,0 +1,28 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.terraform/
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
# CI and test
.circleci/
.github/
.gitlab-ci.yml
test/

31
charts/openbao/Chart.yaml Normal file
View file

@ -0,0 +1,31 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
apiVersion: v2
name: openbao
version: 0.6.0
appVersion: v2.0.2
kubeVersion: ">= 1.27.0-0"
description: Official OpenBao Chart
home: https://github.com/openbao/openbao-helm
icon: https://github.com/openbao/artwork/blob/main/color/openbao-color.svg
keywords:
[
"vault",
"openbao",
"security",
"encryption",
"secrets",
"management",
"automation",
"infrastructure",
]
sources:
- https://github.com/openbao/openbao-helm
annotations:
charts.openshift.io/name: Openbao
maintainers:
- name: OpenBao
email: openbao-security@lists.lfedge.org
url: https://openbao.org

294
charts/openbao/README.md Normal file
View file

@ -0,0 +1,294 @@
# openbao
![Version: 0.6.0](https://img.shields.io/badge/Version-0.6.0-informational?style=flat-square) ![AppVersion: v2.0.2](https://img.shields.io/badge/AppVersion-v2.0.2-informational?style=flat-square)
Official OpenBao Chart
**Homepage:** <https://github.com/openbao/openbao-helm>
## Maintainers
| Name | Email | Url |
| ---- | ------ | --- |
| OpenBao | <openbao-security@lists.lfedge.org> | <https://openbao.org> |
## Source Code
* <https://github.com/openbao/openbao-helm>
## Requirements
Kubernetes: `>= 1.27.0-0`
## Values
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| csi.agent.enabled | bool | `true` | |
| csi.agent.extraArgs | list | `[]` | |
| csi.agent.image.pullPolicy | string | `"IfNotPresent"` | image pull policy to use for agent image. if tag is "latest", set to "Always" |
| csi.agent.image.registry | string | `"quay.io"` | image registry to use for agent image |
| csi.agent.image.repository | string | `"openbao/openbao"` | image repo to use for agent image |
| csi.agent.image.tag | string | `"2.0.2"` | image tag to use for agent image |
| csi.agent.logFormat | string | `"standard"` | |
| csi.agent.logLevel | string | `"info"` | |
| csi.agent.resources | object | `{}` | |
| csi.daemonSet.annotations | object | `{}` | |
| csi.daemonSet.extraLabels | object | `{}` | |
| csi.daemonSet.kubeletRootDir | string | `"/var/lib/kubelet"` | |
| csi.daemonSet.providersDir | string | `"/etc/kubernetes/secrets-store-csi-providers"` | |
| csi.daemonSet.securityContext.container | object | `{}` | |
| csi.daemonSet.securityContext.pod | object | `{}` | |
| csi.daemonSet.updateStrategy.maxUnavailable | string | `""` | |
| csi.daemonSet.updateStrategy.type | string | `"RollingUpdate"` | |
| csi.debug | bool | `false` | |
| csi.enabled | bool | `false` | True if you want to install a secrets-store-csi-driver-provider-vault daemonset. Requires installing the secrets-store-csi-driver separately, see: https://github.com/kubernetes-sigs/secrets-store-csi-driver#install-the-secrets-store-csi-driver With the driver and provider installed, you can mount OpenBao secrets into volumes similar to the OpenBao Agent injector, and you can also sync those secrets into Kubernetes secrets. |
| csi.extraArgs | list | `[]` | |
| csi.hmacSecretName | string | `""` | |
| csi.image.pullPolicy | string | `"IfNotPresent"` | image pull policy to use for csi image. if tag is "latest", set to "Always" |
| csi.image.registry | string | `"docker.io"` | image registry to use for csi image |
| csi.image.repository | string | `"hashicorp/vault-csi-provider"` | image repo to use for csi image |
| csi.image.tag | string | `"1.4.0"` | image tag to use for csi image |
| csi.livenessProbe.failureThreshold | int | `2` | |
| csi.livenessProbe.initialDelaySeconds | int | `5` | |
| csi.livenessProbe.periodSeconds | int | `5` | |
| csi.livenessProbe.successThreshold | int | `1` | |
| csi.livenessProbe.timeoutSeconds | int | `3` | |
| csi.pod.affinity | object | `{}` | |
| csi.pod.annotations | object | `{}` | |
| csi.pod.extraLabels | object | `{}` | |
| csi.pod.nodeSelector | object | `{}` | |
| csi.pod.tolerations | list | `[]` | |
| csi.priorityClassName | string | `""` | |
| csi.readinessProbe.failureThreshold | int | `2` | |
| csi.readinessProbe.initialDelaySeconds | int | `5` | |
| csi.readinessProbe.periodSeconds | int | `5` | |
| csi.readinessProbe.successThreshold | int | `1` | |
| csi.readinessProbe.timeoutSeconds | int | `3` | |
| csi.resources | object | `{}` | |
| csi.serviceAccount.annotations | object | `{}` | |
| csi.serviceAccount.extraLabels | object | `{}` | |
| csi.volumeMounts | list | `[]` | volumeMounts is a list of volumeMounts for the main server container. These are rendered via toYaml rather than pre-processed like the extraVolumes value. The purpose is to make it easy to share volumes between containers. |
| csi.volumes | list | `[]` | volumes is a list of volumes made available to all containers. These are rendered via toYaml rather than pre-processed like the extraVolumes value. The purpose is to make it easy to share volumes between containers. |
| global.enabled | bool | `true` | enabled is the master enabled switch. Setting this to true or false will enable or disable all the components within this chart by default. |
| global.externalVaultAddr | string | `""` | External openbao server address for the injector and CSI provider to use. Setting this will disable deployment of a openbao server. |
| global.imagePullSecrets | list | `[]` | Image pull secret to use for registry authentication. Alternatively, the value may be specified as an array of strings. |
| global.namespace | string | `""` | The namespace to deploy to. Defaults to the `helm` installation namespace. |
| global.openshift | bool | `false` | If deploying to OpenShift |
| global.psp | object | `{"annotations":"seccomp.security.alpha.kubernetes.io/allowedProfileNames: docker/default,runtime/default\napparmor.security.beta.kubernetes.io/allowedProfileNames: runtime/default\nseccomp.security.alpha.kubernetes.io/defaultProfileName: runtime/default\napparmor.security.beta.kubernetes.io/defaultProfileName: runtime/default\n","enable":false}` | Create PodSecurityPolicy for pods |
| global.psp.annotations | string | `"seccomp.security.alpha.kubernetes.io/allowedProfileNames: docker/default,runtime/default\napparmor.security.beta.kubernetes.io/allowedProfileNames: runtime/default\nseccomp.security.alpha.kubernetes.io/defaultProfileName: runtime/default\napparmor.security.beta.kubernetes.io/defaultProfileName: runtime/default\n"` | Annotation for PodSecurityPolicy. This is a multi-line templated string map, and can also be set as YAML. |
| global.serverTelemetry.prometheusOperator | bool | `false` | Enable integration with the Prometheus Operator See the top level serverTelemetry section below before enabling this feature. |
| global.tlsDisable | bool | `true` | TLS for end-to-end encrypted transport |
| injector.affinity | string | `"podAntiAffinity:\n requiredDuringSchedulingIgnoredDuringExecution:\n - labelSelector:\n matchLabels:\n app.kubernetes.io/name: {{ template \"openbao.name\" . }}-agent-injector\n app.kubernetes.io/instance: \"{{ .Release.Name }}\"\n component: webhook\n topologyKey: kubernetes.io/hostname\n"` | |
| injector.agentDefaults.cpuLimit | string | `"500m"` | |
| injector.agentDefaults.cpuRequest | string | `"250m"` | |
| injector.agentDefaults.memLimit | string | `"128Mi"` | |
| injector.agentDefaults.memRequest | string | `"64Mi"` | |
| injector.agentDefaults.template | string | `"map"` | |
| injector.agentDefaults.templateConfig.exitOnRetryFailure | bool | `true` | |
| injector.agentDefaults.templateConfig.staticSecretRenderInterval | string | `""` | |
| injector.agentImage | object | `{"pullPolicy":"IfNotPresent","registry":"quay.io","repository":"openbao/openbao","tag":"2.0.2"}` | agentImage sets the repo and tag of the OpenBao image to use for the OpenBao Agent containers. This should be set to the official OpenBao image. OpenBao 1.3.1+ is required. |
| injector.agentImage.pullPolicy | string | `"IfNotPresent"` | image pull policy to use for agent image. if tag is "latest", set to "Always" |
| injector.agentImage.registry | string | `"quay.io"` | image registry to use for agent image |
| injector.agentImage.repository | string | `"openbao/openbao"` | image repo to use for agent image |
| injector.agentImage.tag | string | `"2.0.2"` | image tag to use for agent image |
| injector.annotations | object | `{}` | |
| injector.authPath | string | `"auth/kubernetes"` | |
| injector.certs.caBundle | string | `""` | |
| injector.certs.certName | string | `"tls.crt"` | |
| injector.certs.keyName | string | `"tls.key"` | |
| injector.certs.secretName | string | `nil` | |
| injector.enabled | string | `"-"` | True if you want to enable openbao agent injection. @default: global.enabled |
| injector.externalVaultAddr | string | `""` | Deprecated: Please use global.externalVaultAddr instead. |
| injector.extraEnvironmentVars | object | `{}` | |
| injector.extraLabels | object | `{}` | |
| injector.failurePolicy | string | `"Ignore"` | |
| injector.hostNetwork | bool | `false` | |
| injector.image.pullPolicy | string | `"IfNotPresent"` | image pull policy to use for k8s image. if tag is "latest", set to "Always" |
| injector.image.registry | string | `"docker.io"` | image registry to use for k8s image |
| injector.image.repository | string | `"hashicorp/vault-k8s"` | image repo to use for k8s image |
| injector.image.tag | string | `"1.4.2"` | image tag to use for k8s image |
| injector.leaderElector | object | `{"enabled":true}` | If multiple replicas are specified, by default a leader will be determined so that only one injector attempts to create TLS certificates. |
| injector.livenessProbe.failureThreshold | int | `2` | When a probe fails, Kubernetes will try failureThreshold times before giving up |
| injector.livenessProbe.initialDelaySeconds | int | `5` | Number of seconds after the container has started before probe initiates |
| injector.livenessProbe.periodSeconds | int | `2` | How often (in seconds) to perform the probe |
| injector.livenessProbe.successThreshold | int | `1` | Minimum consecutive successes for the probe to be considered successful after having failed |
| injector.livenessProbe.timeoutSeconds | int | `5` | Number of seconds after which the probe times out. |
| injector.logFormat | string | `"standard"` | Configures the log format of the injector. Supported log formats: "standard", "json". |
| injector.logLevel | string | `"info"` | Configures the log verbosity of the injector. Supported log levels include: trace, debug, info, warn, error |
| injector.metrics | object | `{"enabled":false}` | If true, will enable a node exporter metrics endpoint at /metrics. |
| injector.namespaceSelector | object | `{}` | |
| injector.nodeSelector | object | `{}` | |
| injector.objectSelector | object | `{}` | |
| injector.podDisruptionBudget | object | `{}` | |
| injector.port | int | `8080` | Configures the port the injector should listen on |
| injector.priorityClassName | string | `""` | |
| injector.readinessProbe.failureThreshold | int | `2` | When a probe fails, Kubernetes will try failureThreshold times before giving up |
| injector.readinessProbe.initialDelaySeconds | int | `5` | Number of seconds after the container has started before probe initiates |
| injector.readinessProbe.periodSeconds | int | `2` | How often (in seconds) to perform the probe |
| injector.readinessProbe.successThreshold | int | `1` | Minimum consecutive successes for the probe to be considered successful after having failed |
| injector.readinessProbe.timeoutSeconds | int | `5` | Number of seconds after which the probe times out. |
| injector.replicas | int | `1` | |
| injector.resources | object | `{}` | |
| injector.revokeOnShutdown | bool | `false` | |
| injector.securityContext.container | object | `{}` | |
| injector.securityContext.pod | object | `{}` | |
| injector.service.annotations | object | `{}` | |
| injector.serviceAccount.annotations | object | `{}` | |
| injector.startupProbe.failureThreshold | int | `12` | When a probe fails, Kubernetes will try failureThreshold times before giving up |
| injector.startupProbe.initialDelaySeconds | int | `5` | Number of seconds after the container has started before probe initiates |
| injector.startupProbe.periodSeconds | int | `5` | How often (in seconds) to perform the probe |
| injector.startupProbe.successThreshold | int | `1` | Minimum consecutive successes for the probe to be considered successful after having failed |
| injector.startupProbe.timeoutSeconds | int | `5` | Number of seconds after which the probe times out. |
| injector.strategy | object | `{}` | |
| injector.tolerations | list | `[]` | |
| injector.topologySpreadConstraints | list | `[]` | |
| injector.webhook.annotations | object | `{}` | |
| injector.webhook.failurePolicy | string | `"Ignore"` | |
| injector.webhook.matchPolicy | string | `"Exact"` | |
| injector.webhook.namespaceSelector | object | `{}` | |
| injector.webhook.objectSelector | string | `"matchExpressions:\n- key: app.kubernetes.io/name\n operator: NotIn\n values:\n - {{ template \"openbao.name\" . }}-agent-injector\n"` | |
| injector.webhook.timeoutSeconds | int | `30` | |
| injector.webhookAnnotations | object | `{}` | |
| server.affinity | string | `"podAntiAffinity:\n requiredDuringSchedulingIgnoredDuringExecution:\n - labelSelector:\n matchLabels:\n app.kubernetes.io/name: {{ template \"openbao.name\" . }}\n app.kubernetes.io/instance: \"{{ .Release.Name }}\"\n component: server\n topologyKey: kubernetes.io/hostname\n"` | |
| server.annotations | object | `{}` | |
| server.auditStorage.accessMode | string | `"ReadWriteOnce"` | |
| server.auditStorage.annotations | object | `{}` | |
| server.auditStorage.enabled | bool | `false` | |
| server.auditStorage.labels | object | `{}` | |
| server.auditStorage.mountPath | string | `"/openbao/audit"` | |
| server.auditStorage.size | string | `"10Gi"` | |
| server.auditStorage.storageClass | string | `nil` | |
| server.authDelegator.enabled | bool | `true` | |
| server.configAnnotation | bool | `false` | |
| server.dataStorage.accessMode | string | `"ReadWriteOnce"` | |
| server.dataStorage.annotations | object | `{}` | |
| server.dataStorage.enabled | bool | `true` | |
| server.dataStorage.labels | object | `{}` | |
| server.dataStorage.mountPath | string | `"/openbao/data"` | |
| server.dataStorage.size | string | `"10Gi"` | |
| server.dataStorage.storageClass | string | `nil` | |
| server.dev.devRootToken | string | `"root"` | |
| server.dev.enabled | bool | `false` | |
| server.enabled | string | `"-"` | |
| server.extraArgs | string | `""` | extraArgs is a string containing additional OpenBao server arguments. |
| server.extraContainers | string | `nil` | |
| server.extraEnvironmentVars | object | `{}` | |
| server.extraInitContainers | list | `[]` | extraInitContainers is a list of init containers. Specified as a YAML list. This is useful if you need to run a script to provision TLS certificates or write out configuration files in a dynamic way. |
| server.extraLabels | object | `{}` | |
| server.extraPorts | list | `[]` | extraPorts is a list of extra ports. Specified as a YAML list. This is useful if you need to add additional ports to the statefulset in dynamic way. |
| server.extraSecretEnvironmentVars | list | `[]` | |
| server.extraVolumes | list | `[]` | |
| server.ha.apiAddr | string | `nil` | |
| server.ha.clusterAddr | string | `nil` | |
| server.ha.config | string | `"ui = true\n\nlistener \"tcp\" {\n tls_disable = 1\n address = \"[::]:8200\"\n cluster_address = \"[::]:8201\"\n}\nstorage \"consul\" {\n path = \"openbao\"\n address = \"HOST_IP:8500\"\n}\n\nservice_registration \"kubernetes\" {}\n\n# Example configuration for using auto-unseal, using Google Cloud KMS. The\n# GKMS keys must already exist, and the cluster must have a service account\n# that is authorized to access GCP KMS.\n#seal \"gcpckms\" {\n# project = \"openbao-helm-dev-246514\"\n# region = \"global\"\n# key_ring = \"openbao-helm-unseal-kr\"\n# crypto_key = \"openbao-helm-unseal-key\"\n#}\n\n# Example configuration for enabling Prometheus metrics.\n# If you are using Prometheus Operator you can enable a ServiceMonitor resource below.\n# You may wish to enable unauthenticated metrics in the listener block above.\n#telemetry {\n# prometheus_retention_time = \"30s\"\n# disable_hostname = true\n#}\n"` | |
| server.ha.disruptionBudget.enabled | bool | `true` | |
| server.ha.disruptionBudget.maxUnavailable | string | `nil` | |
| server.ha.enabled | bool | `false` | |
| server.ha.raft.config | string | `"ui = true\n\nlistener \"tcp\" {\n tls_disable = 1\n address = \"[::]:8200\"\n cluster_address = \"[::]:8201\"\n # Enable unauthenticated metrics access (necessary for Prometheus Operator)\n #telemetry {\n # unauthenticated_metrics_access = \"true\"\n #}\n}\n\nstorage \"raft\" {\n path = \"/openbao/data\"\n}\n\nservice_registration \"kubernetes\" {}\n"` | |
| server.ha.raft.enabled | bool | `false` | |
| server.ha.raft.setNodeId | bool | `false` | |
| server.ha.replicas | int | `3` | |
| server.hostAliases | list | `[]` | |
| server.hostNetwork | bool | `false` | |
| server.image.pullPolicy | string | `"IfNotPresent"` | image pull policy to use for server image. if tag is "latest", set to "Always" |
| server.image.registry | string | `"quay.io"` | image registry to use for server image |
| server.image.repository | string | `"openbao/openbao"` | image repo to use for server image |
| server.image.tag | string | `"2.0.2"` | image tag to use for server image |
| server.ingress.activeService | bool | `true` | |
| server.ingress.annotations | object | `{}` | |
| server.ingress.enabled | bool | `false` | |
| server.ingress.extraPaths | list | `[]` | |
| server.ingress.hosts[0].host | string | `"chart-example.local"` | |
| server.ingress.hosts[0].paths | list | `[]` | |
| server.ingress.ingressClassName | string | `""` | |
| server.ingress.labels | object | `{}` | |
| server.ingress.pathType | string | `"Prefix"` | |
| server.ingress.tls | list | `[]` | |
| server.livenessProbe.enabled | bool | `false` | |
| server.livenessProbe.execCommand | list | `[]` | |
| server.livenessProbe.failureThreshold | int | `2` | |
| server.livenessProbe.initialDelaySeconds | int | `60` | |
| server.livenessProbe.path | string | `"/v1/sys/health?standbyok=true"` | |
| server.livenessProbe.periodSeconds | int | `5` | |
| server.livenessProbe.port | int | `8200` | |
| server.livenessProbe.successThreshold | int | `1` | |
| server.livenessProbe.timeoutSeconds | int | `3` | |
| server.logFormat | string | `""` | |
| server.logLevel | string | `""` | |
| server.networkPolicy.egress | list | `[]` | |
| server.networkPolicy.enabled | bool | `false` | |
| server.networkPolicy.ingress[0].from[0].namespaceSelector | object | `{}` | |
| server.networkPolicy.ingress[0].ports[0].port | int | `8200` | |
| server.networkPolicy.ingress[0].ports[0].protocol | string | `"TCP"` | |
| server.networkPolicy.ingress[0].ports[1].port | int | `8201` | |
| server.networkPolicy.ingress[0].ports[1].protocol | string | `"TCP"` | |
| server.nodeSelector | object | `{}` | |
| server.persistentVolumeClaimRetentionPolicy | object | `{}` | |
| server.postStart | list | `[]` | |
| server.preStopSleepSeconds | int | `5` | |
| server.priorityClassName | string | `""` | |
| server.readinessProbe.enabled | bool | `true` | |
| server.readinessProbe.failureThreshold | int | `2` | |
| server.readinessProbe.initialDelaySeconds | int | `5` | |
| server.readinessProbe.periodSeconds | int | `5` | |
| server.readinessProbe.port | int | `8200` | |
| server.readinessProbe.successThreshold | int | `1` | |
| server.readinessProbe.timeoutSeconds | int | `3` | |
| server.resources | object | `{}` | |
| server.route.activeService | bool | `true` | |
| server.route.annotations | object | `{}` | |
| server.route.enabled | bool | `false` | |
| server.route.host | string | `"chart-example.local"` | |
| server.route.labels | object | `{}` | |
| server.route.tls.termination | string | `"passthrough"` | |
| server.service.active.annotations | object | `{}` | |
| server.service.active.enabled | bool | `true` | |
| server.service.annotations | object | `{}` | |
| server.service.enabled | bool | `true` | |
| server.service.externalTrafficPolicy | string | `"Cluster"` | |
| server.service.instanceSelector.enabled | bool | `true` | |
| server.service.ipFamilies | list | `[]` | |
| server.service.ipFamilyPolicy | string | `""` | |
| server.service.port | int | `8200` | |
| server.service.publishNotReadyAddresses | bool | `true` | |
| server.service.standby.annotations | object | `{}` | |
| server.service.standby.enabled | bool | `true` | |
| server.service.targetPort | int | `8200` | |
| server.serviceAccount.annotations | object | `{}` | |
| server.serviceAccount.create | bool | `true` | |
| server.serviceAccount.createSecret | bool | `false` | |
| server.serviceAccount.extraLabels | object | `{}` | |
| server.serviceAccount.name | string | `""` | |
| server.serviceAccount.serviceDiscovery.enabled | bool | `true` | |
| server.shareProcessNamespace | bool | `false` | shareProcessNamespace enables process namespace sharing between OpenBao and the extraContainers This is useful if OpenBao must be signaled, e.g. to send a SIGHUP for a log rotation |
| server.standalone.config | string | `"ui = true\n\nlistener \"tcp\" {\n tls_disable = 1\n address = \"[::]:8200\"\n cluster_address = \"[::]:8201\"\n # Enable unauthenticated metrics access (necessary for Prometheus Operator)\n #telemetry {\n # unauthenticated_metrics_access = \"true\"\n #}\n}\nstorage \"file\" {\n path = \"/openbao/data\"\n}\n\n# Example configuration for using auto-unseal, using Google Cloud KMS. The\n# GKMS keys must already exist, and the cluster must have a service account\n# that is authorized to access GCP KMS.\n#seal \"gcpckms\" {\n# project = \"openbao-helm-dev\"\n# region = \"global\"\n# key_ring = \"openbao-helm-unseal-kr\"\n# crypto_key = \"openbao-helm-unseal-key\"\n#}\n\n# Example configuration for enabling Prometheus metrics in your config.\n#telemetry {\n# prometheus_retention_time = \"30s\"\n# disable_hostname = true\n#}\n"` | |
| server.standalone.enabled | string | `"-"` | |
| server.statefulSet.annotations | object | `{}` | |
| server.statefulSet.securityContext.container | object | `{}` | |
| server.statefulSet.securityContext.pod | object | `{}` | |
| server.terminationGracePeriodSeconds | int | `10` | |
| server.tolerations | list | `[]` | |
| server.topologySpreadConstraints | list | `[]` | |
| server.updateStrategyType | string | `"OnDelete"` | |
| server.volumeMounts | string | `nil` | |
| server.volumes | string | `nil` | |
| serverTelemetry.prometheusRules.enabled | bool | `false` | |
| serverTelemetry.prometheusRules.rules | list | `[]` | |
| serverTelemetry.prometheusRules.selectors | object | `{}` | |
| serverTelemetry.serviceMonitor.enabled | bool | `false` | |
| serverTelemetry.serviceMonitor.interval | string | `"30s"` | |
| serverTelemetry.serviceMonitor.scrapeTimeout | string | `"10s"` | |
| serverTelemetry.serviceMonitor.selectors | object | `{}` | |
| ui.activeOpenbaoPodOnly | bool | `false` | |
| ui.annotations | object | `{}` | |
| ui.enabled | bool | `false` | |
| ui.externalPort | int | `8200` | |
| ui.externalTrafficPolicy | string | `"Cluster"` | |
| ui.publishNotReadyAddresses | bool | `true` | |
| ui.serviceIPFamilies | list | `[]` | |
| ui.serviceIPFamilyPolicy | string | `""` | |
| ui.serviceNodePort | string | `nil` | |
| ui.serviceType | string | `"ClusterIP"` | |
| ui.targetPort | int | `8200` | |

View file

@ -0,0 +1,14 @@
Thank you for installing OpenBao!
Now that you have deployed OpenBao, you should look over the docs on using
OpenBao with Kubernetes available here:
https://openbao.org/docs/
Your release is named {{ .Release.Name }}. To learn more about the release, try:
$ helm status {{ .Release.Name }}
$ helm get manifest {{ .Release.Name }}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,34 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{- template "openbao.csiEnabled" . -}}
{{- if and (.csiEnabled) (eq (.Values.csi.agent.enabled | toString) "true") -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "openbao.fullname" . }}-csi-provider-agent-config
namespace: {{ include "openbao.namespace" . }}
labels:
helm.sh/chart: {{ include "openbao.chart" . }}
app.kubernetes.io/name: {{ include "openbao.name" . }}-csi-provider
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
data:
config.hcl: |
vault {
{{- if .Values.global.externalVaultAddr }}
"address" = "{{ .Values.global.externalVaultAddr }}"
{{- else }}
"address" = "{{ include "openbao.scheme" . }}://{{ template "openbao.fullname" . }}.{{ include "openbao.namespace" . }}.svc:{{ .Values.server.service.port }}"
{{- end }}
}
cache {}
listener "unix" {
address = "/var/run/vault/agent.sock"
tls_disable = true
}
{{- end }}

View file

@ -0,0 +1,23 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{- template "openbao.csiEnabled" . -}}
{{- if .csiEnabled -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ template "openbao.fullname" . }}-csi-provider-clusterrole
labels:
app.kubernetes.io/name: {{ include "openbao.name" . }}-csi-provider
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
rules:
- apiGroups:
- ""
resources:
- serviceaccounts/token
verbs:
- create
{{- end }}

View file

@ -0,0 +1,24 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{- template "openbao.csiEnabled" . -}}
{{- if .csiEnabled -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ template "openbao.fullname" . }}-csi-provider-clusterrolebinding
labels:
app.kubernetes.io/name: {{ include "openbao.name" . }}-csi-provider
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ template "openbao.fullname" . }}-csi-provider-clusterrole
subjects:
- kind: ServiceAccount
name: {{ template "openbao.fullname" . }}-csi-provider
namespace: {{ include "openbao.namespace" . }}
{{- end }}

View file

@ -0,0 +1,157 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{- template "openbao.csiEnabled" . -}}
{{- if .csiEnabled -}}
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: {{ template "openbao.fullname" . }}-csi-provider
namespace: {{ include "openbao.namespace" . }}
labels:
app.kubernetes.io/name: {{ include "openbao.name" . }}-csi-provider
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- if .Values.csi.daemonSet.extraLabels -}}
{{- toYaml .Values.csi.daemonSet.extraLabels | nindent 4 -}}
{{- end -}}
{{ template "csi.daemonSet.annotations" . }}
spec:
updateStrategy:
type: {{ .Values.csi.daemonSet.updateStrategy.type }}
{{- if .Values.csi.daemonSet.updateStrategy.maxUnavailable }}
rollingUpdate:
maxUnavailable: {{ .Values.csi.daemonSet.updateStrategy.maxUnavailable }}
{{- end }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "openbao.name" . }}-csi-provider
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ template "openbao.name" . }}-csi-provider
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Values.csi.pod.extraLabels -}}
{{- toYaml .Values.csi.pod.extraLabels | nindent 8 -}}
{{- end -}}
{{ template "csi.pod.annotations" . }}
spec:
{{ template "csi.daemonSet.securityContext.pod" . }}
{{- if .Values.csi.priorityClassName }}
priorityClassName: {{ .Values.csi.priorityClassName }}
{{- end }}
serviceAccountName: {{ template "openbao.fullname" . }}-csi-provider
{{- template "csi.pod.tolerations" . }}
{{- template "csi.pod.nodeselector" . }}
{{- template "csi.pod.affinity" . }}
containers:
- name: {{ include "openbao.name" . }}-csi-provider
{{ template "csi.resources" . }}
{{ template "csi.daemonSet.securityContext.container" . }}
image: "{{ .Values.csi.image.registry | default "docker.io" }}/{{ .Values.csi.image.repository }}:{{ .Values.csi.image.tag }}"
imagePullPolicy: {{ .Values.csi.image.pullPolicy }}
args:
- --endpoint=/provider/vault.sock
- --debug={{ .Values.csi.debug }}
{{- if .Values.csi.hmacSecretName }}
- --hmac-secret-name={{ .Values.csi.hmacSecretName }}
{{- else }}
- --hmac-secret-name={{- include "openbao.name" . }}-csi-provider-hmac-key
{{- end }}
{{- if .Values.csi.extraArgs }}
{{- toYaml .Values.csi.extraArgs | nindent 12 }}
{{- end }}
env:
- name: VAULT_ADDR
{{- if eq (.Values.csi.agent.enabled | toString) "true" }}
value: "unix:///var/run/vault/agent.sock"
{{- else if .Values.global.externalVaultAddr }}
value: "{{ .Values.global.externalVaultAddr }}"
{{- else }}
value: {{ include "openbao.scheme" . }}://{{ template "openbao.fullname" . }}.{{ include "openbao.namespace" . }}.svc:{{ .Values.server.service.port }}
{{- end }}
volumeMounts:
- name: providervol
mountPath: "/provider"
{{- if eq (.Values.csi.agent.enabled | toString) "true" }}
- name: agent-unix-socket
mountPath: /var/run/vault
{{- end }}
{{- if .Values.csi.volumeMounts }}
{{- toYaml .Values.csi.volumeMounts | nindent 12}}
{{- end }}
livenessProbe:
httpGet:
path: /health/ready
port: 8080
failureThreshold: {{ .Values.csi.livenessProbe.failureThreshold }}
initialDelaySeconds: {{ .Values.csi.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.csi.livenessProbe.periodSeconds }}
successThreshold: {{ .Values.csi.livenessProbe.successThreshold }}
timeoutSeconds: {{ .Values.csi.livenessProbe.timeoutSeconds }}
readinessProbe:
httpGet:
path: /health/ready
port: 8080
failureThreshold: {{ .Values.csi.readinessProbe.failureThreshold }}
initialDelaySeconds: {{ .Values.csi.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.csi.readinessProbe.periodSeconds }}
successThreshold: {{ .Values.csi.readinessProbe.successThreshold }}
timeoutSeconds: {{ .Values.csi.readinessProbe.timeoutSeconds }}
{{- if eq (.Values.csi.agent.enabled | toString) "true" }}
- name: {{ include "openbao.name" . }}-agent
image: "{{ .Values.csi.agent.image.registry | default "docker.io" }}/{{ .Values.csi.agent.image.repository }}:{{ .Values.csi.agent.image.tag }}"
imagePullPolicy: {{ .Values.csi.agent.image.pullPolicy }}
{{ template "csi.agent.resources" . }}
command:
- bao
args:
- agent
- -config=/etc/vault/config.hcl
{{- if .Values.csi.agent.extraArgs }}
{{- toYaml .Values.csi.agent.extraArgs | nindent 12 }}
{{- end }}
ports:
- containerPort: 8200
env:
- name: BAO_LOG_LEVEL
value: "{{ .Values.csi.agent.logLevel }}"
- name: BAO_LOG_FORMAT
value: "{{ .Values.csi.agent.logFormat }}"
securityContext:
runAsNonRoot: true
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsUser: 100
runAsGroup: 1000
volumeMounts:
- name: agent-config
mountPath: /etc/vault/config.hcl
subPath: config.hcl
readOnly: true
- name: agent-unix-socket
mountPath: /var/run/vault
{{- if .Values.csi.volumeMounts }}
{{- toYaml .Values.csi.volumeMounts | nindent 12 }}
{{- end }}
{{- end }}
volumes:
- name: providervol
hostPath:
path: {{ .Values.csi.daemonSet.providersDir }}
{{- if eq (.Values.csi.agent.enabled | toString) "true" }}
- name: agent-config
configMap:
name: {{ template "openbao.fullname" . }}-csi-provider-agent-config
- name: agent-unix-socket
emptyDir:
medium: Memory
{{- end }}
{{- if .Values.csi.volumes }}
{{- toYaml .Values.csi.volumes | nindent 8}}
{{- end }}
{{- include "imagePullSecrets" . | nindent 6 }}
{{- end }}

View file

@ -0,0 +1,32 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{- template "openbao.csiEnabled" . -}}
{{- if .csiEnabled -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ template "openbao.fullname" . }}-csi-provider-role
namespace: {{ include "openbao.namespace" . }}
labels:
app.kubernetes.io/name: {{ include "openbao.name" . }}-csi-provider
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
rules:
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get"]
resourceNames:
{{- if .Values.csi.hmacSecretName }}
- {{ .Values.csi.hmacSecretName }}
{{- else }}
- {{ include "openbao.name" . }}-csi-provider-hmac-key
{{- end }}
# 'create' permissions cannot be restricted by resource name:
# https://kubernetes.io/docs/reference/access-authn-authz/rbac/#referring-to-resources
- apiGroups: [""]
resources: ["secrets"]
verbs: ["create"]
{{- end }}

View file

@ -0,0 +1,25 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{- template "openbao.csiEnabled" . -}}
{{- if .csiEnabled -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ template "openbao.fullname" . }}-csi-provider-rolebinding
namespace: {{ include "openbao.namespace" . }}
labels:
app.kubernetes.io/name: {{ include "openbao.name" . }}-csi-provider
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ template "openbao.fullname" . }}-csi-provider-role
subjects:
- kind: ServiceAccount
name: {{ template "openbao.fullname" . }}-csi-provider
namespace: {{ include "openbao.namespace" . }}
{{- end }}

View file

@ -0,0 +1,21 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{- template "openbao.csiEnabled" . -}}
{{- if .csiEnabled -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "openbao.fullname" . }}-csi-provider
namespace: {{ include "openbao.namespace" . }}
labels:
app.kubernetes.io/name: {{ include "openbao.name" . }}-csi-provider
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- if .Values.csi.serviceAccount.extraLabels -}}
{{- toYaml .Values.csi.serviceAccount.extraLabels | nindent 4 -}}
{{- end -}}
{{ template "csi.serviceAccount.annotations" . }}
{{- end }}

View file

@ -0,0 +1,19 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{- template "openbao.injectorEnabled" . -}}
{{- if .injectorEnabled -}}
{{- if and (eq (.Values.injector.leaderElector.enabled | toString) "true") (gt (.Values.injector.replicas | int) 1) }}
apiVersion: v1
kind: Secret
metadata:
name: openbao-injector-certs
namespace: {{ include "openbao.namespace" . }}
labels:
app.kubernetes.io/name: {{ include "openbao.name" . }}-agent-injector
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{- end }}

View file

@ -0,0 +1,30 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{- template "openbao.injectorEnabled" . -}}
{{- if .injectorEnabled -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ template "openbao.fullname" . }}-agent-injector-clusterrole
labels:
app.kubernetes.io/name: {{ include "openbao.name" . }}-agent-injector
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
rules:
- apiGroups: ["admissionregistration.k8s.io"]
resources: ["mutatingwebhookconfigurations"]
verbs:
- "get"
- "list"
- "watch"
- "patch"
{{- if and (eq (.Values.injector.leaderElector.enabled | toString) "true") (gt (.Values.injector.replicas | int) 1) }}
- apiGroups: [""]
resources: ["nodes"]
verbs:
- "get"
{{ end }}
{{ end }}

View file

@ -0,0 +1,24 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{- template "openbao.injectorEnabled" . -}}
{{- if .injectorEnabled -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ template "openbao.fullname" . }}-agent-injector-binding
labels:
app.kubernetes.io/name: {{ include "openbao.name" . }}-agent-injector
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ template "openbao.fullname" . }}-agent-injector-clusterrole
subjects:
- kind: ServiceAccount
name: {{ template "openbao.fullname" . }}-agent-injector
namespace: {{ include "openbao.namespace" . }}
{{ end }}

View file

@ -0,0 +1,179 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{- template "openbao.injectorEnabled" . -}}
{{- if .injectorEnabled -}}
# Deployment for the injector
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "openbao.fullname" . }}-agent-injector
namespace: {{ include "openbao.namespace" . }}
labels:
app.kubernetes.io/name: {{ include "openbao.name" . }}-agent-injector
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
component: webhook
spec:
replicas: {{ .Values.injector.replicas }}
selector:
matchLabels:
app.kubernetes.io/name: {{ template "openbao.name" . }}-agent-injector
app.kubernetes.io/instance: {{ .Release.Name }}
component: webhook
{{ template "injector.strategy" . }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ template "openbao.name" . }}-agent-injector
app.kubernetes.io/instance: {{ .Release.Name }}
component: webhook
{{- if .Values.injector.extraLabels -}}
{{- toYaml .Values.injector.extraLabels | nindent 8 -}}
{{- end -}}
{{ template "injector.annotations" . }}
spec:
{{ template "injector.affinity" . }}
{{ template "injector.topologySpreadConstraints" . }}
{{ template "injector.tolerations" . }}
{{ template "injector.nodeselector" . }}
{{- if .Values.injector.priorityClassName }}
priorityClassName: {{ .Values.injector.priorityClassName }}
{{- end }}
serviceAccountName: "{{ template "openbao.fullname" . }}-agent-injector"
{{ template "injector.securityContext.pod" . -}}
{{- if not .Values.global.openshift }}
hostNetwork: {{ .Values.injector.hostNetwork }}
{{- end }}
containers:
- name: sidecar-injector
{{ template "injector.resources" . }}
image: "{{ .Values.injector.image.registry | default "docker.io" }}/{{ .Values.injector.image.repository }}:{{ .Values.injector.image.tag }}"
imagePullPolicy: "{{ .Values.injector.image.pullPolicy }}"
{{- template "injector.securityContext.container" . }}
env:
- name: AGENT_INJECT_LISTEN
value: {{ printf ":%v" .Values.injector.port }}
- name: AGENT_INJECT_LOG_LEVEL
value: {{ .Values.injector.logLevel | default "info" }}
- name: AGENT_INJECT_VAULT_ADDR
{{- if .Values.global.externalVaultAddr }}
value: "{{ .Values.global.externalVaultAddr }}"
{{- else if .Values.injector.externalVaultAddr }}
value: "{{ .Values.injector.externalVaultAddr }}"
{{- else }}
value: {{ include "openbao.scheme" . }}://{{ template "openbao.fullname" . }}.{{ include "openbao.namespace" . }}.svc:{{ .Values.server.service.port }}
{{- end }}
- name: AGENT_INJECT_VAULT_AUTH_PATH
value: {{ .Values.injector.authPath }}
- name: AGENT_INJECT_VAULT_IMAGE
value: "{{ .Values.injector.image.registry | default "quay.io" }}/{{ .Values.injector.agentImage.repository }}:{{ .Values.injector.agentImage.tag }}"
{{- if .Values.injector.certs.secretName }}
- name: AGENT_INJECT_TLS_CERT_FILE
value: "/etc/webhook/certs/{{ .Values.injector.certs.certName }}"
- name: AGENT_INJECT_TLS_KEY_FILE
value: "/etc/webhook/certs/{{ .Values.injector.certs.keyName }}"
{{- else }}
- name: AGENT_INJECT_TLS_AUTO
value: {{ template "openbao.fullname" . }}-agent-injector-cfg
- name: AGENT_INJECT_TLS_AUTO_HOSTS
value: {{ template "openbao.fullname" . }}-agent-injector-svc,{{ template "openbao.fullname" . }}-agent-injector-svc.{{ include "openbao.namespace" . }},{{ template "openbao.fullname" . }}-agent-injector-svc.{{ include "openbao.namespace" . }}.svc
{{- end }}
- name: AGENT_INJECT_LOG_FORMAT
value: {{ .Values.injector.logFormat | default "standard" }}
- name: AGENT_INJECT_REVOKE_ON_SHUTDOWN
value: "{{ .Values.injector.revokeOnShutdown | default false }}"
{{- if .Values.global.openshift }}
- name: AGENT_INJECT_SET_SECURITY_CONTEXT
value: "false"
{{- end }}
{{- if .Values.injector.metrics.enabled }}
- name: AGENT_INJECT_TELEMETRY_PATH
value: "/metrics"
{{- end }}
{{- if and (eq (.Values.injector.leaderElector.enabled | toString) "true") (gt (.Values.injector.replicas | int) 1) }}
- name: AGENT_INJECT_USE_LEADER_ELECTOR
value: "true"
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- end }}
- name: AGENT_INJECT_CPU_REQUEST
value: "{{ .Values.injector.agentDefaults.cpuRequest }}"
- name: AGENT_INJECT_CPU_LIMIT
value: "{{ .Values.injector.agentDefaults.cpuLimit }}"
- name: AGENT_INJECT_MEM_REQUEST
value: "{{ .Values.injector.agentDefaults.memRequest }}"
- name: AGENT_INJECT_MEM_LIMIT
value: "{{ .Values.injector.agentDefaults.memLimit }}"
{{- if .Values.injector.agentDefaults.ephemeralRequest }}
- name: AGENT_INJECT_EPHEMERAL_REQUEST
value: "{{ .Values.injector.agentDefaults.ephemeralRequest }}"
{{- end }}
{{- if .Values.injector.agentDefaults.ephemeralLimit }}
- name: AGENT_INJECT_EPHEMERAL_LIMIT
value: "{{ .Values.injector.agentDefaults.ephemeralLimit }}"
{{- end }}
- name: AGENT_INJECT_DEFAULT_TEMPLATE
value: "{{ .Values.injector.agentDefaults.template }}"
- name: AGENT_INJECT_TEMPLATE_CONFIG_EXIT_ON_RETRY_FAILURE
value: "{{ .Values.injector.agentDefaults.templateConfig.exitOnRetryFailure }}"
{{- if .Values.injector.agentDefaults.templateConfig.staticSecretRenderInterval }}
- name: AGENT_INJECT_TEMPLATE_STATIC_SECRET_RENDER_INTERVAL
value: "{{ .Values.injector.agentDefaults.templateConfig.staticSecretRenderInterval }}"
{{- end }}
{{- include "openbao.extraEnvironmentVars" .Values.injector | nindent 12 }}
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
args:
- agent-inject
- 2>&1
livenessProbe:
httpGet:
path: /health/ready
port: {{ .Values.injector.port }}
scheme: HTTPS
failureThreshold: {{ .Values.injector.livenessProbe.failureThreshold }}
initialDelaySeconds: {{ .Values.injector.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.injector.livenessProbe.periodSeconds }}
successThreshold: {{ .Values.injector.livenessProbe.successThreshold }}
timeoutSeconds: {{ .Values.injector.livenessProbe.timeoutSeconds }}
readinessProbe:
httpGet:
path: /health/ready
port: {{ .Values.injector.port }}
scheme: HTTPS
failureThreshold: {{ .Values.injector.readinessProbe.failureThreshold }}
initialDelaySeconds: {{ .Values.injector.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.injector.readinessProbe.periodSeconds }}
successThreshold: {{ .Values.injector.readinessProbe.successThreshold }}
timeoutSeconds: {{ .Values.injector.readinessProbe.timeoutSeconds }}
startupProbe:
httpGet:
path: /health/ready
port: {{ .Values.injector.port }}
scheme: HTTPS
failureThreshold: {{ .Values.injector.startupProbe.failureThreshold }}
initialDelaySeconds: {{ .Values.injector.startupProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.injector.startupProbe.periodSeconds }}
successThreshold: {{ .Values.injector.startupProbe.successThreshold }}
timeoutSeconds: {{ .Values.injector.startupProbe.timeoutSeconds }}
{{- if .Values.injector.certs.secretName }}
volumeMounts:
- name: webhook-certs
mountPath: /etc/webhook/certs
readOnly: true
{{- end }}
{{- if .Values.injector.certs.secretName }}
volumes:
- name: webhook-certs
secret:
secretName: "{{ .Values.injector.certs.secretName }}"
{{- end }}
{{- include "imagePullSecrets" . | nindent 6 }}
{{ end }}

View file

@ -0,0 +1,25 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{- if .Values.injector.podDisruptionBudget }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ template "openbao.fullname" . }}-agent-injector
namespace: {{ include "openbao.namespace" . }}
labels:
helm.sh/chart: {{ include "openbao.chart" . }}
app.kubernetes.io/name: {{ include "openbao.name" . }}-agent-injector
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
component: webhook
spec:
selector:
matchLabels:
app.kubernetes.io/name: {{ template "openbao.name" . }}-agent-injector
app.kubernetes.io/instance: {{ .Release.Name }}
component: webhook
{{- toYaml .Values.injector.podDisruptionBudget | nindent 2 }}
{{- end -}}

View file

@ -0,0 +1,44 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{- template "openbao.injectorEnabled" . -}}
{{- if .injectorEnabled -}}
{{- if .Capabilities.APIVersions.Has "admissionregistration.k8s.io/v1" }}
apiVersion: admissionregistration.k8s.io/v1
{{- else }}
apiVersion: admissionregistration.k8s.io/v1beta1
{{- end }}
kind: MutatingWebhookConfiguration
metadata:
name: {{ template "openbao.fullname" . }}-agent-injector-cfg
labels:
app.kubernetes.io/name: {{ include "openbao.name" . }}-agent-injector
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- template "injector.webhookAnnotations" . }}
webhooks:
- name: vault.hashicorp.com
failurePolicy: {{ ((.Values.injector.webhook)).failurePolicy | default .Values.injector.failurePolicy }}
matchPolicy: {{ ((.Values.injector.webhook)).matchPolicy | default "Exact" }}
sideEffects: None
timeoutSeconds: {{ ((.Values.injector.webhook)).timeoutSeconds | default "30" }}
admissionReviewVersions: ["v1", "v1beta1"]
clientConfig:
service:
name: {{ template "openbao.fullname" . }}-agent-injector-svc
namespace: {{ include "openbao.namespace" . }}
path: "/mutate"
caBundle: {{ .Values.injector.certs.caBundle | quote }}
rules:
- operations: ["CREATE", "UPDATE"]
apiGroups: [""]
apiVersions: ["v1"]
resources: ["pods"]
{{- if or (.Values.injector.namespaceSelector) (((.Values.injector.webhook)).namespaceSelector) }}
namespaceSelector:
{{ toYaml (((.Values.injector.webhook)).namespaceSelector | default .Values.injector.namespaceSelector) | indent 6}}
{{ end }}
{{- template "injector.objectSelector" . -}}
{{ end }}

View file

@ -0,0 +1,29 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{- template "openbao.injectorEnabled" . -}}
{{- if .injectorEnabled -}}
{{- if eq (.Values.global.openshift | toString) "true" }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: {{ template "openbao.fullname" . }}-agent-injector
labels:
app.kubernetes.io/name: {{ template "openbao.name" . }}-agent-injector
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: {{ template "openbao.name" . }}-agent-injector
app.kubernetes.io/instance: {{ .Release.Name }}
component: webhook
ingress:
- from:
- namespaceSelector: {}
ports:
- port: 8080
protocol: TCP
{{ end }}
{{ end }}

View file

@ -0,0 +1,25 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{- template "openbao.injectorEnabled" . -}}
{{- if .injectorEnabled -}}
{{- if eq (.Values.global.psp.enable | toString) "true" }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ template "openbao.fullname" . }}-agent-injector-psp
namespace: {{ include "openbao.namespace" . }}
labels:
app.kubernetes.io/name: {{ include "openbao.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
rules:
- apiGroups: ['policy']
resources: ['podsecuritypolicies']
verbs: ['use']
resourceNames:
- {{ template "openbao.fullname" . }}-agent-injector
{{- end }}
{{- end }}

View file

@ -0,0 +1,26 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{- template "openbao.injectorEnabled" . -}}
{{- if .injectorEnabled -}}
{{- if eq (.Values.global.psp.enable | toString) "true" }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ template "openbao.fullname" . }}-agent-injector-psp
namespace: {{ include "openbao.namespace" . }}
labels:
app.kubernetes.io/name: {{ include "openbao.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
roleRef:
kind: Role
name: {{ template "openbao.fullname" . }}-agent-injector-psp
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
name: {{ template "openbao.fullname" . }}-agent-injector
{{- end }}
{{- end }}

View file

@ -0,0 +1,51 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{- template "openbao.injectorEnabled" . -}}
{{- if .injectorEnabled -}}
{{- if eq (.Values.global.psp.enable | toString) "true" }}
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: {{ template "openbao.fullname" . }}-agent-injector
labels:
app.kubernetes.io/name: {{ include "openbao.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- template "openbao.psp.annotations" . }}
spec:
privileged: false
# Required to prevent escalations to root.
allowPrivilegeEscalation: false
volumes:
- configMap
- emptyDir
- projected
- secret
- downwardAPI
hostNetwork: false
hostIPC: false
hostPID: false
runAsUser:
# Require the container to run without root privileges.
rule: MustRunAsNonRoot
seLinux:
# This policy assumes the nodes are using AppArmor rather than SELinux.
rule: RunAsAny
supplementalGroups:
rule: MustRunAs
ranges:
# Forbid adding the root group.
- min: 1
max: 65535
fsGroup:
rule: MustRunAs
ranges:
# Forbid adding the root group.
- min: 1
max: 65535
readOnlyRootFilesystem: false
{{- end }}
{{- end }}

View file

@ -0,0 +1,34 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{- template "openbao.injectorEnabled" . -}}
{{- if .injectorEnabled -}}
{{- if and (eq (.Values.injector.leaderElector.enabled | toString) "true") (gt (.Values.injector.replicas | int) 1) }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ template "openbao.fullname" . }}-agent-injector-leader-elector-role
namespace: {{ include "openbao.namespace" . }}
labels:
app.kubernetes.io/name: {{ include "openbao.name" . }}-agent-injector
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
rules:
- apiGroups: [""]
resources: ["secrets", "configmaps"]
verbs:
- "create"
- "get"
- "watch"
- "list"
- "update"
- apiGroups: [""]
resources: ["pods"]
verbs:
- "get"
- "patch"
- "delete"
{{- end }}
{{- end }}

View file

@ -0,0 +1,27 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{- template "openbao.injectorEnabled" . -}}
{{- if .injectorEnabled -}}
{{- if and (eq (.Values.injector.leaderElector.enabled | toString) "true") (gt (.Values.injector.replicas | int) 1) }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ template "openbao.fullname" . }}-agent-injector-leader-elector-binding
namespace: {{ include "openbao.namespace" . }}
labels:
app.kubernetes.io/name: {{ include "openbao.name" . }}-agent-injector
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ template "openbao.fullname" . }}-agent-injector-leader-elector-role
subjects:
- kind: ServiceAccount
name: {{ template "openbao.fullname" . }}-agent-injector
namespace: {{ include "openbao.namespace" . }}
{{- end }}
{{- end }}

View file

@ -0,0 +1,27 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{- template "openbao.injectorEnabled" . -}}
{{- if .injectorEnabled -}}
apiVersion: v1
kind: Service
metadata:
name: {{ template "openbao.fullname" . }}-agent-injector-svc
namespace: {{ include "openbao.namespace" . }}
labels:
app.kubernetes.io/name: {{ include "openbao.name" . }}-agent-injector
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{ template "injector.service.annotations" . }}
spec:
ports:
- name: https
port: 443
targetPort: {{ .Values.injector.port }}
selector:
app.kubernetes.io/name: {{ include "openbao.name" . }}-agent-injector
app.kubernetes.io/instance: {{ .Release.Name }}
component: webhook
{{- end }}

View file

@ -0,0 +1,18 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{- template "openbao.injectorEnabled" . -}}
{{- if .injectorEnabled -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "openbao.fullname" . }}-agent-injector
namespace: {{ include "openbao.namespace" . }}
labels:
app.kubernetes.io/name: {{ include "openbao.name" . }}-agent-injector
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{ template "injector.serviceAccount.annotations" . }}
{{ end }}

View file

@ -0,0 +1,31 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{ if and (.Values.serverTelemetry.prometheusRules.rules)
(or (.Values.global.serverTelemetry.prometheusOperator) (.Values.serverTelemetry.prometheusRules.enabled) )
}}
---
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: {{ template "openbao.fullname" . }}
labels:
helm.sh/chart: {{ include "openbao.chart" . }}
app.kubernetes.io/name: {{ include "openbao.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- /* update the selectors docs in values.yaml whenever the defaults below change. */ -}}
{{- $selectors := .Values.serverTelemetry.prometheusRules.selectors }}
{{- if $selectors }}
{{- toYaml $selectors | nindent 4 }}
{{- else }}
release: prometheus
{{- end }}
spec:
groups:
- name: {{ include "openbao.fullname" . }}
rules:
{{- toYaml .Values.serverTelemetry.prometheusRules.rules | nindent 6 }}
{{- end }}

View file

@ -0,0 +1,49 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{ template "openbao.mode" . }}
{{ if or (.Values.global.serverTelemetry.prometheusOperator) (.Values.serverTelemetry.serviceMonitor.enabled) }}
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ template "openbao.fullname" . }}
labels:
helm.sh/chart: {{ include "openbao.chart" . }}
app.kubernetes.io/name: {{ include "openbao.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- /* update the selectors docs in values.yaml whenever the defaults below change. */ -}}
{{- $selectors := .Values.serverTelemetry.serviceMonitor.selectors }}
{{- if $selectors }}
{{- toYaml $selectors | nindent 4 }}
{{- else }}
release: prometheus
{{- end }}
spec:
selector:
matchLabels:
app.kubernetes.io/name: {{ template "openbao.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if eq .mode "ha" }}
openbao-active: "true"
{{- else }}
openbao-internal: "true"
{{- end }}
endpoints:
- port: {{ include "openbao.scheme" . }}
interval: {{ .Values.serverTelemetry.serviceMonitor.interval }}
scrapeTimeout: {{ .Values.serverTelemetry.serviceMonitor.scrapeTimeout }}
scheme: {{ include "openbao.scheme" . | lower }}
path: /v1/sys/metrics
params:
format:
- prometheus
tlsConfig:
insecureSkipVerify: true
namespaceSelector:
matchNames:
- {{ include "openbao.namespace" . }}
{{ end }}

View file

@ -0,0 +1,29 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{ template "openbao.serverAuthDelegator" . }}
{{- if .serverAuthDelegator -}}
{{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" -}}
apiVersion: rbac.authorization.k8s.io/v1
{{- else }}
apiVersion: rbac.authorization.k8s.io/v1beta1
{{- end }}
kind: ClusterRoleBinding
metadata:
name: {{ template "openbao.fullname" . }}-server-binding
labels:
helm.sh/chart: {{ include "openbao.chart" . }}
app.kubernetes.io/name: {{ include "openbao.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: system:auth-delegator
subjects:
- kind: ServiceAccount
name: {{ template "openbao.serviceAccount.name" . }}
namespace: {{ include "openbao.namespace" . }}
{{ end }}

View file

@ -0,0 +1,31 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{ template "openbao.mode" . }}
{{- if ne .mode "external" }}
{{- if .serverEnabled -}}
{{- if ne .mode "dev" -}}
{{ if or (.Values.server.standalone.config) (.Values.server.ha.config) -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "openbao.fullname" . }}-config
namespace: {{ include "openbao.namespace" . }}
labels:
helm.sh/chart: {{ include "openbao.chart" . }}
app.kubernetes.io/name: {{ include "openbao.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- if .Values.server.includeConfigAnnotation }}
annotations:
vault.hashicorp.com/config-checksum: {{ include "openbao.config" . | sha256sum }}
{{- end }}
data:
extraconfig-from-values.hcl: |-
{{ template "openbao.config" . }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}

View file

@ -0,0 +1,26 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{ template "openbao.mode" . }}
{{- if .serverEnabled -}}
{{- if eq .mode "ha" }}
{{- if eq (.Values.server.serviceAccount.serviceDiscovery.enabled | toString) "true" }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
namespace: {{ include "openbao.namespace" . }}
name: {{ template "openbao.fullname" . }}-discovery-role
labels:
helm.sh/chart: {{ include "openbao.chart" . }}
app.kubernetes.io/name: {{ include "openbao.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "watch", "list", "update", "patch"]
{{ end }}
{{ end }}
{{ end }}

View file

@ -0,0 +1,34 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{ template "openbao.mode" . }}
{{- if .serverEnabled -}}
{{- if eq .mode "ha" }}
{{- if eq (.Values.server.serviceAccount.serviceDiscovery.enabled | toString) "true" }}
{{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" -}}
apiVersion: rbac.authorization.k8s.io/v1
{{- else }}
apiVersion: rbac.authorization.k8s.io/v1beta1
{{- end }}
kind: RoleBinding
metadata:
name: {{ template "openbao.fullname" . }}-discovery-rolebinding
namespace: {{ include "openbao.namespace" . }}
labels:
helm.sh/chart: {{ include "openbao.chart" . }}
app.kubernetes.io/name: {{ include "openbao.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ template "openbao.fullname" . }}-discovery-role
subjects:
- kind: ServiceAccount
name: {{ template "openbao.serviceAccount.name" . }}
namespace: {{ include "openbao.namespace" . }}
{{ end }}
{{ end }}
{{ end }}

View file

@ -0,0 +1,31 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{ template "openbao.mode" . }}
{{- if ne .mode "external" -}}
{{- if .serverEnabled -}}
{{- if and (eq .mode "ha") (eq (.Values.server.ha.disruptionBudget.enabled | toString) "true") -}}
# PodDisruptionBudget to prevent degrading the server cluster through
# voluntary cluster changes.
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ template "openbao.fullname" . }}
namespace: {{ include "openbao.namespace" . }}
labels:
helm.sh/chart: {{ include "openbao.chart" . }}
app.kubernetes.io/name: {{ include "openbao.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
maxUnavailable: {{ template "openbao.pdb.maxUnavailable" . }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "openbao.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
component: server
{{- end -}}
{{- end -}}
{{- end -}}

View file

@ -0,0 +1,64 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{ template "openbao.mode" . }}
{{- if ne .mode "external" }}
{{- template "openbao.serverServiceEnabled" . -}}
{{- if .serverServiceEnabled -}}
{{- if eq .mode "ha" }}
{{- if eq (.Values.server.service.active.enabled | toString) "true" }}
# Service for active OpenBao pod
apiVersion: v1
kind: Service
metadata:
name: {{ template "openbao.fullname" . }}-active
namespace: {{ include "openbao.namespace" . }}
labels:
helm.sh/chart: {{ include "openbao.chart" . }}
app.kubernetes.io/name: {{ include "openbao.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
openbao-active: "true"
annotations:
{{- template "openbao.service.active.annotations" . }}
{{- template "openbao.service.annotations" . }}
spec:
{{- if .Values.server.service.type}}
type: {{ .Values.server.service.type }}
{{- end}}
{{- if (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) }}
{{- if .Values.server.service.ipFamilyPolicy }}
ipFamilyPolicy: {{ .Values.server.service.ipFamilyPolicy }}
{{- end }}
{{- if .Values.server.service.ipFamilies }}
ipFamilies: {{ .Values.server.service.ipFamilies | toYaml | nindent 2 }}
{{- end }}
{{- end }}
{{- if .Values.server.service.clusterIP }}
clusterIP: {{ .Values.server.service.clusterIP }}
{{- end }}
{{- include "service.externalTrafficPolicy" .Values.server.service }}
publishNotReadyAddresses: {{ .Values.server.service.publishNotReadyAddresses }}
ports:
- name: {{ include "openbao.scheme" . }}
port: {{ .Values.server.service.port }}
targetPort: {{ .Values.server.service.targetPort }}
{{- if and (.Values.server.service.activeNodePort) (eq (.Values.server.service.type | toString) "NodePort") }}
nodePort: {{ .Values.server.service.activeNodePort }}
{{- end }}
- name: https-internal
port: 8201
targetPort: 8201
selector:
app.kubernetes.io/name: {{ include "openbao.name" . }}
{{- if eq (.Values.server.service.instanceSelector.enabled | toString) "true" }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
component: server
openbao-active: "true"
{{- end }}
{{- end }}
{{- end }}
{{- end }}

View file

@ -0,0 +1,63 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{ template "openbao.mode" . }}
{{- if ne .mode "external" }}
{{- template "openbao.serverServiceEnabled" . -}}
{{- if .serverServiceEnabled -}}
{{- if eq .mode "ha" }}
{{- if eq (.Values.server.service.standby.enabled | toString) "true" }}
# Service for standby OpenBao pod
apiVersion: v1
kind: Service
metadata:
name: {{ template "openbao.fullname" . }}-standby
namespace: {{ include "openbao.namespace" . }}
labels:
helm.sh/chart: {{ include "openbao.chart" . }}
app.kubernetes.io/name: {{ include "openbao.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
annotations:
{{- template "openbao.service.standby.annotations" . }}
{{- template "openbao.service.annotations" . }}
spec:
{{- if .Values.server.service.type}}
type: {{ .Values.server.service.type }}
{{- end}}
{{- if (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) }}
{{- if .Values.server.service.ipFamilyPolicy }}
ipFamilyPolicy: {{ .Values.server.service.ipFamilyPolicy }}
{{- end }}
{{- if .Values.server.service.ipFamilies }}
ipFamilies: {{ .Values.server.service.ipFamilies | toYaml | nindent 2 }}
{{- end }}
{{- end }}
{{- if .Values.server.service.clusterIP }}
clusterIP: {{ .Values.server.service.clusterIP }}
{{- end }}
{{- include "service.externalTrafficPolicy" .Values.server.service }}
publishNotReadyAddresses: {{ .Values.server.service.publishNotReadyAddresses }}
ports:
- name: {{ include "openbao.scheme" . }}
port: {{ .Values.server.service.port }}
targetPort: {{ .Values.server.service.targetPort }}
{{- if and (.Values.server.service.standbyNodePort) (eq (.Values.server.service.type | toString) "NodePort") }}
nodePort: {{ .Values.server.service.standbyNodePort }}
{{- end }}
- name: https-internal
port: 8201
targetPort: 8201
selector:
app.kubernetes.io/name: {{ include "openbao.name" . }}
{{- if eq (.Values.server.service.instanceSelector.enabled | toString) "true" }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
component: server
openbao-active: "false"
{{- end }}
{{- end }}
{{- end }}
{{- end }}

View file

@ -0,0 +1,47 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{ template "openbao.mode" . }}
{{- if ne .mode "external" }}
{{- template "openbao.serverServiceEnabled" . -}}
{{- if .serverServiceEnabled -}}
# Service for OpenBao cluster
apiVersion: v1
kind: Service
metadata:
name: {{ template "openbao.fullname" . }}-internal
namespace: {{ include "openbao.namespace" . }}
labels:
helm.sh/chart: {{ include "openbao.chart" . }}
app.kubernetes.io/name: {{ include "openbao.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
openbao-internal: "true"
annotations:
{{ template "openbao.service.annotations" .}}
spec:
{{- if (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) }}
{{- if .Values.server.service.ipFamilyPolicy }}
ipFamilyPolicy: {{ .Values.server.service.ipFamilyPolicy }}
{{- end }}
{{- if .Values.server.service.ipFamilies }}
ipFamilies: {{ .Values.server.service.ipFamilies | toYaml | nindent 2 }}
{{- end }}
{{- end }}
clusterIP: None
publishNotReadyAddresses: true
ports:
- name: "{{ include "openbao.scheme" . }}"
port: {{ .Values.server.service.port }}
targetPort: {{ .Values.server.service.targetPort }}
- name: https-internal
port: 8201
targetPort: 8201
selector:
app.kubernetes.io/name: {{ include "openbao.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
component: server
{{- end }}
{{- end }}

View file

@ -0,0 +1,69 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{- if not .Values.global.openshift }}
{{ template "openbao.mode" . }}
{{- if ne .mode "external" }}
{{- if .Values.server.ingress.enabled -}}
{{- $extraPaths := .Values.server.ingress.extraPaths -}}
{{- $serviceName := include "openbao.fullname" . -}}
{{- template "openbao.serverServiceEnabled" . -}}
{{- if .serverServiceEnabled -}}
{{- if and (eq .mode "ha" ) (eq (.Values.server.ingress.activeService | toString) "true") }}
{{- $serviceName = printf "%s-%s" $serviceName "active" -}}
{{- end }}
{{- $servicePort := .Values.server.service.port -}}
{{- $pathType := .Values.server.ingress.pathType -}}
{{- $kubeVersion := .Capabilities.KubeVersion.Version }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ template "openbao.fullname" . }}
namespace: {{ include "openbao.namespace" . }}
labels:
helm.sh/chart: {{ include "openbao.chart" . }}
app.kubernetes.io/name: {{ include "openbao.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- with .Values.server.ingress.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- template "openbao.ingress.annotations" . }}
spec:
{{- if .Values.server.ingress.tls }}
tls:
{{- range .Values.server.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
{{- if .Values.server.ingress.ingressClassName }}
ingressClassName: {{ .Values.server.ingress.ingressClassName }}
{{- end }}
rules:
{{- range .Values.server.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{ if $extraPaths }}
{{ toYaml $extraPaths | indent 10 }}
{{- end }}
{{- range (.paths | default (list "/")) }}
- path: {{ . }}
pathType: {{ $pathType }}
backend:
service:
name: {{ $serviceName }}
port:
number: {{ $servicePort }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}

View file

@ -0,0 +1,24 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{- if eq (.Values.server.networkPolicy.enabled | toString) "true" }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: {{ template "openbao.fullname" . }}
labels:
app.kubernetes.io/name: {{ template "openbao.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: {{ template "openbao.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
ingress: {{- toYaml .Values.server.networkPolicy.ingress | nindent 4 }}
{{- if .Values.server.networkPolicy.egress }}
egress:
{{- toYaml .Values.server.networkPolicy.egress | nindent 4 }}
{{ end }}
{{ end }}

View file

@ -0,0 +1,25 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{ template "openbao.mode" . }}
{{- if .serverEnabled -}}
{{- if and (ne .mode "") (eq (.Values.global.psp.enable | toString) "true") }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ template "openbao.fullname" . }}-psp
namespace: {{ include "openbao.namespace" . }}
labels:
app.kubernetes.io/name: {{ include "openbao.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
rules:
- apiGroups: ['policy']
resources: ['podsecuritypolicies']
verbs: ['use']
resourceNames:
- {{ template "openbao.fullname" . }}
{{- end }}
{{- end }}

View file

@ -0,0 +1,26 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{ template "openbao.mode" . }}
{{- if .serverEnabled -}}
{{- if and (ne .mode "") (eq (.Values.global.psp.enable | toString) "true") }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ template "openbao.fullname" . }}-psp
namespace: {{ include "openbao.namespace" . }}
labels:
app.kubernetes.io/name: {{ include "openbao.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
roleRef:
kind: Role
name: {{ template "openbao.fullname" . }}-psp
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
name: {{ template "openbao.fullname" . }}
{{- end }}
{{- end }}

View file

@ -0,0 +1,54 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{ template "openbao.mode" . }}
{{- if .serverEnabled -}}
{{- if and (ne .mode "") (eq (.Values.global.psp.enable | toString) "true") }}
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: {{ template "openbao.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "openbao.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- template "openbao.psp.annotations" . }}
spec:
privileged: false
# Required to prevent escalations to root.
allowPrivilegeEscalation: false
volumes:
- configMap
- emptyDir
- projected
- secret
- downwardAPI
{{- if eq (.Values.server.dataStorage.enabled | toString) "true" }}
- persistentVolumeClaim
{{- end }}
hostNetwork: false
hostIPC: false
hostPID: false
runAsUser:
# Require the container to run without root privileges.
rule: MustRunAsNonRoot
seLinux:
# This policy assumes the nodes are using AppArmor rather than SELinux.
rule: RunAsAny
supplementalGroups:
rule: MustRunAs
ranges:
# Forbid adding the root group.
- min: 1
max: 65535
fsGroup:
rule: MustRunAs
ranges:
# Forbid adding the root group.
- min: 1
max: 65535
readOnlyRootFilesystem: false
{{- end }}
{{- end }}

View file

@ -0,0 +1,39 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{- if .Values.global.openshift }}
{{- if ne .mode "external" }}
{{- if .Values.server.route.enabled -}}
{{- $serviceName := include "openbao.fullname" . -}}
{{- if and (eq .mode "ha" ) (eq (.Values.server.route.activeService | toString) "true") }}
{{- $serviceName = printf "%s-%s" $serviceName "active" -}}
{{- end }}
kind: Route
apiVersion: route.openshift.io/v1
metadata:
name: {{ template "openbao.fullname" . }}
namespace: {{ include "openbao.namespace" . }}
labels:
helm.sh/chart: {{ include "openbao.chart" . }}
app.kubernetes.io/name: {{ include "openbao.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- with .Values.server.route.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- template "openbao.route.annotations" . }}
spec:
host: {{ .Values.server.route.host }}
to:
kind: Service
name: {{ $serviceName }}
weight: 100
port:
targetPort: 8200
tls:
{{- toYaml .Values.server.route.tls | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}

View file

@ -0,0 +1,59 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{ template "openbao.mode" . }}
{{- if ne .mode "external" }}
{{- template "openbao.serverServiceEnabled" . -}}
{{- if .serverServiceEnabled -}}
# Service for OpenBao cluster
apiVersion: v1
kind: Service
metadata:
name: {{ template "openbao.fullname" . }}
namespace: {{ include "openbao.namespace" . }}
labels:
helm.sh/chart: {{ include "openbao.chart" . }}
app.kubernetes.io/name: {{ include "openbao.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
annotations:
{{ template "openbao.service.annotations" .}}
spec:
{{- if .Values.server.service.type}}
type: {{ .Values.server.service.type }}
{{- end}}
{{- if (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) }}
{{- if .Values.server.service.ipFamilyPolicy }}
ipFamilyPolicy: {{ .Values.server.service.ipFamilyPolicy }}
{{- end }}
{{- if .Values.server.service.ipFamilies }}
ipFamilies: {{ .Values.server.service.ipFamilies | toYaml | nindent 2 }}
{{- end }}
{{- end }}
{{- if .Values.server.service.clusterIP }}
clusterIP: {{ .Values.server.service.clusterIP }}
{{- end }}
{{- include "service.externalTrafficPolicy" .Values.server.service }}
# We want the servers to become available even if they're not ready
# since this DNS is also used for join operations.
publishNotReadyAddresses: {{ .Values.server.service.publishNotReadyAddresses }}
ports:
- name: {{ include "openbao.scheme" . }}
port: {{ .Values.server.service.port }}
targetPort: {{ .Values.server.service.targetPort }}
{{- if and (.Values.server.service.nodePort) (eq (.Values.server.service.type | toString) "NodePort") }}
nodePort: {{ .Values.server.service.nodePort }}
{{- end }}
- name: https-internal
port: 8201
targetPort: 8201
selector:
app.kubernetes.io/name: {{ include "openbao.name" . }}
{{- if eq (.Values.server.service.instanceSelector.enabled | toString) "true" }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
component: server
{{- end }}
{{- end }}

View file

@ -0,0 +1,21 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{ template "openbao.serverServiceAccountSecretCreationEnabled" . }}
{{- if .serverServiceAccountSecretCreationEnabled -}}
apiVersion: v1
kind: Secret
metadata:
name: {{ template "openbao.serviceAccount.name" . }}-token
namespace: {{ include "openbao.namespace" . }}
annotations:
kubernetes.io/service-account.name: {{ template "openbao.serviceAccount.name" . }}
labels:
helm.sh/chart: {{ include "openbao.chart" . }}
app.kubernetes.io/name: {{ include "openbao.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
type: kubernetes.io/service-account-token
{{ end }}

View file

@ -0,0 +1,22 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{ template "openbao.serverServiceAccountEnabled" . }}
{{- if .serverServiceAccountEnabled -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "openbao.serviceAccount.name" . }}
namespace: {{ include "openbao.namespace" . }}
labels:
helm.sh/chart: {{ include "openbao.chart" . }}
app.kubernetes.io/name: {{ include "openbao.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- if .Values.server.serviceAccount.extraLabels -}}
{{- toYaml .Values.server.serviceAccount.extraLabels | nindent 4 -}}
{{- end -}}
{{ template "openbao.serviceAccount.annotations" . }}
{{ end }}

View file

@ -0,0 +1,228 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{ template "openbao.mode" . }}
{{- if ne .mode "external" }}
{{- if ne .mode "" }}
{{- if .serverEnabled -}}
# StatefulSet to run the actual openbao server cluster.
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ template "openbao.fullname" . }}
namespace: {{ include "openbao.namespace" . }}
labels:
app.kubernetes.io/name: {{ include "openbao.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- template "openbao.statefulSet.annotations" . }}
spec:
serviceName: {{ template "openbao.fullname" . }}-internal
podManagementPolicy: Parallel
replicas: {{ template "openbao.replicas" . }}
updateStrategy:
type: {{ .Values.server.updateStrategyType }}
{{- if and (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) (.Values.server.persistentVolumeClaimRetentionPolicy) }}
persistentVolumeClaimRetentionPolicy: {{ toYaml .Values.server.persistentVolumeClaimRetentionPolicy | nindent 4 }}
{{- end }}
selector:
matchLabels:
app.kubernetes.io/name: {{ template "openbao.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
component: server
template:
metadata:
labels:
helm.sh/chart: {{ template "openbao.chart" . }}
app.kubernetes.io/name: {{ template "openbao.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
component: server
{{- if .Values.server.extraLabels -}}
{{- toYaml .Values.server.extraLabels | nindent 8 -}}
{{- end -}}
{{ template "openbao.annotations" . }}
spec:
{{ template "openbao.affinity" . }}
{{ template "openbao.topologySpreadConstraints" . }}
{{ template "openbao.tolerations" . }}
{{ template "openbao.nodeselector" . }}
{{- if .Values.server.priorityClassName }}
priorityClassName: {{ .Values.server.priorityClassName }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.server.terminationGracePeriodSeconds }}
serviceAccountName: {{ template "openbao.serviceAccount.name" . }}
{{ if .Values.server.shareProcessNamespace }}
shareProcessNamespace: true
{{ end }}
{{- template "server.statefulSet.securityContext.pod" . }}
{{- if not .Values.global.openshift }}
hostNetwork: {{ .Values.server.hostNetwork }}
{{- end }}
volumes:
{{ template "openbao.volumes" . }}
- name: home
emptyDir: {}
{{- if .Values.server.hostAliases }}
hostAliases:
{{ toYaml .Values.server.hostAliases | nindent 8}}
{{- end }}
{{- if .Values.server.extraInitContainers }}
initContainers:
{{ toYaml .Values.server.extraInitContainers | nindent 8}}
{{- end }}
containers:
- name: openbao
{{ template "openbao.resources" . }}
image: {{ .Values.server.image.registry | default "docker.io" }}/{{ .Values.server.image.repository }}:{{ .Values.server.image.tag | default "latest" }}
imagePullPolicy: {{ .Values.server.image.pullPolicy }}
command:
- "/bin/sh"
- "-ec"
args: {{ template "openbao.args" . }}
{{- template "server.statefulSet.securityContext.container" . }}
env:
- name: HOST_IP
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: BAO_K8S_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: BAO_K8S_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: BAO_ADDR
value: "{{ include "openbao.scheme" . }}://127.0.0.1:8200"
- name: BAO_API_ADDR
{{- if .Values.server.ha.apiAddr }}
value: {{ .Values.server.ha.apiAddr }}
{{- else }}
value: "{{ include "openbao.scheme" . }}://$(POD_IP):8200"
{{- end }}
- name: SKIP_CHOWN
value: "true"
- name: SKIP_SETCAP
value: "true"
- name: HOSTNAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: BAO_CLUSTER_ADDR
{{- if .Values.server.ha.clusterAddr }}
value: {{ .Values.server.ha.clusterAddr | quote }}
{{- else }}
value: "https://$(HOSTNAME).{{ template "openbao.fullname" . }}-internal:8201"
{{- end }}
{{- if and (eq (.Values.server.ha.raft.enabled | toString) "true") (eq (.Values.server.ha.raft.setNodeId | toString) "true") }}
- name: BAO_RAFT_NODE_ID
valueFrom:
fieldRef:
fieldPath: metadata.name
{{- end }}
- name: HOME
value: "/home/openbao"
{{- if .Values.server.logLevel }}
- name: BAO_LOG_LEVEL
value: "{{ .Values.server.logLevel }}"
{{- end }}
{{- if .Values.server.logFormat }}
- name: BAO_LOG_FORMAT
value: "{{ .Values.server.logFormat }}"
{{- end }}
{{ template "openbao.envs" . }}
{{- include "openbao.extraEnvironmentVars" .Values.server | nindent 12 }}
{{- include "openbao.extraSecretEnvironmentVars" .Values.server | nindent 12 }}
volumeMounts:
{{ template "openbao.mounts" . }}
- name: home
mountPath: /home/openbao
ports:
- containerPort: 8200
name: {{ include "openbao.scheme" . }}
- containerPort: 8201
name: https-internal
- containerPort: 8202
name: {{ include "openbao.scheme" . }}-rep
{{- if .Values.server.extraPorts -}}
{{ toYaml .Values.server.extraPorts | nindent 12}}
{{- end }}
{{- if .Values.server.readinessProbe.enabled }}
readinessProbe:
{{- if .Values.server.readinessProbe.path }}
httpGet:
path: {{ .Values.server.readinessProbe.path | quote }}
port: {{ .Values.server.readinessProbe.port }}
scheme: {{ include "openbao.scheme" . | upper }}
{{- else }}
# Check status; unsealed openbao servers return 0
# The exit code reflects the seal status:
# 0 - unsealed
# 1 - error
# 2 - sealed
exec:
command: ["/bin/sh", "-ec", "bao status -tls-skip-verify"]
{{- end }}
failureThreshold: {{ .Values.server.readinessProbe.failureThreshold }}
initialDelaySeconds: {{ .Values.server.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.server.readinessProbe.periodSeconds }}
successThreshold: {{ .Values.server.readinessProbe.successThreshold }}
timeoutSeconds: {{ .Values.server.readinessProbe.timeoutSeconds }}
{{- end }}
{{- if .Values.server.livenessProbe.enabled }}
livenessProbe:
{{- if .Values.server.livenessProbe.execCommand }}
exec:
command:
{{- range (.Values.server.livenessProbe.execCommand) }}
- {{ . | quote }}
{{- end }}
{{- else }}
httpGet:
path: {{ .Values.server.livenessProbe.path | quote }}
port: {{ .Values.server.livenessProbe.port }}
scheme: {{ include "openbao.scheme" . | upper }}
{{- end }}
failureThreshold: {{ .Values.server.livenessProbe.failureThreshold }}
initialDelaySeconds: {{ .Values.server.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.server.livenessProbe.periodSeconds }}
successThreshold: {{ .Values.server.livenessProbe.successThreshold }}
timeoutSeconds: {{ .Values.server.livenessProbe.timeoutSeconds }}
{{- end }}
lifecycle:
# openbao container doesn't receive SIGTERM from Kubernetes
# and after the grace period ends, Kube sends SIGKILL. This
# causes issues with graceful shutdowns such as deregistering itself
# from Consul (zombie services).
preStop:
exec:
command: [
"/bin/sh", "-c",
# Adding a sleep here to give the pod eviction a
# chance to propagate, so requests will not be made
# to this pod while it's terminating
"sleep {{ .Values.server.preStopSleepSeconds }} && kill -SIGTERM $(pidof bao)",
]
{{- if .Values.server.postStart }}
postStart:
exec:
command:
{{- range (.Values.server.postStart) }}
- {{ . | quote }}
{{- end }}
{{- end }}
{{- if .Values.server.extraContainers }}
{{ toYaml .Values.server.extraContainers | nindent 8}}
{{- end }}
{{- include "imagePullSecrets" . | nindent 6 }}
{{ template "openbao.volumeclaims" . }}
{{ end }}
{{ end }}
{{ end }}

View file

@ -0,0 +1,56 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{ template "openbao.mode" . }}
{{- if ne .mode "external" }}
{{- if .serverEnabled -}}
apiVersion: v1
kind: Pod
metadata:
name: {{ template "openbao.fullname" . }}-server-test
namespace: {{ include "openbao.namespace" . }}
annotations:
"helm.sh/hook": test
spec:
{{- include "imagePullSecrets" . | nindent 2 }}
containers:
- name: {{ .Release.Name }}-server-test
image: {{ .Values.server.image.registry | default "docker.io" }}/{{ .Values.server.image.repository }}:{{ .Values.server.image.tag | default "latest" }}
imagePullPolicy: {{ .Values.server.image.pullPolicy }}
env:
- name: VAULT_ADDR
value: {{ include "openbao.scheme" . }}://{{ template "openbao.fullname" . }}.{{ include "openbao.namespace" . }}.svc:{{ .Values.server.service.port }}
{{- include "openbao.extraEnvironmentVars" .Values.server | nindent 8 }}
command:
- /bin/sh
- -c
- |
echo "Checking for sealed info in 'bao status' output"
ATTEMPTS=10
n=0
until [ "$n" -ge $ATTEMPTS ]
do
echo "Attempt" $n...
bao status -format yaml | grep -E '^sealed: (true|false)' && break
n=$((n+1))
sleep 5
done
if [ $n -ge $ATTEMPTS ]; then
echo "timed out looking for sealed info in 'bao status' output"
exit 1
fi
exit 0
volumeMounts:
{{- if .Values.server.volumeMounts }}
{{- toYaml .Values.server.volumeMounts | nindent 8}}
{{- end }}
volumes:
{{- if .Values.server.volumes }}
{{- toYaml .Values.server.volumes | nindent 4}}
{{- end }}
restartPolicy: Never
{{- end }}
{{- end }}

View file

@ -0,0 +1,50 @@
{{/*
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
*/}}
{{ template "openbao.mode" . }}
{{- if ne .mode "external" }}
{{- template "openbao.uiEnabled" . -}}
{{- if .uiEnabled -}}
apiVersion: v1
kind: Service
metadata:
name: {{ template "openbao.fullname" . }}-ui
namespace: {{ include "openbao.namespace" . }}
labels:
helm.sh/chart: {{ include "openbao.chart" . }}
app.kubernetes.io/name: {{ include "openbao.name" . }}-ui
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- template "openbao.ui.annotations" . }}
spec:
{{- if (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) }}
{{- if .Values.ui.serviceIPFamilyPolicy }}
ipFamilyPolicy: {{ .Values.ui.serviceIPFamilyPolicy }}
{{- end }}
{{- if .Values.ui.serviceIPFamilies }}
ipFamilies: {{ .Values.ui.serviceIPFamilies | toYaml | nindent 2 }}
{{- end }}
{{- end }}
selector:
app.kubernetes.io/name: {{ include "openbao.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
component: server
{{- if and (.Values.ui.activeOpenbaoPodOnly) (eq .mode "ha") }}
openbao-active: "true"
{{- end }}
publishNotReadyAddresses: {{ .Values.ui.publishNotReadyAddresses }}
ports:
- name: {{ include "openbao.scheme" . }}
port: {{ .Values.ui.externalPort }}
targetPort: {{ .Values.ui.targetPort }}
{{- if .Values.ui.serviceNodePort }}
nodePort: {{ .Values.ui.serviceNodePort }}
{{- end }}
type: {{ .Values.ui.serviceType }}
{{- include "service.externalTrafficPolicy" .Values.ui }}
{{- include "service.loadBalancer" .Values.ui }}
{{- end -}}
{{- end }}

View file

@ -0,0 +1,26 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
# These overrides are appropriate defaults for deploying this chart on OpenShift
global:
openshift: true
injector:
image:
repository: "registry.connect.redhat.com/hashicorp/vault-k8s"
tag: "1.3.1-ubi"
agentImage:
registry: "quay.io"
repository: "openbao/openbao"
tag: "v2.0.2-ubi"
server:
image:
registry: "quay.io"
repository: "openbao/openbao"
tag: "v2.0.2-ubi"
readinessProbe:
path: "/v1/sys/health?uninitcode=204"

File diff suppressed because it is too large Load diff

1335
charts/openbao/values.yaml Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,44 +0,0 @@
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to
this (by the DNS naming spec). If release name contains chart name it will
be used as a full name.
*/}}
{{- define "vault.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "vault.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Expand the name of the chart.
*/}}
{{- define "vault.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Compute the maximum number of unavailable replicas for the PodDisruptionBudget.
This defaults to (n/2)-1 where n is the number of members of the server cluster.
*/}}
{{- define "vault.pdb.maxUnavailable" -}}
{{- if .Values.server.disruptionBudget.maxUnavailable -}}
{{ .Values.server.disruptionBudget.maxUnavailable -}}
{{- else -}}
{{- ceil (sub (div (int .Values.server.replicas) 2) 1) -}}
{{- end -}}
{{- end -}}

View file

@ -1,27 +0,0 @@
# Service for Vault DNS.
## TODO: verify for Vault
#{{- if (or (and (ne (.Values.dns.enabled | toString) "-") .Values.dns.enabled) (and (eq (.Values.dns.enabled | toString) "-") .Values.global.enabled)) }}
#apiVersion: v1
#kind: Service
#metadata:
# name: {{ template "vault.fullname" . }}-dns
# labels:
# app: {{ template "vault.name" . }}
# chart: {{ template "vault.chart" . }}
# heritage: {{ .Release.Service }}
# release: {{ .Release.Name }}
#spec:
# ports:
# - name: dns-tcp
# port: 53
# protocol: "TCP"
# targetPort: dns-tcp
# - name: dns-udp
# port: 53
# protocol: "UDP"
# targetPort: dns-udp
# selector:
# app: {{ template "vault.name" . }}
# release: "{{ .Release.Name }}"
# hasDNS: "true"
#{{- end }}

View file

@ -1,15 +0,0 @@
# StatefulSet to run the actual vault server cluster.
{{- if (or (and (ne (.Values.server.enabled | toString) "-") .Values.server.enabled) (and (eq (.Values.server.enabled | toString) "-") .Values.global.enabled)) }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "vault.fullname" . }}-server-config
labels:
app: {{ template "vault.name" . }}
chart: {{ template "vault.chart" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
data:
extra-from-values.hcl: |-
{{ tpl .Values.server.extraConfig . | indent 4 }}
{{- end }}

View file

@ -1,35 +0,0 @@
# Headless service for Vault server DNS entries. This service should only
# point to Vault servers. For access to an agent, one should assume that
# the agent is installed locally on the node and the NODE_IP should be used.
# If the node can't run a Vault agent, then this service can be used to
# communicate directly to a server agent.
# TODO: verify for Vault
{{- if (or (and (ne (.Values.server.enabled | toString) "-") .Values.server.enabled) (and (eq (.Values.server.enabled | toString) "-") .Values.global.enabled)) }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "vault.fullname" . }}-server
labels:
app: {{ template "vault.name" . }}
chart: {{ template "vault.chart" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
annotations:
# This must be set in addition to publishNotReadyAddresses due
# to an open issue where it may not work:
# https://github.com/kubernetes/kubernetes/issues/58662
service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
spec:
clusterIP: None
# We want the servers to become available even if they're not ready
# since this DNS is also used for join operations.
publishNotReadyAddresses: true
ports:
- name: http
port: 8200
targetPort: 8200
selector:
app: {{ template "vault.name" . }}
release: "{{ .Release.Name }}"
component: server
{{- end }}

View file

@ -1,123 +0,0 @@
# StatefulSet to run the actual vault server cluster.
{{- if (or (and (ne (.Values.server.enabled | toString) "-") .Values.server.enabled) (and (eq (.Values.server.enabled | toString) "-") .Values.global.enabled)) }}
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ template "vault.fullname" . }}-server
labels:
app: {{ template "vault.name" . }}
chart: {{ template "vault.chart" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
spec:
serviceName: {{ template "vault.fullname" . }}-server
podManagementPolicy: Parallel
replicas: {{ .Values.server.replicas }}
selector:
matchLabels:
app: {{ template "vault.name" . }}
chart: {{ template "vault.chart" . }}
release: {{ .Release.Name }}
component: server
template:
metadata:
labels:
app: {{ template "vault.name" . }}
chart: {{ template "vault.chart" . }}
release: {{ .Release.Name }}
component: server
spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
app: {{ template "vault.name" . }}
release: "{{ .Release.Name }}"
component: server
topologyKey: kubernetes.io/hostname
terminationGracePeriodSeconds: 10
securityContext:
fsGroup: 1000
volumes:
- name: config
configMap:
name: {{ template "vault.fullname" . }}-server-config
{{- range .Values.server.extraVolumes }}
- name: userconfig-{{ .name }}
{{ .type }}:
{{- if (eq .type "configMap") }}
name: {{ .name }}
{{- else if (eq .type "secret") }}
secretName: {{ .name }}
{{- end }}
{{- end }}
containers:
- name: vault
securityContext:
fsGroup: 1000
# TODO: confirm Vault needs this
privileged: true
image: "{{ default .Values.global.image .Values.server.image }}"
env:
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: VAULT_ADDR
value: "http://localhost:8200"
command:
- "vault"
- "server"
- "-config=/vault/config/"
volumeMounts:
- name: data
mountPath: /vault/data
- name: config
mountPath: /vault/config
{{- range .Values.server.extraVolumes }}
- name: userconfig-{{ .name }}
readOnly: true
mountPath: /vault/userconfig/{{ .name }}
{{- end }}
lifecycle:
preStop:
exec:
command:
- vault step-down
ports:
- containerPort: 8200
name: http
#readinessProbe:
# # NOTE(mitchellh): when our HTTP status endpoints support the
# # proper status codes, we should switch to that. This is temporary.
# # TODO: verify for Vault
# #exec:
# # command:
# # - "/bin/sh"
# # - "-ec"
# # - |
# # curl http://127.0.0.1:8500/v1/status/leader 2>/dev/null | \
# # grep -E '".+"'
# failureThreshold: 2
# initialDelaySeconds: 5
# periodSeconds: 3
# successThreshold: 1
# timeoutSeconds: 5
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.server.storage }}
{{- if .Values.server.storageClass }}
storageClassName: {{ .Values.server.storageClass }}
{{- end }}
{{- end }}

View file

@ -1,29 +0,0 @@
# Headless service for Vault server DNS entries. This service should only
# point to Vault servers. For access to an agent, one should assume that
# the agent is installed locally on the node and the NODE_IP should be used.
# If the node can't run a Vault agent, then this service can be used to
# communicate directly to a server agent.
{{- if (and (or (and (ne (.Values.server.enabled | toString) "-") .Values.server.enabled) (and (eq (.Values.server.enabled | toString) "-") .Values.global.enabled)) (or (and (ne (.Values.ui.enabled | toString) "-") .Values.ui.enabled) (and (eq (.Values.ui.enabled | toString) "-") .Values.global.enabled)) (or (and (ne (.Values.ui.service.enabled | toString) "-") .Values.ui.service.enabled) (and (eq (.Values.ui.service.enabled | toString) "-") .Values.global.enabled))) }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "vault.fullname" . }}-ui
labels:
app: {{ template "vault.name" . }}
chart: {{ template "vault.chart" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
spec:
selector:
app: {{ template "vault.name" . }}
release: "{{ .Release.Name }}"
component: server
type: LoadBalancer
ports:
- name: http
port: 80
targetPort: 8200
{{- if .Values.ui.service.type }}
type: {{ .Values.ui.service.type }}
{{- end }}
{{- end }}

53
test/README.md Normal file
View file

@ -0,0 +1,53 @@
# OpenBao Helm Tests
## Running OpenBao Helm Acceptance tests
The Makefile at the top level of this repo contains a few target that should help with running acceptance tests in your own GKE instance or in a kind cluster.
### Running in a GKE cluster
* Set the `GOOGLE_CREDENTIALS` and `CLOUDSDK_CORE_PROJECT` variables at the top of the file. `GOOGLE_CREDENTIALS` should contain the local path to your Google Cloud Platform account credentials in JSON format. `CLOUDSDK_CORE_PROJECT` should be set to the ID of your GCP project.
* Run `make test-image` to create the docker image (with dependencies installed) that will be re-used in the below steps.
* Run `make test-provision` to provision the GKE cluster using terraform.
* Run `make test-acceptance` to run the acceptance tests in this already provisioned cluster.
* You can choose to only run certain tests by setting the ACCEPTANCE_TESTS variable and re-running the above target.
* Run `make test-destroy` when you have finished testing and want to tear-down and remove the cluster.
### Running in a kind cluster
* Run `make test-acceptance LOCAL_ACCEPTANCE_TESTS=true`
* You can choose to only run certain tests by setting the `ACCEPTANCE_TESTS` variable and re-running the above target.
* Run `make delete-kind` when you have finished testing and want to tear-down and remove the cluster.
* You can set an alternate kind cluster name by specifying the `KIND_CLUSTER_NAME` variable for any of the above targets.
* You can set an alternate K8S version by specifying the `KIND_K8S_VERSION` variable for any of the above targets.
See [kind-quick-start](https://kind.sigs.k8s.io/docs/user/quick-start/) if you don't have kind installed on your system.
## Running chart verification tests
If [chart-verifier](https://github.com/redhat-certification/chart-verifier) is built and available in your PATH, run:
bats test/chart/verifier.bats
Or if you'd rather use the latest chart-verifier docker container, set
USE_DOCKER:
USE_DOCKER=true bats test/chart/verifier.bats
## Generating the values json schema
There is a make target for generating values.schema.json:
make values-schema
It relies on the helm [schema-gen plugin][schema-gen]. Note that some manual
editing will be required, since several properties accept multiple data types.
[schema-gen]: https://github.com/karuppiah7890/helm-schema-gen
## Helm test
OpenBao Helm also contains a simple helm test under
[templates/tests/](../templates/tests/) that may be run against a helm release:
helm test <RELEASE_NAME>

View file

@ -1,9 +1,17 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
# name_prefix returns the prefix of the resources within Kubernetes.
name_prefix() {
printf "consul"
printf "openbao"
}
# helm_install installs the Consul chart. This will source overridable
# chart_dir returns the directory for the chart
chart_dir() {
echo ${BATS_TEST_DIRNAME}/../../charts/openbao
}
# helm_install installs the openbao chart. This will source overridable
# values from the "values.yaml" file in this directory. This can be set
# by CI or other environments to do test-specific overrides. Note that its
# easily possible to break tests this way so be careful.
@ -14,18 +22,88 @@ helm_install() {
fi
helm install -f ${values} \
--name consul \
--wait \
${BATS_TEST_DIRNAME}/../..
--name openbao \
${BATS_TEST_DIRNAME}/../../charts/openbao
}
# helm_delete deletes the Consul chart and all resources.
helm_delete() {
helm delete --purge consul
kubectl delete --all pvc
# helm_install_ha installs the openbao chart using HA mode. This will source
# overridable values from the "values.yaml" file in this directory. This can be
# set by CI or other environments to do test-specific overrides. Note that its
# easily possible to break tests this way so be careful.
helm_install_ha() {
local values="${BATS_TEST_DIRNAME}/values.yaml"
if [ ! -f "${values}" ]; then
touch $values
fi
helm install -f ${values} \
--name openbao \
--set 'server.enabled=false' \
--set 'serverHA.enabled=true' \
${BATS_TEST_DIRNAME}/../../charts/openbao
}
# wait for consul to be ready
wait_for_running_consul() {
kubectl wait --for=condition=Ready --timeout=5m pod -l app=consul,component=client
}
wait_for_sealed_vault() {
POD_NAME=$1
check() {
sealed_status=$(kubectl exec $1 -- bao status -format=json | jq -r '.sealed')
if [ "$sealed_status" == "true" ]; then
return 0
fi
return 1
}
for i in $(seq 60); do
if check ${POD_NAME}; then
echo "OpenBao on ${POD_NAME} is running."
return
fi
echo "Waiting for OpenBao on ${POD_NAME} to be running..."
sleep 2
done
echo "OpenBao on ${POD_NAME} never became running."
return 1
}
# wait for a pod to be running
wait_for_running() {
POD_NAME=$1
check() {
# This requests the pod and checks whether the status is running
# and the ready state is true. If so, it outputs the name. Otherwise
# it outputs empty. Therefore, to check for success, check for nonzero
# string length.
kubectl get pods $1 -o json | \
jq -r 'select(
.status.phase == "Running" and
([ .status.conditions[] | select(.type == "Ready" and .status == "False") ] | length) == 1
) | .metadata.namespace + "/" + .metadata.name'
}
for i in $(seq 60); do
if [ -n "$(check ${POD_NAME})" ]; then
echo "${POD_NAME} is ready."
sleep 5
return
fi
echo "Waiting for ${POD_NAME} to be ready..."
sleep 2
done
echo "${POD_NAME} never became ready."
return 1
}
# wait for a pod to be ready
wait_for_ready() {
POD_NAME=$1
@ -41,9 +119,10 @@ wait_for_ready() {
) | .metadata.namespace + "/" + .metadata.name'
}
for i in $(seq 30); do
for i in $(seq 60); do
if [ -n "$(check ${POD_NAME})" ]; then
echo "${POD_NAME} is ready."
sleep 5
return
fi
@ -52,5 +131,34 @@ wait_for_ready() {
done
echo "${POD_NAME} never became ready."
exit 1
return 1
}
wait_for_complete_job() {
POD_NAME=$1
check() {
# This requests the pod and checks whether the status is running
# and the ready state is true. If so, it outputs the name. Otherwise
# it outputs empty. Therefore, to check for success, check for nonzero
# string length.
kubectl get job $1 -o json | \
jq -r 'select(
.status.succeeded == 1
) | .metadata.namespace + "/" + .metadata.name'
}
for i in $(seq 60); do
if [ -n "$(check ${POD_NAME})" ]; then
echo "${POD_NAME} is complete."
sleep 5
return
fi
echo "Waiting for ${POD_NAME} to be complete..."
sleep 2
done
echo "${POD_NAME} never completed."
return 1
}

View file

@ -0,0 +1,30 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: nginx
---
kind: Pod
apiVersion: v1
metadata:
name: nginx
spec:
terminationGracePeriodSeconds: 0
serviceAccountName: nginx
containers:
- image: docker.mirror.hashicorp.services/nginx
name: nginx
volumeMounts:
- name: secrets-store-inline
mountPath: "/mnt/secrets-store"
readOnly: true
volumes:
- name: secrets-store-inline
csi:
driver: secrets-store.csi.k8s.io
readOnly: true
volumeAttributes:
secretProviderClass: "vault-kv"

View file

@ -0,0 +1,16 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
# The "Hello World" OpenBao SecretProviderClass
apiVersion: secrets-store.csi.x-k8s.io/v1
kind: SecretProviderClass
metadata:
name: vault-kv
spec:
provider: vault
parameters:
roleName: "kv-role"
objects: |
- objectName: "bar"
secretPath: "secret/data/kv1"
secretKey: "bar1"

View file

@ -0,0 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
path "secret/data/kv1" {
capabilities = ["read"]
}

83
test/acceptance/csi.bats Normal file
View file

@ -0,0 +1,83 @@
#!/usr/bin/env bats
load _helpers
@test "csi: testing deployment" {
cd `chart_dir`
kubectl delete namespace acceptance --ignore-not-found=true
kubectl create namespace acceptance
# Install Secrets Store CSI driver
# Configure it to pass in a JWT for the provider to use, and rotate secrets rapidly
# so we can see Agent's cache working.
CSI_DRIVER_VERSION=1.3.2
helm install secrets-store-csi-driver secrets-store-csi-driver \
--repo https://kubernetes-sigs.github.io/secrets-store-csi-driver/charts \
--version=$CSI_DRIVER_VERSION \
--wait --timeout=5m \
--namespace=acceptance \
--set linux.image.pullPolicy="IfNotPresent" \
--set tokenRequests[0].audience="openbao" \
--set enableSecretRotation=true \
--set rotationPollInterval=5s
# Install OpenBao and OpenBao provider
helm install openbao \
--wait --timeout=5m \
--namespace=acceptance \
--set="server.dev.enabled=true" \
--set="csi.enabled=true" \
--set="csi.debug=true" \
--set="csi.agent.logLevel=debug" \
--set="injector.enabled=false" \
.
kubectl --namespace=acceptance wait --for=condition=Ready --timeout=5m pod -l app.kubernetes.io/name=openbao
kubectl --namespace=acceptance wait --for=condition=Ready --timeout=5m pod -l app.kubernetes.io/name=openbao-csi-provider
# Set up k8s auth and a kv secret.
cat ../../test/acceptance/csi-test/openbao-policy.hcl | kubectl --namespace=acceptance exec -i openbao-0 -- bao policy write kv-policy -
kubectl --namespace=acceptance exec openbao-0 -- bao auth enable kubernetes
kubectl --namespace=acceptance exec openbao-0 -- sh -c 'bao write auth/kubernetes/config \
kubernetes_host="https://$KUBERNETES_PORT_443_TCP_ADDR:443"'
kubectl --namespace=acceptance exec openbao-0 -- bao write auth/kubernetes/role/kv-role \
bound_service_account_names=nginx \
bound_service_account_namespaces=acceptance \
policies=kv-policy \
ttl=20m
kubectl --namespace=acceptance exec openbao-0 -- bao kv put secret/kv1 bar1=hello1
kubectl --namespace=acceptance apply -f ../../test/acceptance/csi-test/openbao-kv-secretproviderclass.yaml
kubectl --namespace=acceptance apply -f ../../test/acceptance/csi-test/nginx.yaml
kubectl --namespace=acceptance wait --for=condition=Ready --timeout=5m pod nginx
result=$(kubectl --namespace=acceptance exec nginx -- cat /mnt/secrets-store/bar)
[[ "$result" == "hello1" ]]
for i in $(seq 10); do
sleep 2
if [ "$(kubectl --namespace=acceptance logs --tail=-1 -l "app.kubernetes.io/name=openbao-csi-provider" -c openbao-agent | grep "secret renewed: path=/v1/auth/kubernetes/login")" ]; then
echo "Agent returned a cached login response"
return
fi
echo "Waiting to confirm the Agent is renewing CSI's auth token..."
done
# Print the logs and fail the test
echo "Failed to find a log for the Agent renewing CSI's auth token"
kubectl --namespace=acceptance logs --tail=-1 -l "app.kubernetes.io/name=openbao-csi-provider" -c openbao-agent
kubectl --namespace=acceptance logs --tail=-1 -l "app.kubernetes.io/name=openbao-csi-provider" -c openbao-csi-provider
exit 1
}
# Clean up
teardown() {
if [[ ${CLEANUP:-true} == "true" ]]
then
echo "helm/pvc teardown"
helm --namespace=acceptance delete openbao
helm --namespace=acceptance delete secrets-store-csi-driver
kubectl delete --all pvc
kubectl delete namespace acceptance
fi
}

View file

@ -0,0 +1,27 @@
#!/usr/bin/env bats
load _helpers
@test "helm/test: running helm test" {
cd `chart_dir`
kubectl delete namespace acceptance --ignore-not-found=true
kubectl create namespace acceptance
kubectl config set-context --current --namespace=acceptance
helm install "$(name_prefix)" .
wait_for_running $(name_prefix)-0
helm test "$(name_prefix)"
}
# Clean up
teardown() {
if [[ ${CLEANUP:-true} == "true" ]]
then
echo "helm/pvc teardown"
helm delete openbao
kubectl delete --all pvc
kubectl delete namespace acceptance --ignore-not-found=true
fi
}

View file

@ -0,0 +1,52 @@
#!/usr/bin/env bats
load _helpers
@test "injector: testing leader elector" {
cd `chart_dir`
kubectl delete namespace acceptance --ignore-not-found=true
kubectl create namespace acceptance
kubectl config set-context --current --namespace=acceptance
helm install "$(name_prefix)" \
--wait \
--timeout=5m \
--set="injector.replicas=3" .
kubectl wait --for condition=Ready pod -l app.kubernetes.io/name=openbao-agent-injector --timeout=5m
pods=($(kubectl get pods -l app.kubernetes.io/name=openbao-agent-injector -o json | jq -r '.items[] | .metadata.name'))
[ "${#pods[@]}" == 3 ]
leader=''
tries=0
until [ $tries -ge 60 ]
do
owner=$(kubectl get configmaps vault-k8s-leader -o json | jq -r .metadata.ownerReferences\[0\].name)
leader=$(kubectl get pods $owner -o json | jq -r .metadata.name)
[ -n "${leader}" ] && [ "${leader}" != "null" ] && break
((++tries))
sleep .5
done
# Check the leader name is valid - i.e. one of the 3 pods
[[ " ${pods[@]} " =~ " ${leader} " ]]
}
setup() {
kubectl delete namespace acceptance --ignore-not-found=true
kubectl create namespace acceptance
kubectl config set-context --current --namespace=acceptance
}
# Clean up
teardown() {
if [[ ${CLEANUP:-true} == "true" ]]
then
echo "helm/pvc teardown"
helm delete openbao
kubectl delete --all pvc
kubectl delete namespace acceptance
fi
}

View file

@ -0,0 +1,49 @@
#!/bin/sh
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
OUTPUT=/tmp/output.txt
bao operator init -n 1 -t 1 >> ${OUTPUT?}
unseal=$(cat ${OUTPUT?} | grep "Unseal Key 1:" | sed -e "s/Unseal Key 1: //g")
root=$(cat ${OUTPUT?} | grep "Initial Root Token:" | sed -e "s/Initial Root Token: //g")
bao operator unseal ${unseal?}
bao login -no-print ${root?}
bao policy write db-backup /openbao/userconfig/test/pgdump-policy.hcl
bao auth enable kubernetes
bao write auth/kubernetes/config \
token_reviewer_jwt="$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" \
kubernetes_host=https://${KUBERNETES_PORT_443_TCP_ADDR}:443 \
kubernetes_ca_cert=@/var/run/secrets/kubernetes.io/serviceaccount/ca.crt
bao write auth/kubernetes/role/db-backup \
bound_service_account_names=pgdump \
bound_service_account_namespaces=acceptance \
policies=db-backup \
ttl=1h
bao secrets enable database
bao write database/config/postgresql \
plugin_name=postgresql-database-plugin \
allowed_roles="db-backup" \
connection_url="postgresql://{{username}}:{{password}}@postgres:5432/mydb?sslmode=disable" \
username="openbao" \
password="openbao"
bao write database/roles/db-backup \
db_name=postgresql \
creation_statements="CREATE ROLE \"{{name}}\" WITH LOGIN PASSWORD '{{password}}' VALID UNTIL '{{expiration}}'; \
GRANT CONNECT ON DATABASE mydb TO \"{{name}}\"; \
GRANT USAGE ON SCHEMA app TO \"{{name}}\"; \
GRANT SELECT ON ALL TABLES IN SCHEMA app TO \"{{name}}\";" \
revocation_statements="ALTER ROLE \"{{name}}\" NOLOGIN;"\
default_ttl="1h" \
max_ttl="24h"

View file

@ -0,0 +1,42 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: pgdump
labels:
app: pgdump
---
apiVersion: batch/v1
kind: Job
metadata:
name: pgdump
spec:
backoffLimit: 0
template:
metadata:
name: pgdump
labels:
app: pgdump
annotations:
vault.hashicorp.com/agent-inject: "true"
vault.hashicorp.com/agent-inject-secret-db-creds: "database/creds/db-backup"
vault.hashicorp.com/agent-inject-template-db-creds: |
{{- with secret "database/creds/db-backup" -}}
postgresql://{{ .Data.username }}:{{ .Data.password }}@postgres.acceptance.svc.cluster.local:5432/mydb
{{- end }}
vault.hashicorp.com/role: "db-backup"
vault.hashicorp.com/agent-pre-populate-only: "true"
spec:
serviceAccountName: pgdump
containers:
- name: pgdump
image: postgres:11.5
command:
- "/bin/sh"
- "-ec"
args:
- "/usr/bin/pg_dump $(cat /vault/secrets/db-creds) --no-owner > /dev/stdout"
restartPolicy: Never

View file

@ -0,0 +1,72 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
---
apiVersion: v1
kind: Service
metadata:
name: postgres
labels:
app: postgres
spec:
type: ClusterIP
ports:
- port: 5432
targetPort: 5432
selector:
app: postgres
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres
spec:
replicas: 1
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
service: postgres
app: postgres
spec:
containers:
- name: postgres
image: postgres:11.5
ports:
- containerPort: 5432
env:
- name: POSTGRES_DB
value: mydb
- name: POSTGRES_USER
value: postgres
- name: POSTGRES_PASSWORD
value: password
volumeMounts:
- mountPath: "/var/lib/postgresql"
name: "pgdata"
- mountPath: "/docker-entrypoint-initdb.d"
name: "pgconf"
volumes:
- name: pgdata
emptyDir: {}
- name: pgconf
configMap:
name: "pg-init"
---
apiVersion: v1
kind: ConfigMap
metadata:
name: pg-init
labels:
app: postgres
data:
setup.sql: |
CREATE ROLE openbao;
ALTER ROLE openbao WITH SUPERUSER LOGIN PASSWORD 'openbao';
\c mydb
CREATE SCHEMA app;
CREATE TABLE app.inventory(id int);
INSERT INTO app.inventory(id) VALUES (0);

View file

@ -0,0 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
path "database/creds/db-backup" {
capabilities = ["read"]
}

View file

@ -0,0 +1,58 @@
#!/usr/bin/env bats
load _helpers
@test "injector: testing deployment" {
cd `chart_dir`
kubectl delete namespace acceptance --ignore-not-found=true
kubectl create namespace acceptance
kubectl config set-context --current --namespace=acceptance
kubectl create -f ../../test/acceptance/injector-test/pg-deployment.yaml
sleep 5
wait_for_ready $(kubectl get pod -l app=postgres -o jsonpath="{.items[0].metadata.name}")
kubectl create secret generic test \
--from-file ../../test/acceptance/injector-test/pgdump-policy.hcl \
--from-file ../../test/acceptance/injector-test/bootstrap.sh
kubectl label secret test app=openbao-agent-demo
helm install "$(name_prefix)" \
--set="server.extraVolumes[0].type=secret" \
--set="server.extraVolumes[0].name=test" .
wait_for_running $(name_prefix)-0
wait_for_ready $(kubectl get pod -l component=webhook -o jsonpath="{.items[0].metadata.name}")
kubectl exec -ti "$(name_prefix)-0" -- /bin/sh -c "cp /openbao/userconfig/test/bootstrap.sh /tmp/bootstrap.sh && chmod +x /tmp/bootstrap.sh && /tmp/bootstrap.sh"
sleep 5
# Sealed, not initialized
local sealed_status=$(kubectl exec "$(name_prefix)-0" -- bao status -format=json |
jq -r '.sealed' )
[ "${sealed_status}" == "false" ]
local init_status=$(kubectl exec "$(name_prefix)-0" -- bao status -format=json |
jq -r '.initialized')
[ "${init_status}" == "true" ]
kubectl create -f ../../test/acceptance/injector-test/job.yaml
wait_for_complete_job "pgdump"
}
# Clean up
teardown() {
if [[ ${CLEANUP:-true} == "true" ]]
then
echo "helm/pvc teardown"
helm delete openbao
kubectl delete --all pvc
kubectl delete secret test
kubectl delete job pgdump
kubectl delete deployment postgres
kubectl delete namespace acceptance
fi
}

View file

@ -0,0 +1,46 @@
#!/usr/bin/env bats
load _helpers
@test "server/annotations: testing yaml and yaml-formatted string formats" {
cd `chart_dir`
kubectl delete namespace acceptance --ignore-not-found=true
kubectl create namespace acceptance
kubectl config set-context --current --namespace=acceptance
helm install "$(name_prefix)" -f ../../test/acceptance/server-test/annotations-overrides.yaml .
wait_for_running $(name_prefix)-0
# service annotations
local awesome=$(kubectl get service "$(name_prefix)" --output json |
jq -r '.metadata.annotations.active')
[ "${awesome}" == "sometimes" ]
local pickMe=$(kubectl get service "$(name_prefix)" --output json |
jq -r '.metadata.annotations.pickMe')
[ "${pickMe}" == "please" ]
local environment=$(kubectl get statefulset "$(name_prefix)" --output json |
jq -r '.spec.template.metadata.annotations.environment')
[ "${environment}" == "production" ]
local milk=$(kubectl get statefulset "$(name_prefix)" --output json |
jq -r '.spec.template.metadata.annotations.milk')
[ "${milk}" == "oat" ]
local myName=$(kubectl get statefulset "$(name_prefix)" --output json |
jq -r '.spec.template.metadata.annotations.myName')
[ "${myName}" == "$(name_prefix)" ]
}
# Clean up
teardown() {
if [[ ${CLEANUP:-true} == "true" ]]
then
echo "helm/pvc teardown"
helm delete $(name_prefix)
kubectl delete --all pvc
kubectl delete namespace acceptance --ignore-not-found=true
fi
}

View file

@ -0,0 +1,64 @@
#!/usr/bin/env bats
load _helpers
@test "server/dev: testing deployment" {
cd `chart_dir`
kubectl delete namespace acceptance --ignore-not-found=true
kubectl create namespace acceptance
kubectl config set-context --current --namespace=acceptance
helm install "$(name_prefix)" --set='server.dev.enabled=true' .
wait_for_running $(name_prefix)-0
# Replicas
local replicas=$(kubectl get statefulset "$(name_prefix)" --output json |
jq -r '.spec.replicas')
[ "${replicas}" == "1" ]
# Volume Mounts
local volumeCount=$(kubectl get statefulset "$(name_prefix)" --output json |
jq -r '.spec.template.spec.containers[0].volumeMounts | length')
[ "${volumeCount}" == "1" ]
# Service
local service=$(kubectl get service "$(name_prefix)" --output json |
jq -r '.spec.clusterIP')
[ "${service}" != "None" ]
local service=$(kubectl get service "$(name_prefix)" --output json |
jq -r '.spec.type')
[ "${service}" == "ClusterIP" ]
local ports=$(kubectl get service "$(name_prefix)" --output json |
jq -r '.spec.ports | length')
[ "${ports}" == "2" ]
local ports=$(kubectl get service "$(name_prefix)" --output json |
jq -r '.spec.ports[0].port')
[ "${ports}" == "8200" ]
local ports=$(kubectl get service "$(name_prefix)" --output json |
jq -r '.spec.ports[1].port')
[ "${ports}" == "8201" ]
# Sealed, not initialized
local sealed_status=$(kubectl exec "$(name_prefix)-0" -- bao status -format=json |
jq -r '.sealed' )
[ "${sealed_status}" == "false" ]
local init_status=$(kubectl exec "$(name_prefix)-0" -- bao status -format=json |
jq -r '.initialized')
[ "${init_status}" == "true" ]
}
# Clean up
teardown() {
if [[ ${CLEANUP:-true} == "true" ]]
then
echo "helm/pvc teardown"
helm delete openbao
kubectl delete --all pvc
kubectl delete namespace acceptance --ignore-not-found=true
fi
}

View file

@ -0,0 +1,121 @@
#!/usr/bin/env bats
load _helpers
@test "server/ha-raft: testing deployment" {
cd `chart_dir`
helm install "$(name_prefix)" \
--set='server.ha.enabled=true' \
--set='server.ha.raft.enabled=true' .
wait_for_running $(name_prefix)-0
# Sealed, not initialized
wait_for_sealed_vault $(name_prefix)-0
local init_status=$(kubectl exec "$(name_prefix)-0" -- bao status -format=json |
jq -r '.initialized')
[ "${init_status}" == "false" ]
# Replicas
local replicas=$(kubectl get statefulset "$(name_prefix)" --output json |
jq -r '.spec.replicas')
[ "${replicas}" == "3" ]
# Volume Mounts
local volumeCount=$(kubectl get statefulset "$(name_prefix)" --output json |
jq -r '.spec.template.spec.containers[0].volumeMounts | length')
[ "${volumeCount}" == "3" ]
# Volumes
local volumeCount=$(kubectl get statefulset "$(name_prefix)" --output json |
jq -r '.spec.template.spec.volumes | length')
[ "${volumeCount}" == "2" ]
local volume=$(kubectl get statefulset "$(name_prefix)" --output json |
jq -r '.spec.template.spec.volumes[0].configMap.name')
[ "${volume}" == "$(name_prefix)-config" ]
# Service
local service=$(kubectl get service "$(name_prefix)" --output json |
jq -r '.spec.clusterIP')
[ "${service}" != "None" ]
local service=$(kubectl get service "$(name_prefix)" --output json |
jq -r '.spec.type')
[ "${service}" == "ClusterIP" ]
local ports=$(kubectl get service "$(name_prefix)" --output json |
jq -r '.spec.ports | length')
[ "${ports}" == "2" ]
local ports=$(kubectl get service "$(name_prefix)" --output json |
jq -r '.spec.ports[0].port')
[ "${ports}" == "8200" ]
local ports=$(kubectl get service "$(name_prefix)" --output json |
jq -r '.spec.ports[1].port')
[ "${ports}" == "8201" ]
# OpenBao Init
local init=$(kubectl exec -ti "$(name_prefix)-0" -- \
bao operator init -format=json -n 1 -t 1)
local token=$(echo ${init} | jq -r '.unseal_keys_b64[0]')
[ "${token}" != "" ]
local root=$(echo ${init} | jq -r '.root_token')
[ "${root}" != "" ]
kubectl exec -ti openbao-0 -- bao operator unseal ${token}
wait_for_ready "$(name_prefix)-0"
sleep 5
# OpenBao Unseal
local pods=($(kubectl get pods --selector='app.kubernetes.io/name=openbao' -o json | jq -r '.items[].metadata.name'))
for pod in "${pods[@]}"
do
if [[ ${pod?} != "$(name_prefix)-0" ]]
then
kubectl exec -ti ${pod} -- bao operator raft join http://$(name_prefix)-0.$(name_prefix)-internal:8200
kubectl exec -ti ${pod} -- bao operator unseal ${token}
wait_for_ready "${pod}"
fi
done
# Sealed, not initialized
local sealed_status=$(kubectl exec "$(name_prefix)-0" -- bao status -format=json |
jq -r '.sealed' )
[ "${sealed_status}" == "false" ]
local init_status=$(kubectl exec "$(name_prefix)-0" -- bao status -format=json |
jq -r '.initialized')
[ "${init_status}" == "true" ]
kubectl exec "$(name_prefix)-0" -- bao login ${root}
local raft_status=$(kubectl exec "$(name_prefix)-0" -- bao operator raft list-peers -format=json |
jq -r '.data.config.servers | length')
[ "${raft_status}" == "3" ]
}
setup() {
kubectl delete namespace acceptance --ignore-not-found=true
kubectl create namespace acceptance
kubectl config set-context --current --namespace=acceptance
}
#cleanup
teardown() {
if [[ ${CLEANUP:-true} == "true" ]]
then
# If the test failed, print some debug output
if [[ "$BATS_ERROR_STATUS" -ne 0 ]]; then
kubectl logs -l app.kubernetes.io/name=openbao
fi
helm delete openbao
kubectl delete --all pvc
kubectl delete namespace acceptance --ignore-not-found=true
fi
}

View file

@ -0,0 +1,90 @@
#!/usr/bin/env bats
load _helpers
@test "server/telemetry: prometheusOperator" {
cd `chart_dir`
helm --namespace acceptance uninstall $(name_prefix) || :
helm --namespace acceptance uninstall prometheus || :
kubectl delete namespace acceptance --ignore-not-found=true
kubectl create namespace acceptance
kubectl config set-context --current --namespace=acceptance
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
helm install \
--wait \
--version 39.6.0 \
prometheus prometheus-community/kube-prometheus-stack
helm install \
--wait \
--values ../../test/acceptance/server-test/telemetry.yaml \
"$(name_prefix)" .
wait_for_running $(name_prefix)-0
# Sealed, not initialized
wait_for_sealed_vault $(name_prefix)-0
# OpenBao Init
local token=$(kubectl exec -ti "$(name_prefix)-0" -- \
bao operator init -format=json -n 1 -t 1 | \
jq -r '.unseal_keys_b64[0]')
[ "${token}" != "" ]
# OpenBao Unseal
local pods=($(kubectl get pods --selector='app.kubernetes.io/name=openbao' -o json | jq -r '.items[].metadata.name'))
for pod in "${pods[@]}"
do
kubectl exec -ti ${pod} -- bao operator unseal ${token}
done
wait_for_ready "$(name_prefix)-0"
# Unsealed, initialized
local sealed_status=$(kubectl exec "$(name_prefix)-0" -- bao status -format=json |
jq -r '.sealed' )
[ "${sealed_status}" == "false" ]
local init_status=$(kubectl exec "$(name_prefix)-0" -- bao status -format=json |
jq -r '.initialized')
[ "${init_status}" == "true" ]
# unfortunately it can take up to 2 minutes for the openbao prometheus job to appear
# TODO: investigate how reduce this.
local job_labels
local tries=0
until [ $tries -ge 240 ]
do
job_labels=$( (kubectl exec -n acceptance svc/prometheus-kube-prometheus-prometheus \
-c prometheus \
-- wget -q -O - http://127.0.0.1:9090/api/v1/label/job/values) | tee /dev/stderr )
# Ensure the expected job label was picked up by Prometheus
[ "$(echo "${job_labels}" | jq 'any(.data[]; . == "openbao-internal")')" = "true" ] && break
((++tries))
sleep .5
done
# Ensure the expected job is "up"
local job_up=$( ( kubectl exec -n acceptance svc/prometheus-kube-prometheus-prometheus \
-c prometheus \
-- wget -q -O - 'http://127.0.0.1:9090/api/v1/query?query=up{job="openbao-internal"}' ) | \
tee /dev/stderr )
[ "$(echo "${job_up}" | jq '.data.result[0].value[1]')" = \"1\" ]
}
# Clean up
teardown() {
if [[ ${CLEANUP:-true} == "true" ]]
then
echo "helm/pvc teardown"
helm uninstall $(name_prefix)
helm uninstall prometheus
kubectl delete --all pvc
kubectl delete namespace acceptance --ignore-not-found=true
fi
}

View file

@ -0,0 +1,12 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
server:
annotations: |
environment: production
milk: oat
myName: "{{ .Release.Name }}"
service:
annotations:
active: sometimes
pickMe: please

View file

@ -0,0 +1,31 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
server:
standalone:
config: |
ui = true
listener "tcp" {
tls_disable = 1
address = "[::]:8200"
cluster_address = "[::]:8201"
# Enable unauthenticated metrics access (necessary for Prometheus Operator)
telemetry {
unauthenticated_metrics_access = "true"
}
}
storage "file" {
path = "/openbao/data"
}
telemetry {
prometheus_retention_time = "30s"
disable_hostname = true
}
serverTelemetry:
serviceMonitor:
enabled: true
interval: 15s

View file

@ -2,16 +2,108 @@
load _helpers
@test "server: default, comes up healthy" {
helm_install
wait_for_ready $(name_prefix)-server-0
@test "server/standalone: testing deployment" {
cd `chart_dir`
# Verify there are three servers
local server_count=$(kubectl exec "$(name_prefix)-server-0" consul members |
grep server |
wc -l)
[ "${server_count}" -eq "3" ]
kubectl delete namespace acceptance --ignore-not-found=true
kubectl create namespace acceptance
kubectl config set-context --current --namespace=acceptance
# Clean up
helm_delete
helm install "$(name_prefix)" .
wait_for_running $(name_prefix)-0
# Sealed, not initialized
wait_for_sealed_vault $(name_prefix)-0
local init_status=$(kubectl exec "$(name_prefix)-0" -- bao status -format=json |
jq -r '.initialized')
[ "${init_status}" == "false" ]
# Replicas
local replicas=$(kubectl get statefulset "$(name_prefix)" --output json |
jq -r '.spec.replicas')
[ "${replicas}" == "1" ]
# Affinity
local affinity=$(kubectl get statefulset "$(name_prefix)" --output json |
jq -r '.spec.template.spec.affinity')
[ "${affinity}" != "null" ]
# Volume Mounts
local volumeCount=$(kubectl get statefulset "$(name_prefix)" --output json |
jq -r '.spec.template.spec.containers[0].volumeMounts | length')
[ "${volumeCount}" == "3" ]
local mountName=$(kubectl get statefulset "$(name_prefix)" --output json |
jq -r '.spec.template.spec.containers[0].volumeMounts[0].name')
[ "${mountName}" == "data" ]
local mountPath=$(kubectl get statefulset "$(name_prefix)" --output json |
jq -r '.spec.template.spec.containers[0].volumeMounts[0].mountPath')
[ "${mountPath}" == "/openbao/data" ]
# Volumes
local volumeCount=$(kubectl get statefulset "$(name_prefix)" --output json |
jq -r '.spec.template.spec.volumes | length')
[ "${volumeCount}" == "2" ]
local volume=$(kubectl get statefulset "$(name_prefix)" --output json |
jq -r '.spec.template.spec.volumes[0].configMap.name')
[ "${volume}" == "$(name_prefix)-config" ]
# Service
local service=$(kubectl get service "$(name_prefix)" --output json |
jq -r '.spec.clusterIP')
[ "${service}" != "None" ]
local service=$(kubectl get service "$(name_prefix)" --output json |
jq -r '.spec.type')
[ "${service}" == "ClusterIP" ]
local ports=$(kubectl get service "$(name_prefix)" --output json |
jq -r '.spec.ports | length')
[ "${ports}" == "2" ]
local ports=$(kubectl get service "$(name_prefix)" --output json |
jq -r '.spec.ports[0].port')
[ "${ports}" == "8200" ]
local ports=$(kubectl get service "$(name_prefix)" --output json |
jq -r '.spec.ports[1].port')
[ "${ports}" == "8201" ]
# OpenBao Init
local token=$(kubectl exec -ti "$(name_prefix)-0" -- \
bao operator init -format=json -n 1 -t 1 | \
jq -r '.unseal_keys_b64[0]')
[ "${token}" != "" ]
# OpenBao Unseal
local pods=($(kubectl get pods --selector='app.kubernetes.io/name=openbao' -o json | jq -r '.items[].metadata.name'))
for pod in "${pods[@]}"
do
kubectl exec -ti ${pod} -- bao operator unseal ${token}
done
wait_for_ready "$(name_prefix)-0"
# Unsealed, initialized
local sealed_status=$(kubectl exec "$(name_prefix)-0" -- bao status -format=json |
jq -r '.sealed' )
[ "${sealed_status}" == "false" ]
local init_status=$(kubectl exec "$(name_prefix)-0" -- bao status -format=json |
jq -r '.initialized')
[ "${init_status}" == "true" ]
}
# Clean up
teardown() {
if [[ ${CLEANUP:-true} == "true" ]]
then
echo "helm/pvc teardown"
helm delete openbao
kubectl delete --all pvc
kubectl delete namespace acceptance --ignore-not-found=true
fi
}

21
test/chart/_helpers.bash Normal file
View file

@ -0,0 +1,21 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
# chart_dir returns the directory for the chart
chart_dir() {
echo ${BATS_TEST_DIRNAME}/../../charts/openbao
}
# check_result checks if the specified test passed
# results schema example:
# {
# "check": "has-minkubeversion",
# "type": "Mandatory",
# "outcome": "PASS",
# "reason": "Minimum Kubernetes version specified"
# }
check_result() {
local -r var="$1"
local check=$(cat $VERIFY_OUTPUT | jq -r ".results[] | select(.check==\"${var}\").outcome")
[ "$check" = "PASS" ]
}

94
test/chart/verifier.bats Normal file
View file

@ -0,0 +1,94 @@
#!/usr/bin/env bats
load _helpers
setup_file() {
cd `chart_dir`
export VERIFY_OUTPUT="/$BATS_RUN_TMPDIR/verify.json"
export CHART_VOLUME=openbao-helm-chart-src
local IMAGE="quay.io/redhat-certification/chart-verifier:1.13.7"
# chart-verifier requires an openshift version if a cluster isn't available
local OPENSHIFT_VERSION="4.12"
local DISABLED_TESTS="chart-testing"
local run_cmd="chart-verifier"
local chart_src="."
if [ ! -e $USE_DOCKER ]; then
chart_src="/chart"
# Create a dummy container which will hold a volume with chart source
docker create -v $chart_src --name $CHART_VOLUME alpine:3 /bin/true
# Copy the chart source into this volume
docker cp . $CHART_VOLUME:$chart_src
# Make sure we have the latest version of chart-verifier
docker pull $IMAGE
# Start chart-verifier using this volume
run_cmd="docker run --rm --volumes-from $CHART_VOLUME -w $chart_src $IMAGE"
fi
$run_cmd verify $chart_src \
--output json \
--openshift-version $OPENSHIFT_VERSION \
--disable $DISABLED_TESTS \
--chart-values values.openshift.yaml 2>&1 | tee $VERIFY_OUTPUT
}
teardown_file() {
if [ ! -e $USE_DOCKER ]; then
docker rm $CHART_VOLUME
fi
}
@test "has-kubeversion" {
check_result v1.1/has-kubeversion
}
@test "is-helm-v3" {
check_result v1.0/is-helm-v3
}
@test "not-contains-crds" {
check_result v1.0/not-contains-crds
}
@test "helm-lint" {
check_result v1.0/helm-lint
}
@test "not-contain-csi-objects" {
check_result v1.0/not-contain-csi-objects
}
@test "has-readme" {
check_result v1.0/has-readme
}
@test "contains-values" {
check_result v1.0/contains-values
}
@test "contains-values-schema" {
check_result v1.0/contains-values-schema
}
@test "contains-test" {
check_result v1.0/contains-test
}
@test "images-are-certified" {
check_result v1.1/images-are-certified
}
@test "required-annotations-present" {
check_result v1.0/required-annotations-present
}
@test "chart-testing" {
skip "Skipping since this test requires a kubernetes/openshift cluster"
check_result v1.0/chart-testing
}
@test "signature-is-valid" {
skip "Chart is not signed : Signature verification not required"
check_result v1.0/signature-is-valid
}

View file

@ -1,3 +1,6 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
# This Dockerfile installs all the dependencies necessary to run the unit and
# acceptance tests. This image also contains gcloud so you can run tests
# against a GKE cluster easily.
@ -6,10 +9,11 @@
# a script to configure kubectl, potentially install Helm, and run the tests
# manually. This image only has the dependencies pre-installed.
FROM alpine:latest
FROM docker.mirror.hashicorp.services/alpine:latest
WORKDIR /root
ENV BATS_VERSION "1.1.0"
ENV BATS_VERSION "1.3.0"
ENV TERRAFORM_VERSION "0.12.10"
# base packages
RUN apk update && apk add --no-cache --virtual .build-deps \
@ -18,26 +22,35 @@ RUN apk update && apk add --no-cache --virtual .build-deps \
tar \
bash \
openssl \
python \
py-pip \
git \
make \
jq
# yq
RUN pip install yq
RUN python3 -m venv venv && \
. venv/bin/activate && \
pip install yq && \
ln -s $PWD/venv/bin/yq /usr/local/bin/yq && \
deactivate
# gcloud
RUN curl -OL https://dl.google.com/dl/cloudsdk/channels/rapid/install_google_cloud_sdk.bash && \
bash install_google_cloud_sdk.bash --disable-prompts --install-dir='/root/' && \
ln -s /root/google-cloud-sdk/bin/gcloud /usr/local/bin/gcloud
# terraform
RUN curl -sSL https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip -o /tmp/tf.zip \
&& unzip /tmp/tf.zip \
&& ln -s /root/terraform /usr/local/bin/terraform
# kubectl
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && \
chmod +x ./kubectl && \
mv ./kubectl /usr/local/bin/kubectl
# helm
RUN curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
RUN curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
# bats
RUN curl -sSL https://github.com/bats-core/bats-core/archive/v${BATS_VERSION}.tar.gz -o /tmp/bats.tgz \

23
test/kind/config.yaml Normal file
View file

@ -0,0 +1,23 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
- role: worker
- role: worker
# These apiServer settings are included for running the CSI provider on K8s
# prior to 1.21
kubeadmConfigPatches:
- |
apiVersion: kubeadm.k8s.io/v1beta2
kind: ClusterConfiguration
metadata:
name: config
apiServer:
extraArgs:
"service-account-issuer": "https://kubernetes.default.svc.cluster.local"
"service-account-signing-key-file": "/etc/kubernetes/pki/sa.key"
"service-account-api-audiences": "https://kubernetes.default.svc.cluster.local"

1
test/terraform/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
vault-helm-dev-creds.json

View file

@ -1,11 +1,8 @@
locals {
service_account_path = "${path.module}/service-account.yaml"
}
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
provider "google" {
project = "${var.project}"
region = "us-central1"
credentials = "${file("vault-helm-dev-creds.json")}"
project = "${var.project}"
}
resource "random_id" "suffix" {
@ -13,23 +10,44 @@ resource "random_id" "suffix" {
}
data "google_container_engine_versions" "main" {
zone = "${var.zone}"
location = "${var.zone}"
version_prefix = "1.19."
}
data "google_service_account" "gcpapi" {
account_id = "${var.gcp_service_account}"
}
resource "google_container_cluster" "cluster" {
name = "vault-helm-dev-${random_id.suffix.dec}"
name = "openbao-helm-dev-${random_id.suffix.dec}"
project = "${var.project}"
enable_legacy_abac = true
initial_node_count = 3
zone = "${var.zone}"
location = "${var.zone}"
min_master_version = "${data.google_container_engine_versions.main.latest_master_version}"
node_version = "${data.google_container_engine_versions.main.latest_node_version}"
node_config {
#service account for nodes to use
oauth_scopes = [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/compute",
"https://www.googleapis.com/auth/devstorage.read_write",
"https://www.googleapis.com/auth/logging.write",
"https://www.googleapis.com/auth/monitoring",
"https://www.googleapis.com/auth/service.management.readonly",
"https://www.googleapis.com/auth/servicecontrol",
"https://www.googleapis.com/auth/trace.append",
]
service_account = "${data.google_service_account.gcpapi.email}"
}
}
resource "null_resource" "kubectl" {
count = "${var.init_cli ? 1 : 0 }"
triggers {
triggers = {
cluster = "${google_container_cluster.cluster.id}"
}
@ -55,19 +73,3 @@ resource "null_resource" "kubectl" {
command = "kubectl config get-contexts | grep ${google_container_cluster.cluster.name} | xargs -n1 kubectl config delete-context"
}
}
resource "null_resource" "helm" {
count = "${var.init_cli ? 1 : 0 }"
depends_on = ["null_resource.kubectl"]
triggers {
cluster = "${google_container_cluster.cluster.id}"
}
provisioner "local-exec" {
command = <<EOF
kubectl apply -f '${local.service_account_path}'
helm init --service-account helm
EOF
}
}

Some files were not shown because too many files have changed in this diff Show more