Skip to content

Commit 6298d40

Browse files
authored
Merge pull request #1338 from cw-Guo/feat/es-secret
feat: add cloudAuthSecret & awsAuthSecret
2 parents 0556dbe + 5c0fa08 commit 6298d40

File tree

9 files changed

+598
-0
lines changed

9 files changed

+598
-0
lines changed

apis/fluentbit/v1alpha2/plugins/output/elasticsearch_types.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ type Elasticsearch struct {
4040
Pipeline string `json:"pipeline,omitempty"`
4141
// Enable AWS Sigv4 Authentication for Amazon ElasticSearch Service.
4242
AWSAuth string `json:"awsAuth,omitempty"`
43+
// AWSAuthSecret Enable AWS Sigv4 Authentication for Amazon ElasticSearch Service.
44+
AWSAuthSecret *plugins.Secret `json:"awsAuthSecret,omitempty"`
4345
// Specify the AWS region for Amazon ElasticSearch Service.
4446
AWSRegion string `json:"awsRegion,omitempty"`
4547
// Specify the custom sts endpoint to be used with STS API for Amazon ElasticSearch Service.
@@ -52,6 +54,8 @@ type Elasticsearch struct {
5254
CloudID string `json:"cloudID,omitempty"`
5355
// Specify the credentials to use to connect to Elastic's Elasticsearch Service running on Elastic Cloud.
5456
CloudAuth string `json:"cloudAuth,omitempty"`
57+
// CloudAuthSecret Specify the credentials to use to connect to Elastic's Elasticsearch Service running on Elastic Cloud.
58+
CloudAuthSecret *plugins.Secret `json:"cloudAuthSecret,omitempty"`
5559
// Optional username credential for Elastic X-Pack access
5660
HTTPUser *plugins.Secret `json:"httpUser,omitempty"`
5761
// Password for user defined in HTTP_User
@@ -135,6 +139,13 @@ func (es *Elasticsearch) Params(sl plugins.SecretLoader) (*params.KVs, error) {
135139
if es.AWSAuth != "" {
136140
kvs.Insert("AWS_Auth", es.AWSAuth)
137141
}
142+
if es.AWSAuthSecret != nil {
143+
u, err := sl.LoadSecret(*es.AWSAuthSecret)
144+
if err != nil {
145+
return nil, err
146+
}
147+
kvs.Insert("AWS_Auth", u)
148+
}
138149
if es.AWSRegion != "" {
139150
kvs.Insert("AWS_Region", es.AWSRegion)
140151
}
@@ -150,6 +161,13 @@ func (es *Elasticsearch) Params(sl plugins.SecretLoader) (*params.KVs, error) {
150161
if es.CloudAuth != "" {
151162
kvs.Insert("Cloud_Auth", es.CloudAuth)
152163
}
164+
if es.CloudAuthSecret != nil {
165+
u, err := sl.LoadSecret(*es.CloudAuthSecret)
166+
if err != nil {
167+
return nil, err
168+
}
169+
kvs.Insert("Cloud_Auth", u)
170+
}
153171
if es.AWSExternalID != "" {
154172
kvs.Insert("AWS_External_ID", es.AWSExternalID)
155173
}

apis/fluentbit/v1alpha2/plugins/output/zz_generated.deepcopy.go

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/fluent-operator/charts/fluent-bit-crds/crds/fluentbit.fluent.io_clusteroutputs.yaml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,41 @@ spec:
529529
description: Enable AWS Sigv4 Authentication for Amazon ElasticSearch
530530
Service.
531531
type: string
532+
awsAuthSecret:
533+
description: AWSAuthSecret Enable AWS Sigv4 Authentication for
534+
Amazon ElasticSearch Service.
535+
properties:
536+
valueFrom:
537+
description: ValueSource defines how to find a value's key.
538+
properties:
539+
secretKeyRef:
540+
description: Selects a key of a secret in the pod's namespace
541+
properties:
542+
key:
543+
description: The key of the secret to select from. Must
544+
be a valid secret key.
545+
type: string
546+
name:
547+
default: ""
548+
description: |-
549+
Name of the referent.
550+
This field is effectively required, but due to backwards compatibility is
551+
allowed to be empty. Instances of this type with an empty value here are
552+
almost certainly wrong.
553+
TODO: Add other useful fields. apiVersion, kind, uid?
554+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
555+
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
556+
type: string
557+
optional:
558+
description: Specify whether the Secret or its key
559+
must be defined
560+
type: boolean
561+
required:
562+
- key
563+
type: object
564+
x-kubernetes-map-type: atomic
565+
type: object
566+
type: object
532567
awsExternalID:
533568
description: External ID for the AWS IAM Role specified with aws_role_arn.
534569
type: string
@@ -556,6 +591,42 @@ spec:
556591
description: Specify the credentials to use to connect to Elastic's
557592
Elasticsearch Service running on Elastic Cloud.
558593
type: string
594+
cloudAuthSecret:
595+
description: CloudAuthSecret Specify the credentials to use to
596+
connect to Elastic's Elasticsearch Service running on Elastic
597+
Cloud.
598+
properties:
599+
valueFrom:
600+
description: ValueSource defines how to find a value's key.
601+
properties:
602+
secretKeyRef:
603+
description: Selects a key of a secret in the pod's namespace
604+
properties:
605+
key:
606+
description: The key of the secret to select from. Must
607+
be a valid secret key.
608+
type: string
609+
name:
610+
default: ""
611+
description: |-
612+
Name of the referent.
613+
This field is effectively required, but due to backwards compatibility is
614+
allowed to be empty. Instances of this type with an empty value here are
615+
almost certainly wrong.
616+
TODO: Add other useful fields. apiVersion, kind, uid?
617+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
618+
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
619+
type: string
620+
optional:
621+
description: Specify whether the Secret or its key
622+
must be defined
623+
type: boolean
624+
required:
625+
- key
626+
type: object
627+
x-kubernetes-map-type: atomic
628+
type: object
629+
type: object
559630
cloudID:
560631
description: If you are using Elastic's Elasticsearch Service
561632
you can specify the cloud_id of the cluster running.

charts/fluent-operator/charts/fluent-bit-crds/crds/fluentbit.fluent.io_outputs.yaml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,41 @@ spec:
529529
description: Enable AWS Sigv4 Authentication for Amazon ElasticSearch
530530
Service.
531531
type: string
532+
awsAuthSecret:
533+
description: AWSAuthSecret Enable AWS Sigv4 Authentication for
534+
Amazon ElasticSearch Service.
535+
properties:
536+
valueFrom:
537+
description: ValueSource defines how to find a value's key.
538+
properties:
539+
secretKeyRef:
540+
description: Selects a key of a secret in the pod's namespace
541+
properties:
542+
key:
543+
description: The key of the secret to select from. Must
544+
be a valid secret key.
545+
type: string
546+
name:
547+
default: ""
548+
description: |-
549+
Name of the referent.
550+
This field is effectively required, but due to backwards compatibility is
551+
allowed to be empty. Instances of this type with an empty value here are
552+
almost certainly wrong.
553+
TODO: Add other useful fields. apiVersion, kind, uid?
554+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
555+
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
556+
type: string
557+
optional:
558+
description: Specify whether the Secret or its key
559+
must be defined
560+
type: boolean
561+
required:
562+
- key
563+
type: object
564+
x-kubernetes-map-type: atomic
565+
type: object
566+
type: object
532567
awsExternalID:
533568
description: External ID for the AWS IAM Role specified with aws_role_arn.
534569
type: string
@@ -556,6 +591,42 @@ spec:
556591
description: Specify the credentials to use to connect to Elastic's
557592
Elasticsearch Service running on Elastic Cloud.
558593
type: string
594+
cloudAuthSecret:
595+
description: CloudAuthSecret Specify the credentials to use to
596+
connect to Elastic's Elasticsearch Service running on Elastic
597+
Cloud.
598+
properties:
599+
valueFrom:
600+
description: ValueSource defines how to find a value's key.
601+
properties:
602+
secretKeyRef:
603+
description: Selects a key of a secret in the pod's namespace
604+
properties:
605+
key:
606+
description: The key of the secret to select from. Must
607+
be a valid secret key.
608+
type: string
609+
name:
610+
default: ""
611+
description: |-
612+
Name of the referent.
613+
This field is effectively required, but due to backwards compatibility is
614+
allowed to be empty. Instances of this type with an empty value here are
615+
almost certainly wrong.
616+
TODO: Add other useful fields. apiVersion, kind, uid?
617+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
618+
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
619+
type: string
620+
optional:
621+
description: Specify whether the Secret or its key
622+
must be defined
623+
type: boolean
624+
required:
625+
- key
626+
type: object
627+
x-kubernetes-map-type: atomic
628+
type: object
629+
type: object
559630
cloudID:
560631
description: If you are using Elastic's Elasticsearch Service
561632
you can specify the cloud_id of the cluster running.

config/crd/bases/fluentbit.fluent.io_clusteroutputs.yaml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,41 @@ spec:
529529
description: Enable AWS Sigv4 Authentication for Amazon ElasticSearch
530530
Service.
531531
type: string
532+
awsAuthSecret:
533+
description: AWSAuthSecret Enable AWS Sigv4 Authentication for
534+
Amazon ElasticSearch Service.
535+
properties:
536+
valueFrom:
537+
description: ValueSource defines how to find a value's key.
538+
properties:
539+
secretKeyRef:
540+
description: Selects a key of a secret in the pod's namespace
541+
properties:
542+
key:
543+
description: The key of the secret to select from. Must
544+
be a valid secret key.
545+
type: string
546+
name:
547+
default: ""
548+
description: |-
549+
Name of the referent.
550+
This field is effectively required, but due to backwards compatibility is
551+
allowed to be empty. Instances of this type with an empty value here are
552+
almost certainly wrong.
553+
TODO: Add other useful fields. apiVersion, kind, uid?
554+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
555+
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
556+
type: string
557+
optional:
558+
description: Specify whether the Secret or its key
559+
must be defined
560+
type: boolean
561+
required:
562+
- key
563+
type: object
564+
x-kubernetes-map-type: atomic
565+
type: object
566+
type: object
532567
awsExternalID:
533568
description: External ID for the AWS IAM Role specified with aws_role_arn.
534569
type: string
@@ -556,6 +591,42 @@ spec:
556591
description: Specify the credentials to use to connect to Elastic's
557592
Elasticsearch Service running on Elastic Cloud.
558593
type: string
594+
cloudAuthSecret:
595+
description: CloudAuthSecret Specify the credentials to use to
596+
connect to Elastic's Elasticsearch Service running on Elastic
597+
Cloud.
598+
properties:
599+
valueFrom:
600+
description: ValueSource defines how to find a value's key.
601+
properties:
602+
secretKeyRef:
603+
description: Selects a key of a secret in the pod's namespace
604+
properties:
605+
key:
606+
description: The key of the secret to select from. Must
607+
be a valid secret key.
608+
type: string
609+
name:
610+
default: ""
611+
description: |-
612+
Name of the referent.
613+
This field is effectively required, but due to backwards compatibility is
614+
allowed to be empty. Instances of this type with an empty value here are
615+
almost certainly wrong.
616+
TODO: Add other useful fields. apiVersion, kind, uid?
617+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
618+
TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
619+
type: string
620+
optional:
621+
description: Specify whether the Secret or its key
622+
must be defined
623+
type: boolean
624+
required:
625+
- key
626+
type: object
627+
x-kubernetes-map-type: atomic
628+
type: object
629+
type: object
559630
cloudID:
560631
description: If you are using Elastic's Elasticsearch Service
561632
you can specify the cloud_id of the cluster running.

0 commit comments

Comments
 (0)