Commit Graph

11 Commits

Author SHA1 Message Date
Nilekh Chaudhari 9bc62d2547 feat: implements encrypt all
Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>

Kubernetes-commit: 9382fab9b65669e74e8fb77247b14e6cb3ec6b3f
2023-01-18 00:54:47 +00:00
Anish Ramasekar 9fb6b944f0 kmsv2: implement expire cache with clock
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>

Kubernetes-commit: 4804baa01187b4251bd632e07721d875f567d6f1
2022-09-14 20:01:45 +00:00
Anish Ramasekar 525c6769a4 [KMS]: validate duplicate kms config name for v1 and v2 when reload=true
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>

Kubernetes-commit: 47f8c4bec63a2c4d6406cd615b41cd16f12be434
2022-11-07 20:16:04 +00:00
Anish Ramasekar 9adc12f501 [KMSv2]: add validation for duplicate kms config name
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>

Kubernetes-commit: 176919c4cfb0dc7ecc4987442c6d70b676cea156
2022-10-26 21:18:01 +00:00
Monis Khan 8d68e6f323 Load encryption config once
This change updates the API server code to load the encryption
config once at start up instead of multiple times.  Previously the
code would set up the storage transformers and the etcd healthz
checks in separate parse steps.  This is problematic for KMS v2 key
ID based staleness checks which need to be able to assert that the
API server has a single view into the KMS plugin's current key ID.

Signed-off-by: Monis Khan <mok@microsoft.com>

Kubernetes-commit: f507bc255382b2e2095351053bc17e74f7100d35
2022-08-29 17:25:48 -04:00
Anish Ramasekar 225e26ac4a Implement KMS v2alpha1
- add feature gate
- add encrypted object and run generated_files
- generate protobuf for encrypted object and add unit tests
- move parse endpoint to util and refactor
- refactor interface and remove unused interceptor
- add protobuf generate to update-generated-kms.sh
- add integration tests
- add defaulting for apiVersion in kmsConfiguration
- handle v1/v2 and default in encryption config parsing
- move metrics to own pkg and reuse for v2
- use Marshal and Unmarshal instead of serializer
- add context for all service methods
- check version and keyid for healthz

Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>

Kubernetes-commit: f19f3f409938ff9ac8a61966e47fbe9c6075ec90
2022-06-29 20:51:35 +00:00
Stephen Augustus 58544edbdf apiserver/pkg/apis/config/validation: Add invalidURLErrFmt
In go1.14, the following change to 'net/url' was made:
"When parsing of a URL fails (for example by Parse or ParseRequestURI),
the resulting Error message will now quote the unparsable URL. This
provides clearer structure and consistency with other parsing errors."

Here we add a new const, 'invalidURLErrFmt' to properly handle the now
quoted string in validation_test.go.

ref: https://golang.org/doc/go1.14#net/url

Signed-off-by: Stephen Augustus <saugustus@vmware.com>

Kubernetes-commit: b0f17c2918fe0d099fc59f17788ca60202a5ae1a
2020-04-18 04:37:22 -04:00
Monis Khan 43f8cca801 kms: use negative cachesize value to disable caching
This change relaxes the KMS config cache size validation to allow
for negative values.  The KMS code already treats all values <= 0 to
mean that the cache is disabled (zero is still a validation error).

Signed-off-by: Monis Khan <mok@vmware.com>

Kubernetes-commit: a16808f353afb6abf402c862d5f859b949d2027a
2019-12-15 23:30:36 -05:00
immutablet 5cec6b4746 Add defaulting logic for EncryptionConfiguration.
Kubernetes-commit: a151aa35dc21881d178e498141e5f58df13fb400
2019-11-14 22:53:18 -08:00
Lucas Käldström e8928c4a1c Move k8s.io/{apiserver,apimachinery}/pkg/apis/config to k8s.io/component-base/config. Co-authored-by @Klaven
Kubernetes-commit: 2e52d5c3311d3dcfd042e81570ef138645de529a
2019-01-06 13:57:47 +02:00
noqcks 383e6cc9a3 Add validation for kube-scheduler
adding validation for componentconfig

adding validation to cmd kube-scheduler

Add support for ipv6 in IsValidSocketAddr function

updating copyright date in componentconfig/validation/validation.go

updating copyright date in componentconfig/validation/validation_test.go

adding validation for cli options

adding BUILD files

updating validate function to return []errors in cmd/kube-scheduler

ok, really returning []error this time

adding comments for exported componentconfig Validation functions

silly me, not checking structs along the way :'(

refactor to avoid else statement

moving policy nil check up one function

rejigging some deprecated cmd validations

stumbling my way around validation slowly but surely

updating according to review from @bsalamat

- not validating leader election config unless leader election is enabled
- leader election time values cannot be zero
- removing validation for KubeConfigFile
- removing validation for scheduler policy

leader elect options should be non-negative

adding test cases for renewDeadline and leaseDuration being zero

fixing logic in componentconfig validation 😅

removing KubeConfigFile reference from tests as it was removed in master

2ff9bd6699

removing bogus space after var assignment

adding more tests for componentconfig based on feedback

making updates to validation because types were moved on master

update bazel build

adding validation for staging/apimachinery

adding validation for staging/apiserver

adding fieldPaths for staging validations

moving staging validations out of componentconfig

updating test case scenario for staging/apimachinery

./hack/update-bazel.sh

moving kube-scheduler validations from componentconfig

./hack/update-bazel.sh

removing non-negative check for QPS

resourceLock required

adding HardPodAffinitySymmetricWeight 0-100 range to cmd flag help section

Kubernetes-commit: 0334a34e4af9b56ffa4d8fe17514c931c69db84b
2018-07-30 16:22:22 -04:00