-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
420 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
# kubernetes | ||
|
||
streams kubernetes objects for one or more configured watches | ||
|
||
**Examples** | ||
```yaml | ||
input: | ||
type: kubernetes | ||
plugin: | ||
watches: | ||
# watch pods in all namespaces | ||
- group: "" | ||
version: v1 | ||
kind: Pod | ||
# watch custom resources in specified namespaces | ||
- group: example.com | ||
version: v1alpha1 | ||
kind: Foo | ||
namespaces: [default, kube-system] | ||
# watch custom resources that match a label selector | ||
- group: example.com | ||
version: v1apha1 | ||
kind: Bar | ||
selector: | ||
matchLabels: | ||
color: blue | ||
matchExpressions: | ||
- key: color | ||
operator: NotIn | ||
values: [green, yellow] | ||
# watch replica sets and reconcile when their pods are modified | ||
- version: v1 | ||
kind: ReplicaSet | ||
owns: | ||
- version: v1 | ||
kind: Pod | ||
``` | ||
## Fields | ||
`group` | ||
|
||
resource group | ||
|
||
Type: `string` | ||
Default: `""` | ||
|
||
`kind` | ||
|
||
resource kind | ||
|
||
Type: `string` | ||
Default: `""` | ||
|
||
`version` | ||
|
||
resource version | ||
|
||
Type: `string` | ||
Default: `""` | ||
|
||
`namespaces` | ||
|
||
optional namespace filter | ||
|
||
Type: `[]string` | ||
|
||
`owns` | ||
|
||
optional list of dependencies to watch | ||
|
||
Type: `[]object({group: string, version: string, kind: string })` | ||
|
||
`selector` | ||
|
||
optional label selector | ||
|
||
Type: `object` | ||
|
||
`selector.matchLabels` | ||
|
||
optional label selector match requirements | ||
|
||
Type: `object` | ||
|
||
`selector.matchExpressions` | ||
|
||
optional label selector match expressions | ||
|
||
Type: `object({key: string, operator: string, values: []string})` | ||
|
||
|
||
## Metadata | ||
|
||
This input adds the following metadata fields to each message: | ||
|
||
``` | ||
- deleted (present only if object has been deleted) | ||
- group | ||
- kind | ||
- name | ||
- namespace | ||
- version | ||
``` | ||
|
||
## Synchronous Responses | ||
|
||
Additionally, this input will check for a `requeue_after` metadata entry on [synchronous response](https://www.benthos.dev/docs/guides/sync_responses) messages, and if found, will requeue the object for reconciliation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# kubernetes | ||
|
||
creates, updates, and deleted kubernetes objects based | ||
|
||
This output will perform the following actions for all message parts: | ||
- fail if the payload is not a valid kubernetes object | ||
- delete the object if a `deleted` metadata key is present | ||
- update the object if a `uid` is present | ||
- create the object if no `uid` is present | ||
|
||
**Examples** | ||
```yaml | ||
input: | ||
type: kubernetes | ||
plugin: | ||
watches: | ||
- group: example.com | ||
version: v1alpha1 | ||
kind: Foo | ||
|
||
pipeline: | ||
processors: | ||
- bloblang: | | ||
root = match { | ||
meta().exists("deleted") => deleted() | ||
} | ||
output: | ||
type: kubernetes | ||
plugin: {} | ||
processors: | ||
- bloblang: | | ||
map finalizer { | ||
root = this | ||
metadata.finalizers = metadata.finalizers.append("finalizer.foos.example.com") | ||
} | ||
root = match { | ||
metadata.finalizers.or([]).contains("finalizer.foos.example.com") => deleted() | ||
_ => this.apply("finalizer") | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# kubernetes | ||
|
||
performs operations against a kubernetes cluster | ||
|
||
## Fields | ||
|
||
`operator` | ||
|
||
specifies the kubernetes client operation to perform | ||
|
||
Type: `string` | ||
Options: `create`, `datele`, `get`, `update` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# kubernetes_status | ||
|
||
updates a kubernetes object's status subresource | ||
|
||
**Examples** | ||
```yaml | ||
input: | ||
type: kubernetes | ||
plugin: | ||
watches: | ||
- group: example.com | ||
version: v1alpha1 | ||
kind: Foo | ||
|
||
pipeline: | ||
processors: | ||
- bloblang: | | ||
root = match { | ||
meta().exists("deleted") => deleted() | ||
} | ||
output: | ||
type: kubernetes_status | ||
plugin: {} | ||
processors: | ||
- bloblang: | | ||
root = this | ||
status.observedGeneration = metadata.generation | ||
status.lastReconciledAt = timestamp_utc("2006-01-02T15:04:05.000000000Z") | ||
status.status = if metadata.exists("deletionTimestamp") { | ||
"Destroying" | ||
} else { | ||
"Reconciling" | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.