Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Adds GCP secret manager triggerauthentication #4864

Merged
merged 41 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
3cfe0ea
adds gcp secrets manager support for scaler trigger authentication
neelanjan00 Jul 30, 2023
3c859d7
mandates gcp project id to be input a part of the triggerAuth
neelanjan00 Aug 6, 2023
e92ea50
Merge branch 'main' into gcp-secret-manager-triggerauth
neelanjan00 Aug 6, 2023
2571061
fixes error string format specifiers and error logs
neelanjan00 Aug 6, 2023
e615642
Merge branch 'gcp-secret-manager-triggerauth' of https://github.com/n…
neelanjan00 Aug 6, 2023
46f2ded
fixes ci lint errors
neelanjan00 Aug 6, 2023
37b2614
adds creation and deletion of secret in the test
neelanjan00 Sep 19, 2023
c40ebe1
Merge branch 'main' into gcp-secret-manager-triggerauth
neelanjan00 Sep 19, 2023
5657319
replaces gcp credentials secret to manifest template
neelanjan00 Sep 24, 2023
fab71a5
undo controller-gen version changes, creationTimestamp, and Kustomiza…
neelanjan00 Sep 24, 2023
741c43f
Merge branch 'main' into gcp-secret-manager-triggerauth
neelanjan00 Sep 24, 2023
d934f15
sorts items in the changelog new section
neelanjan00 Sep 24, 2023
ef01e8a
resolves PR comments
neelanjan00 Sep 24, 2023
02ada6d
adds workload-identity e2e test
neelanjan00 Sep 30, 2023
35a4566
updates the secret id name
neelanjan00 Oct 2, 2023
078cddf
Merge branch 'main' into gcp-secret-manager-triggerauth
neelanjan00 Oct 2, 2023
2cc5ff7
Merge branch 'main' into gcp-secret-manager-triggerauth
neelanjan00 Oct 2, 2023
df99446
Merge branch 'main' into gcp-secret-manager-triggerauth
neelanjan00 Oct 7, 2023
e9ca060
Merge branch 'main' into gcp-secret-manager-triggerauth
neelanjan00 Oct 13, 2023
b602044
Merge branch 'main' into gcp-secret-manager-triggerauth
neelanjan00 Nov 17, 2023
c9ea398
Merge branch 'main' into gcp-secret-manager-triggerauth
neelanjan00 Nov 25, 2023
0951b60
adds unit tests
neelanjan00 Dec 12, 2023
57a3f98
Merge branch 'main' into gcp-secret-manager-triggerauth
neelanjan00 Dec 12, 2023
295cecf
updates copyright message
neelanjan00 Dec 12, 2023
3e8f5e4
fixes ci checks
neelanjan00 Dec 12, 2023
7d7b9c6
Merge branch 'main' into gcp-secret-manager-triggerauth
neelanjan00 Dec 13, 2023
2bf8794
adds logic for internally deriving gcp project id
neelanjan00 Dec 23, 2023
7a2448b
Merge branch 'gcp-secret-manager-triggerauth' of https://github.com/n…
neelanjan00 Dec 23, 2023
0e0bb5e
Merge branch 'main' into gcp-secret-manager-triggerauth
neelanjan00 Dec 23, 2023
9211d40
Merge branch 'main' into gcp-secret-manager-triggerauth
neelanjan00 Dec 27, 2023
1a2526b
adds env derivation of project id
neelanjan00 Dec 27, 2023
6b6ce41
Merge branch 'gcp-secret-manager-triggerauth' of https://github.com/n…
neelanjan00 Dec 27, 2023
c779831
Merge branch 'main' into gcp-secret-manager-triggerauth
neelanjan00 Jan 9, 2024
99e11f4
fix go mod vendor
neelanjan00 Jan 9, 2024
0c4873b
Merge branch 'main' into gcp-secret-manager-triggerauth
neelanjan00 Jan 11, 2024
a9d7c72
resolves PR comments
neelanjan00 Jan 11, 2024
86f9cf5
Merge branch 'main' into gcp-secret-manager-triggerauth
neelanjan00 Jan 13, 2024
578a342
resolves PR comments
neelanjan00 Jan 13, 2024
1da328f
fixes ci checks
neelanjan00 Jan 13, 2024
d70edbe
Merge branch 'main' into gcp-secret-manager-triggerauth
neelanjan00 Jan 15, 2024
6c98fb0
Merge branch 'main' into gcp-secret-manager-triggerauth
zroubalik Jan 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ To learn more about active deprecations, we recommend checking [GitHub Discussio

### New

- **General**: Adds support for GCP Secret Manager as a source for TriggerAuthentication ([#4831](https://github.com/kedacore/keda/issues/4831))
- **General**: Introduce new AWS Authentication ([#4134](https://github.com/kedacore/keda/issues/4134))

#### Experimental
Expand Down
2 changes: 1 addition & 1 deletion apis/eventing/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions apis/keda/v1alpha1/triggerauthentication_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ type TriggerAuthenticationSpec struct {

// +optional
AzureKeyVault *AzureKeyVault `json:"azureKeyVault,omitempty"`

// +optional
GCPSecretManager *GCPSecretManager `json:"gcpSecretManager,omitempty"`
}

// TriggerAuthenticationStatus defines the observed state of TriggerAuthentication
Expand Down Expand Up @@ -297,6 +300,29 @@ type AzureKeyVaultCloudInfo struct {
ActiveDirectoryEndpoint string `json:"activeDirectoryEndpoint"`
}

type GCPSecretManager struct {
Secrets []GCPSecretManagerSecret `json:"secrets"`
// +optional
Credentials *GCPCredentials `json:"gcpCredentials"`
neelanjan00 marked this conversation as resolved.
Show resolved Hide resolved
// +optional
PodIdentity *AuthPodIdentity `json:"podIdentity"`
}

type GCPCredentials struct {
ClientSecret GCPSecretmanagerClientSecret `json:"clientSecret"`
}

type GCPSecretmanagerClientSecret struct {
ValueFrom ValueFromSecret `json:"valueFrom"`
}

type GCPSecretManagerSecret struct {
Parameter string `json:"parameter"`
ID string `json:"id"`
// +optional
Version string `json:"version,omitempty"`
}

func init() {
SchemeBuilder.Register(&ClusterTriggerAuthentication{}, &ClusterTriggerAuthenticationList{})
SchemeBuilder.Register(&TriggerAuthentication{}, &TriggerAuthenticationList{})
Expand Down
84 changes: 83 additions & 1 deletion apis/keda/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

75 changes: 75 additions & 0 deletions config/crd/bases/keda.sh_clustertriggerauthentications.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,81 @@ spec:
- parameter
type: object
type: array
gcpSecretManager:
properties:
gcpCredentials:
properties:
clientSecret:
properties:
valueFrom:
properties:
secretKeyRef:
properties:
key:
type: string
name:
type: string
required:
- key
- name
type: object
required:
- secretKeyRef
type: object
required:
- valueFrom
type: object
required:
- clientSecret
type: object
podIdentity:
description: AuthPodIdentity allows users to select the platform
native identity mechanism
properties:
identityId:
type: string
identityOwner:
description: IdentityOwner configures which identity has to
be used during auto discovery, keda or the scaled workload.
Mutually exclusive with roleArn
enum:
- keda
- workload
type: string
provider:
description: PodIdentityProvider contains the list of providers
enum:
- azure
- azure-workload
- gcp
- aws
- aws-eks
- aws-kiam
type: string
roleArn:
description: RoleArn sets the AWS RoleArn to be used. Mutually
exclusive with IdentityOwner
type: string
required:
- provider
type: object
secrets:
items:
properties:
id:
type: string
parameter:
type: string
version:
type: string
required:
- id
- parameter
type: object
type: array
required:
- secrets
type: object
hashiCorpVault:
description: HashiCorpVault is used to authenticate using Hashicorp
Vault
Expand Down
75 changes: 75 additions & 0 deletions config/crd/bases/keda.sh_triggerauthentications.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,81 @@ spec:
- parameter
type: object
type: array
gcpSecretManager:
properties:
gcpCredentials:
properties:
clientSecret:
properties:
valueFrom:
properties:
secretKeyRef:
properties:
key:
type: string
name:
type: string
required:
- key
- name
type: object
required:
- secretKeyRef
type: object
required:
- valueFrom
type: object
required:
- clientSecret
type: object
podIdentity:
description: AuthPodIdentity allows users to select the platform
native identity mechanism
properties:
identityId:
type: string
identityOwner:
description: IdentityOwner configures which identity has to
be used during auto discovery, keda or the scaled workload.
Mutually exclusive with roleArn
enum:
- keda
- workload
type: string
provider:
description: PodIdentityProvider contains the list of providers
enum:
- azure
- azure-workload
- gcp
- aws
- aws-eks
- aws-kiam
type: string
roleArn:
description: RoleArn sets the AWS RoleArn to be used. Mutually
exclusive with IdentityOwner
type: string
required:
- provider
type: object
secrets:
items:
properties:
id:
type: string
parameter:
type: string
version:
type: string
required:
- id
- parameter
type: object
type: array
required:
- secrets
type: object
hashiCorpVault:
description: HashiCorpVault is used to authenticate using Hashicorp
Vault
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.21
require (
cloud.google.com/go/compute/metadata v0.2.3
cloud.google.com/go/monitoring v1.17.0
cloud.google.com/go/secretmanager v1.11.4
cloud.google.com/go/storage v1.36.0
dario.cat/mergo v1.0.0
github.com/Azure/azure-amqp-common-go/v4 v4.2.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,8 @@ cloud.google.com/go/secretmanager v1.8.0/go.mod h1:hnVgi/bN5MYHd3Gt0SPuTPPp5ENin
cloud.google.com/go/secretmanager v1.9.0/go.mod h1:b71qH2l1yHmWQHt9LC80akm86mX8AL6X1MA01dW8ht4=
cloud.google.com/go/secretmanager v1.10.0/go.mod h1:MfnrdvKMPNra9aZtQFvBcvRU54hbPD8/HayQdlUgJpU=
cloud.google.com/go/secretmanager v1.11.1/go.mod h1:znq9JlXgTNdBeQk9TBW/FnR/W4uChEKGeqQWAJ8SXFw=
cloud.google.com/go/secretmanager v1.11.4 h1:krnX9qpG2kR2fJ+u+uNyNo+ACVhplIAS4Pu7u+4gd+k=
cloud.google.com/go/secretmanager v1.11.4/go.mod h1:wreJlbS9Zdq21lMzWmJ0XhWW2ZxgPeahsqeV/vZoJ3w=
cloud.google.com/go/security v1.5.0/go.mod h1:lgxGdyOKKjHL4YG3/YwIL2zLqMFCKs0UbQwgyZmfJl4=
cloud.google.com/go/security v1.7.0/go.mod h1:mZklORHl6Bg7CNnnjLH//0UlAlaXqiG7Lb9PsPXLfD0=
cloud.google.com/go/security v1.8.0/go.mod h1:hAQOwgmaHhztFhiQ41CjDODdWP0+AE1B3sX4OFlq+GU=
Expand Down
8 changes: 4 additions & 4 deletions pkg/mock/mock_eventemitter/mock_interface.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading