Skip to content

feat: add cloudAuthSecret & awsAuthSecret #1338

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

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 18 additions & 0 deletions apis/fluentbit/v1alpha2/plugins/output/elasticsearch_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ type Elasticsearch struct {
Pipeline string `json:"pipeline,omitempty"`
// Enable AWS Sigv4 Authentication for Amazon ElasticSearch Service.
AWSAuth string `json:"awsAuth,omitempty"`
// AWSAuthSecret Enable AWS Sigv4 Authentication for Amazon ElasticSearch Service.
AWSAuthSecret *plugins.Secret `json:"awsAuthSecret,omitempty"`
// Specify the AWS region for Amazon ElasticSearch Service.
AWSRegion string `json:"awsRegion,omitempty"`
// Specify the custom sts endpoint to be used with STS API for Amazon ElasticSearch Service.
Expand All @@ -52,6 +54,8 @@ type Elasticsearch struct {
CloudID string `json:"cloudID,omitempty"`
// Specify the credentials to use to connect to Elastic's Elasticsearch Service running on Elastic Cloud.
CloudAuth string `json:"cloudAuth,omitempty"`
// CloudAuthSecret Specify the credentials to use to connect to Elastic's Elasticsearch Service running on Elastic Cloud.
CloudAuthSecret *plugins.Secret `json:"cloudAuthSecret,omitempty"`
// Optional username credential for Elastic X-Pack access
HTTPUser *plugins.Secret `json:"httpUser,omitempty"`
// Password for user defined in HTTP_User
Expand Down Expand Up @@ -135,6 +139,13 @@ func (es *Elasticsearch) Params(sl plugins.SecretLoader) (*params.KVs, error) {
if es.AWSAuth != "" {
kvs.Insert("AWS_Auth", es.AWSAuth)
}
if es.AWSAuthSecret != nil {
u, err := sl.LoadSecret(*es.AWSAuthSecret)
if err != nil {
return nil, err
}
kvs.Insert("AWS_Auth", u)
}
if es.AWSRegion != "" {
kvs.Insert("AWS_Region", es.AWSRegion)
}
Expand All @@ -150,6 +161,13 @@ func (es *Elasticsearch) Params(sl plugins.SecretLoader) (*params.KVs, error) {
if es.CloudAuth != "" {
kvs.Insert("Cloud_Auth", es.CloudAuth)
}
if es.CloudAuthSecret != nil {
u, err := sl.LoadSecret(*es.CloudAuthSecret)
if err != nil {
return nil, err
}
kvs.Insert("Cloud_Auth", u)
}
if es.AWSExternalID != "" {
kvs.Insert("AWS_External_ID", es.AWSExternalID)
}
Expand Down
10 changes: 10 additions & 0 deletions apis/fluentbit/v1alpha2/plugins/output/zz_generated.deepcopy.go

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

Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,41 @@ spec:
description: Enable AWS Sigv4 Authentication for Amazon ElasticSearch
Service.
type: string
awsAuthSecret:
description: AWSAuthSecret Enable AWS Sigv4 Authentication for
Amazon ElasticSearch Service.
properties:
valueFrom:
description: ValueSource defines how to find a value's key.
properties:
secretKeyRef:
description: Selects a key of a secret in the pod's namespace
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
default: ""
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the Secret or its key
must be defined
type: boolean
required:
- key
type: object
x-kubernetes-map-type: atomic
type: object
type: object
awsExternalID:
description: External ID for the AWS IAM Role specified with aws_role_arn.
type: string
Expand Down Expand Up @@ -556,6 +591,42 @@ spec:
description: Specify the credentials to use to connect to Elastic's
Elasticsearch Service running on Elastic Cloud.
type: string
cloudAuthSecret:
description: CloudAuthSecret Specify the credentials to use to
connect to Elastic's Elasticsearch Service running on Elastic
Cloud.
properties:
valueFrom:
description: ValueSource defines how to find a value's key.
properties:
secretKeyRef:
description: Selects a key of a secret in the pod's namespace
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
default: ""
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the Secret or its key
must be defined
type: boolean
required:
- key
type: object
x-kubernetes-map-type: atomic
type: object
type: object
cloudID:
description: If you are using Elastic's Elasticsearch Service
you can specify the cloud_id of the cluster running.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,41 @@ spec:
description: Enable AWS Sigv4 Authentication for Amazon ElasticSearch
Service.
type: string
awsAuthSecret:
description: AWSAuthSecret Enable AWS Sigv4 Authentication for
Amazon ElasticSearch Service.
properties:
valueFrom:
description: ValueSource defines how to find a value's key.
properties:
secretKeyRef:
description: Selects a key of a secret in the pod's namespace
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
default: ""
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the Secret or its key
must be defined
type: boolean
required:
- key
type: object
x-kubernetes-map-type: atomic
type: object
type: object
awsExternalID:
description: External ID for the AWS IAM Role specified with aws_role_arn.
type: string
Expand Down Expand Up @@ -556,6 +591,42 @@ spec:
description: Specify the credentials to use to connect to Elastic's
Elasticsearch Service running on Elastic Cloud.
type: string
cloudAuthSecret:
description: CloudAuthSecret Specify the credentials to use to
connect to Elastic's Elasticsearch Service running on Elastic
Cloud.
properties:
valueFrom:
description: ValueSource defines how to find a value's key.
properties:
secretKeyRef:
description: Selects a key of a secret in the pod's namespace
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
default: ""
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the Secret or its key
must be defined
type: boolean
required:
- key
type: object
x-kubernetes-map-type: atomic
type: object
type: object
cloudID:
description: If you are using Elastic's Elasticsearch Service
you can specify the cloud_id of the cluster running.
Expand Down
71 changes: 71 additions & 0 deletions config/crd/bases/fluentbit.fluent.io_clusteroutputs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,41 @@ spec:
description: Enable AWS Sigv4 Authentication for Amazon ElasticSearch
Service.
type: string
awsAuthSecret:
description: AWSAuthSecret Enable AWS Sigv4 Authentication for
Amazon ElasticSearch Service.
properties:
valueFrom:
description: ValueSource defines how to find a value's key.
properties:
secretKeyRef:
description: Selects a key of a secret in the pod's namespace
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
default: ""
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the Secret or its key
must be defined
type: boolean
required:
- key
type: object
x-kubernetes-map-type: atomic
type: object
type: object
awsExternalID:
description: External ID for the AWS IAM Role specified with aws_role_arn.
type: string
Expand Down Expand Up @@ -556,6 +591,42 @@ spec:
description: Specify the credentials to use to connect to Elastic's
Elasticsearch Service running on Elastic Cloud.
type: string
cloudAuthSecret:
description: CloudAuthSecret Specify the credentials to use to
connect to Elastic's Elasticsearch Service running on Elastic
Cloud.
properties:
valueFrom:
description: ValueSource defines how to find a value's key.
properties:
secretKeyRef:
description: Selects a key of a secret in the pod's namespace
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
default: ""
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
TODO: Add other useful fields. apiVersion, kind, uid?
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
type: string
optional:
description: Specify whether the Secret or its key
must be defined
type: boolean
required:
- key
type: object
x-kubernetes-map-type: atomic
type: object
type: object
cloudID:
description: If you are using Elastic's Elasticsearch Service
you can specify the cloud_id of the cluster running.
Expand Down
Loading
Loading