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(kumacp): mesh access log - proto + validation #4998

Merged
merged 27 commits into from
Sep 15, 2022
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
24c8bf3
feat(kumacp): bootstrap new policy
slonka Sep 13, 2022
aae1085
feat(kumacp): modify policy
slonka Sep 13, 2022
a9c4a73
feat(kumacp): update madr formats
slonka Sep 13, 2022
e871718
feat(kumacp): make full mesh access log example pass validator
slonka Sep 13, 2022
10096a0
feat(kumacp): more validations
slonka Sep 13, 2022
a5d9cfb
feat(kumacp): more validations
slonka Sep 13, 2022
af672ba
feat(kumacp): more validations - tcp and reference
slonka Sep 13, 2022
6e738fc
feat(kumacp): more validations - to and mesh gateway route
slonka Sep 13, 2022
b49d532
feat(kumacp): more validations - default must be defined
slonka Sep 13, 2022
6d986d1
feat(kumacp): update madr
slonka Sep 13, 2022
bc3f09a
feat(kumacp): make check pass
slonka Sep 13, 2022
8f47948
feat(kumacp): make check pass
slonka Sep 13, 2022
d10ea43
feat(kumacp): make policies stable
slonka Sep 13, 2022
14f0759
feat(kumacp): make check pass
slonka Sep 13, 2022
d5a86ab
feat(kumacp): update golden files
slonka Sep 13, 2022
dd9b3c4
feat(kumacp): skip registration
slonka Sep 13, 2022
cb8f771
feat(kumacp): skip registration 2
slonka Sep 13, 2022
98f71c0
Apply suggestions from code review
slonka Sep 14, 2022
4d17bd1
feat(kumacp): fix typos in test assertions
slonka Sep 14, 2022
e6f55e6
feat(kumacp): rename mesh access log types
slonka Sep 14, 2022
d16bcb4
feat(kumacp): change skip_registration to false
slonka Sep 14, 2022
0ae60d7
feat(kumacp): update golden files
slonka Sep 14, 2022
39a475d
feat(kumacp): add validations for file and tcp backend
slonka Sep 14, 2022
08c9767
feat(kumacp): add validation for reference
slonka Sep 14, 2022
99b4203
feat(kumacp): remove reference since it's not for this stage, this co…
slonka Sep 14, 2022
ec79f37
feat(kumacp): make check pass
slonka Sep 14, 2022
b20824e
feat(kumacp): update golden files
slonka Sep 14, 2022
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
274 changes: 274 additions & 0 deletions deployments/charts/kuma/crds/kuma.io_meshaccesslogs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,274 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
name: meshaccesslogs.kuma.io
spec:
group: kuma.io
names:
categories:
- kuma
kind: MeshAccessLog
listKind: MeshAccessLogList
plural: meshaccesslogs
singular: meshaccesslog
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: Spec is the specification of the Kuma MeshAccessLog resource.
properties:
from:
description: From is a list of pairs – a group of clients and action
applied for it
items:
properties:
default:
description: Default is a configuration specific to the group
of clients referenced in 'targetRef'
properties:
backends:
items:
properties:
file:
description: FileBackend defines configuration for
file based access logs
properties:
format:
description: Format of access logs. Placeholders
available on https://www.envoyproxy.io/docs/envoy/latest/configuration/observability/access_log
properties:
json:
items:
properties:
key:
type: string
value:
type: string
type: object
type: array
plain:
type: string
type: object
path:
description: Path to a file that logs will be
written to
type: string
type: object
reference:
properties:
kind:
type: string
name:
type: string
type: object
tcp:
description: Backend defines logging backend.
properties:
address:
description: Type of the backend (Kuma ships with
'tcp' and 'file')
type: string
format:
description: Format of access logs. Placeholders
available on https://www.envoyproxy.io/docs/envoy/latest/configuration/observability/access_log
properties:
json:
items:
properties:
key:
type: string
value:
type: string
type: object
type: array
plain:
type: string
type: object
type: object
type: object
type: array
type: object
targetRef:
description: TargetRef is a reference to the resource that represents
a group of clients.
properties:
kind:
description: Kind of the referenced resource
enum:
- Mesh
- MeshSubset
- MeshService
- MeshServiceSubset
- MeshGatewayRoute
- MeshHTTPRoute
type: string
mesh:
description: Mesh is used with MeshService and MeshServiceSubset
to identify the service from another mesh. Could be useful
when implementing policies with cross-mesh support.
type: string
name:
description: Name of the referenced resource
type: string
tags:
additionalProperties:
type: string
description: Tags are used with MeshSubset and MeshServiceSubset
to define a subset of proxies
type: object
type: object
type: object
type: array
targetRef:
description: TargetRef is a reference to the resource the policy takes
an effect on. The resource could be either a real store object or
virtual resource defined inplace.
properties:
kind:
description: Kind of the referenced resource
enum:
- Mesh
- MeshSubset
- MeshService
- MeshServiceSubset
- MeshGatewayRoute
- MeshHTTPRoute
type: string
mesh:
description: Mesh is used with MeshService and MeshServiceSubset
to identify the service from another mesh. Could be useful when
implementing policies with cross-mesh support.
type: string
name:
description: Name of the referenced resource
type: string
tags:
additionalProperties:
type: string
description: Tags are used with MeshSubset and MeshServiceSubset
to define a subset of proxies
type: object
type: object
to:
items:
properties:
default:
description: Default is a configuration specific to the group
of clients referenced in 'targetRef'
properties:
backends:
items:
properties:
file:
description: FileBackend defines configuration for
file based access logs
properties:
format:
description: Format of access logs. Placeholders
available on https://www.envoyproxy.io/docs/envoy/latest/configuration/observability/access_log
properties:
json:
items:
properties:
key:
type: string
value:
type: string
type: object
type: array
plain:
type: string
type: object
path:
description: Path to a file that logs will be
written to
type: string
type: object
reference:
properties:
kind:
type: string
name:
type: string
type: object
tcp:
description: Backend defines logging backend.
properties:
address:
description: Type of the backend (Kuma ships with
'tcp' and 'file')
type: string
format:
description: Format of access logs. Placeholders
available on https://www.envoyproxy.io/docs/envoy/latest/configuration/observability/access_log
properties:
json:
items:
properties:
key:
type: string
value:
type: string
type: object
type: array
plain:
type: string
type: object
type: object
type: object
type: array
type: object
targetRef:
description: TargetRef is a reference to the resource that represents
a group of clients.
properties:
kind:
description: Kind of the referenced resource
enum:
- Mesh
- MeshSubset
- MeshService
- MeshServiceSubset
- MeshGatewayRoute
- MeshHTTPRoute
type: string
mesh:
description: Mesh is used with MeshService and MeshServiceSubset
to identify the service from another mesh. Could be useful
when implementing policies with cross-mesh support.
type: string
name:
description: Name of the referenced resource
type: string
tags:
additionalProperties:
type: string
description: Tags are used with MeshSubset and MeshServiceSubset
to define a subset of proxies
type: object
type: object
type: object
type: array
type: object
type: object
served: true
storage: true
1 change: 1 addition & 0 deletions deployments/charts/kuma/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -690,4 +690,5 @@ experimental:
# @ignored for helm-docs
plugins:
policies:
- meshaccesslogs
- meshtrafficpermissions
2 changes: 2 additions & 0 deletions docs/generated/cmd/kumactl/kumactl_get.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ Show Kuma resources.
* [kumactl get healthcheck](kumactl_get_healthcheck.md) - Show a single HealthCheck resource
* [kumactl get healthchecks](kumactl_get_healthchecks.md) - Show HealthCheck
* [kumactl get mesh](kumactl_get_mesh.md) - Show a single Mesh resource
* [kumactl get meshaccesslog](kumactl_get_meshaccesslog.md) - Show a single MeshAccessLog resource
* [kumactl get meshaccesslogs](kumactl_get_meshaccesslogs.md) - Show MeshAccessLog
* [kumactl get meshes](kumactl_get_meshes.md) - Show Mesh
* [kumactl get meshgateway](kumactl_get_meshgateway.md) - Show a single MeshGateway resource
* [kumactl get meshgatewayroute](kumactl_get_meshgatewayroute.md) - Show a single MeshGatewayRoute resource
Expand Down
33 changes: 33 additions & 0 deletions docs/generated/cmd/kumactl/kumactl_get_meshaccesslog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## kumactl get meshaccesslog

