Commit graph

239 commits

Author SHA1 Message Date
Tom Proctor
9954df5e68
Add role for creating CSI's HMAC secret key (#872) 2023-04-14 13:31:41 +01:00
Theron Voran
1307dbea76
add copyright header to csi-agent-configmap.yaml (#870) 2023-04-11 11:00:47 -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
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
Theron Voran
742ddb1c52
adding SPDX copyright headers (#844) 2023-02-13 08:48:20 -08:00
Douglas Thomson
72914d873c
Amending docs (#828) 2023-01-12 09:38:29 -08: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
7e21a09ebd
Add server.hostNetwork option (#775) 2022-09-12 15:17:24 +01: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
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
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
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
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
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
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
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
Michael Schuett
a2d9a0144f
Add extraLabels for CSI DaemonSet (#690) 2022-02-25 12:18:45 +00: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
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
609444d9d9
Configurable PodDisruptionBudget for Injector (#653) 2021-12-13 23:38:00 -08:00
Theron Voran
0375b184b3
remove support for the leader-elector container (#649) 2021-11-17 13:06:03 -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
Tim Collins
c09c50f9d6
Add option for Ingress pathType (#634) 2021-10-25 11:30:06 -04: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
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
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
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
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
d31f942d3e
Support vault-k8s internal leader election (#568) 2021-08-31 15:16:06 -07:00
Theron Voran
f7ab37fd50
Add injector.webhookAnnotations chart option (#584) 2021-08-16 13:49:26 -07:00