Skip to content

Commit c664a6a

Browse files
authored
Kinesis refactor (#226)
* - fix manifests generator * - example * - format fix * - Crd update
1 parent 720d47a commit c664a6a

File tree

10 files changed

+1438
-20
lines changed

10 files changed

+1438
-20
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ deploy: manifests
8484

8585
# Generate manifests e.g. CRD, RBAC etc.
8686
manifests: controller-gen
87-
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
87+
cd pkg/sdk && $(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=../../config/crd/bases output:webhook:artifacts:config=../../config/webhook
8888

8989
# Run go fmt against code
9090
fmt:

charts/logging-operator/templates/logging.banzaicloud.io_clusteroutputs.yaml

Lines changed: 347 additions & 0 deletions
Large diffs are not rendered by default.

charts/logging-operator/templates/logging.banzaicloud.io_outputs.yaml

Lines changed: 347 additions & 0 deletions
Large diffs are not rendered by default.

config/crd/bases/logging.banzaicloud.io_clusteroutputs.yaml

Lines changed: 347 additions & 0 deletions
Large diffs are not rendered by default.

config/crd/bases/logging.banzaicloud.io_outputs.yaml

Lines changed: 347 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: logging.banzaicloud.io/v1beta1
2+
kind: Output
3+
metadata:
4+
name: cloudwatch-output
5+
namespace: logging
6+
spec:
7+
cloudwatch:
8+
aws_key_id:
9+
valueFrom:
10+
secretKeyRef:
11+
name: logging-s3
12+
key: awsAccessKeyId
13+
aws_sec_key:
14+
valueFrom:
15+
secretKeyRef:
16+
name: logging-s3
17+
key: awsSecretAccesKey
18+
stream_name: operator-log-stream
19+
region: us-east-1
20+
auto_create_stream: true
21+
buffer:
22+
timekey: 30s
23+
timekey_wait: 30s
24+
timekey_use_utc: true

docs/plugins/outputs/kinesis_stream.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
```
77
spec:
88
kinesisStream:
9-
streamName: example-stream-name
9+
stream_name: example-stream-name
1010
region: us-east-1
1111
format:
1212
type: json
@@ -18,7 +18,7 @@
1818

1919
| Variable Name | Type | Required | Default | Description |
2020
|---|---|---|---|---|
21-
| kinesisStream | string | Yes | - | Name of the stream to put data.<br> |
21+
| stream_name | string | Yes | - | Name of the stream to put data.<br> |
2222
| partition_key | string | No | - | A key to extract partition key from JSON object. Default nil, which means partition key will be generated randomly.<br> |
2323
| aws_key_id | *secret.Secret | No | - | AWS access key id. This parameter is required when your agent is not running on EC2 instance with an IAM Role.<br> |
2424
| aws_sec_key | *secret.Secret | No | - | AWS secret key. This parameter is required when your agent is not running on EC2 instance with an IAM Role.<br> |
@@ -30,7 +30,7 @@
3030
| reset_backoff_if_success | bool | No | - | Boolean, default true. If enabled, when after retrying, the next retrying checks the number of succeeded records on the former batch request and reset exponential backoff if there is any success. Because batch request could be composed by requests across shards, simple exponential backoff for the batch request wouldn't work some cases.<br> |
3131
| batch_request_max_count | int | No | - | Integer, default 500. The number of max count of making batch request from record chunk. It can't exceed the default value because it's API limit.<br> |
3232
| batch_request_max_size | int | No | - | Integer. The number of max size of making batch request from record chunk. It can't exceed the default value because it's API limit.<br> |
33-
| format | *Format | Yes | - | [Format](./format.md)<br> |
33+
| format | *Format | No | - | [Format](./format.md)<br> |
3434
| buffer | *Buffer | No | - | [Buffer](./buffer.md)<br> |
3535
### Assume Role Credentials
3636
#### assume_role_credentials

pkg/sdk/api/v1beta1/output_types.go

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,20 @@ import (
2121

2222
// OutputSpec defines the desired state of Output
2323
type OutputSpec struct {
24-
LoggingRef string `json:"loggingRef,omitempty"`
25-
S3OutputConfig *output.S3OutputConfig `json:"s3,omitempty"`
26-
AzureStorage *output.AzureStorage `json:"azurestorage,omitempty"`
27-
GCSOutput *output.GCSOutput `json:"gcs,omitempty"`
28-
OSSOutput *output.OSSOutput `json:"oss,omitempty"`
29-
ElasticsearchOutput *output.ElasticsearchOutput `json:"elasticsearch,omitempty"`
30-
LokiOutput *output.LokiOutput `json:"loki,omitempty"`
31-
SumologicOutput *output.SumologicOutput `json:"sumologic,omitempty"`
32-
ForwardOutput *output.ForwardOutput `json:"forward,omitempty"`
33-
FileOutput *output.FileOutputConfig `json:"file,omitempty"`
34-
NullOutputConfig *output.NullOutputConfig `json:"nullout,omitempty"`
35-
KafkaOutputConfig *output.KafkaOutputConfig `json:"kafka,omitempty"`
36-
CloudWatchOutput *output.CloudWatchOutput `json:"cloudwatch,omitempty"`
24+
LoggingRef string `json:"loggingRef,omitempty"`
25+
S3OutputConfig *output.S3OutputConfig `json:"s3,omitempty"`
26+
AzureStorage *output.AzureStorage `json:"azurestorage,omitempty"`
27+
GCSOutput *output.GCSOutput `json:"gcs,omitempty"`
28+
OSSOutput *output.OSSOutput `json:"oss,omitempty"`
29+
ElasticsearchOutput *output.ElasticsearchOutput `json:"elasticsearch,omitempty"`
30+
LokiOutput *output.LokiOutput `json:"loki,omitempty"`
31+
SumologicOutput *output.SumologicOutput `json:"sumologic,omitempty"`
32+
ForwardOutput *output.ForwardOutput `json:"forward,omitempty"`
33+
FileOutput *output.FileOutputConfig `json:"file,omitempty"`
34+
NullOutputConfig *output.NullOutputConfig `json:"nullout,omitempty"`
35+
KafkaOutputConfig *output.KafkaOutputConfig `json:"kafka,omitempty"`
36+
CloudWatchOutput *output.CloudWatchOutput `json:"cloudwatch,omitempty"`
37+
KinesisStreamOutputConfig *output.KinesisStreamOutputConfig `json:"kinesisStream,omitempty"`
3738
}
3839

3940
// OutputStatus defines the observed state of Output

pkg/sdk/api/v1beta1/zz_generated.deepcopy.go

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

pkg/sdk/model/output/kinesis_stream.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
// ```
2727
// spec:
2828
// kinesisStream:
29-
// streamName: example-stream-name
29+
// stream_name: example-stream-name
3030
// region: us-east-1
3131
// format:
3232
// type: json
@@ -39,7 +39,7 @@ type _docKinesisStream interface{}
3939
type KinesisStreamOutputConfig struct {
4040

4141
// Name of the stream to put data.
42-
KinesisStream string `json:"kinesisStream"`
42+
StreamName string `json:"stream_name"`
4343

4444
// A key to extract partition key from JSON object. Default nil, which means partition key will be generated randomly.
4545
PartitionKey string `json:"partition_key,omitempty"`
@@ -75,7 +75,7 @@ type KinesisStreamOutputConfig struct {
7575
BatchRequestMaxSize int `json:"batch_request_max_size,omitempty"`
7676

7777
// +docLink:"Format,./format.md"
78-
Format *Format `json:"format"`
78+
Format *Format `json:"format,omitempty"`
7979
// +docLink:"Buffer,./buffer.md"
8080
Buffer *Buffer `json:"buffer,omitempty"`
8181
}

0 commit comments

Comments
 (0)