Show a single MeshAccessLog resource

### Synopsis

Show a single MeshAccessLog resource.

```
kumactl get meshaccesslog NAME [flags]
```

### Options

```
-h, --help help for meshaccesslog
-m, --mesh string mesh to use (default "default")
```

### Options inherited from parent commands

```
--api-timeout duration the timeout for api calls. It includes connection time, any redirects, and reading the response body. A timeout of zero means no timeout (default 1m0s)
--config-file string path to the configuration file to use
--log-level string log level: one of off|info|debug (default "off")
--no-config if set no config file and config directory will be created
-o, --output string output format: one of table|yaml|json (default "table")
```

### SEE ALSO

* [kumactl get](kumactl_get.md) - Show Kuma resources

35 changes: 35 additions & 0 deletions docs/generated/cmd/kumactl/kumactl_get_meshaccesslogs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## kumactl get meshaccesslogs

Show MeshAccessLog

### Synopsis

Show MeshAccessLog entities.

```
kumactl get meshaccesslogs [flags]
```

### Options

```
-h, --help help for meshaccesslogs
-m, --mesh string mesh to use (default "default")
--offset string the offset that indicates starting element of the resources list to retrieve
--size int maximum number of elements to return
```

### Options inherited from parent commands

```
--api-timeout duration the timeout for api calls. It includes connection time, any redirects, and reading the response body. A timeout of zero means no timeout (default 1m0s)
--config-file string path to the configuration file to use
--log-level string log level: one of off|info|debug (default "off")
--no-config if set no config file and config directory will be created
-o, --output string output format: one of table|yaml|json (default "table")
```

### SEE ALSO

* [kumactl get](kumactl_get.md) - Show Kuma resources

1 change: 1 addition & 0 deletions docs/generated/cmd/kumactl/kumactl_inspect.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Inspect Kuma resources.
* [kumactl inspect dataplanes](kumactl_inspect_dataplanes.md) - Inspect Dataplanes
* [kumactl inspect fault-injection](kumactl_inspect_fault-injection.md) - Inspect FaultInjection
* [kumactl inspect healthcheck](kumactl_inspect_healthcheck.md) - Inspect HealthCheck
* [kumactl inspect meshaccesslog](kumactl_inspect_meshaccesslog.md) - Inspect MeshAccessLog
* [kumactl inspect meshes](kumactl_inspect_meshes.md) - Inspect Meshes
* [kumactl inspect meshgateway](kumactl_inspect_meshgateway.md) - Inspect MeshGateway
* [kumactl inspect meshtrafficpermission](kumactl_inspect_meshtrafficpermission.md) - Inspect MeshTrafficPermission
Expand Down
Loading