Skip to content

Commit 813b5e5

Browse files
authored
docs: minor improvements (#217)
* docs: minor improvements * user-guide: fix authorization using k8s service account returning 403 instead of 200 Closes: #216
1 parent 1cd8e4b commit 813b5e5

10 files changed

+186
-183
lines changed

README.md

+25-23
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The Operator to install and manage the lifecycle of the [Kuadrant](https://githu
1818
* [If you are an <em>API Provider</em>](#if-you-are-an-api-provider)
1919
* [If you are a <em>Cluster Operator</em>](#if-you-are-a-cluster-operator)
2020
* [User guides](#user-guides)
21-
* [<a href="/doc/rate-limiting.md">Kuadrant Rate Limiting</a>](#kuadrant-rate-limiting)
21+
* [<a href="doc/rate-limiting.md">Kuadrant Rate Limiting</a>](#kuadrant-rate-limiting)
2222
* [Documentation](#documentation)
2323
* [Contributing](#contributing)
2424
* [Licensing](#licensing)
@@ -32,29 +32,30 @@ more reusable and leverage the underlying kubernetes platform. It aims to delive
3232
of applications & services when it comes to rate limiting, authentication, authorization, discoverability, change management, usage contracts, insights, etc.
3333

3434
Kuadrant aims to produce a set of loosely coupled functionalities built directly on top of Kubernetes.
35-
Furthermore it only strives to provide what Kubernetes doesn’t offer out of the box, i.e. Kuadrant won’t be designing a new Gateway/proxy,
35+
Furthermore, it only strives to provide what Kubernetes doesn’t offer out of the box, i.e. Kuadrant won’t be designing a new Gateway/proxy,
3636
instead it will opt to connect with what’s there and what’s being developed (think Envoy, Istio, GatewayAPI).
3737

3838
Kuadrant is a system of cloud-native k8s components that grows as users’ needs grow.
39+
3940
* From simple protection of a Service (via **AuthN**) that is used by teammates working on the same cluster, or “sibling” services, up to **AuthZ** of users using OIDC plus custom policies.
4041
* From no rate-limiting to rate-limiting for global service protection on to rate-limiting by users/plans
4142

4243
## Architecture
4344

4445
Kuadrant relies on [Istio](https://istio.io/) and the [Gateway API](https://gateway-api.sigs.k8s.io/)
45-
to operate the cluster (istio's) ingress gateway to provide API management with **authentication** (authN),
46+
to operate the cluster (Istio's) ingress gateway to provide API management with **authentication** (authN),
4647
**authorization** (authZ) and **rate limiting** capabilities.
4748

4849
### Kuadrant components
4950

50-
| CRD | Description |
51-
| --- |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
52-
| Control Plane | The control plane takes the customer desired configuration (declaratively as kubernetes custom resources) as input and ensures all components are configured to obey customer's desired behavior.<br> This repository contains the source code of the kuadrant control plane |
53-
| [Kuadrant Operator](https://github.com/Kuadrant/kuadrant-operator) | A Kubernetes Operator to manage the lifecycle of the kuadrant deployment |
54-
| [Authorino](https://github.com/Kuadrant/authorino) | The AuthN/AuthZ enforcer. As the [external istio authorizer](https://istio.io/latest/docs/tasks/security/authorization/authz-custom/) ([envoy external authorization](https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/ext_authz_filter) serving gRPC service) |
55-
| [Limitador](https://github.com/Kuadrant/limitador) | The external rate limiting service. It exposes a gRPC service implementing the [Envoy Rate Limit protocol (v3)](https://www.envoyproxy.io/docs/envoy/latest/api-v3/service/ratelimit/v3/rls.proto) |
56-
| [Authorino Operator](https://github.com/Kuadrant/authorino-operator) | A Kubernetes Operator to manage Authorino instances |
57-
| [Limitador Operator](https://github.com/Kuadrant/limitador-operator) | A Kubernetes Operator to manage Limitador instances |
51+
| CRD | Description |
52+
|----------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
53+
| Control Plane | The control plane takes the customer desired configuration (declaratively as kubernetes custom resources) as input and ensures all components are configured to obey customer's desired behavior.<br> This repository contains the source code of the kuadrant control plane |
54+
| [Kuadrant Operator](https://github.com/Kuadrant/kuadrant-operator) | A Kubernetes Operator to manage the lifecycle of the kuadrant deployment |
55+
| [Authorino](https://github.com/Kuadrant/authorino) | The AuthN/AuthZ enforcer. As the [external istio authorizer](https://istio.io/latest/docs/tasks/security/authorization/authz-custom/) ([envoy external authorization](https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/ext_authz_filter) serving gRPC service) |
56+
| [Limitador](https://github.com/Kuadrant/limitador) | The external rate limiting service. It exposes a gRPC service implementing the [Envoy Rate Limit protocol (v3)](https://www.envoyproxy.io/docs/envoy/latest/api-v3/service/ratelimit/v3/rls.proto) |
57+
| [Authorino Operator](https://github.com/Kuadrant/authorino-operator) | A Kubernetes Operator to manage Authorino instances |
58+
| [Limitador Operator](https://github.com/Kuadrant/limitador-operator) | A Kubernetes Operator to manage Limitador instances |
5859

5960
### Provided APIs
6061

@@ -86,7 +87,7 @@ Additionally, Kuadrant provides the following CRDs
8687

8788
### Installing Kuadrant
8889

89-
Installing Kuadrant is a two-step procedure. Firstly, install the Kuadrant Operator and seconly,
90+
Installing Kuadrant is a two-step procedure. Firstly, install the Kuadrant Operator and secondly,
9091
request a Kuadrant instance by creating a *Kuadrant* custom resource.
9192

9293
#### 1. Install the Kuadrant Operator
@@ -98,14 +99,14 @@ The Kuadrant Operator is available in public community operator catalogs, such a
9899
The operator is available from [OperatorHub.io](https://operatorhub.io/operator/kuadrant-operator).
99100
Just go to the linked page and follow installation steps (or just run these two commands):
100101

101-
```
102+
```sh
102103
# Install Operator Lifecycle Manager (OLM), a tool to help manage the operators running on your cluster.
103104

104-
$ curl -sL https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.23.1/install.sh | bash -s v0.23.1
105+
curl -sL https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.23.1/install.sh | bash -s v0.23.1
105106

106107
# Install the operator by running the following command:
107108

108-
$ kubectl create -f https://operatorhub.io/install/kuadrant-operator.yaml
109+
kubectl create -f https://operatorhub.io/install/kuadrant-operator.yaml
109110
```
110111

111112
**Openshift**
@@ -125,12 +126,13 @@ kubectl create namespace kuadrant
125126

126127
Apply the `Kuadrant` custom resource:
127128

128-
```yaml
129-
kubectl apply -n kuadrant -f -<<EOF
129+
```sh
130+
kubectl -n kuadrant apply -f - <<EOF
131+
---
130132
apiVersion: kuadrant.io/v1beta1
131133
kind: Kuadrant
132134
metadata:
133-
name: kuadrant
135+
name: kuadrant-sample
134136
spec: {}
135137
EOF
136138
```
@@ -142,16 +144,16 @@ EOF
142144
* Deploy the service/API to be protected ("Upstream")
143145
* Expose the service/API using the kubernetes Gateway API, ie
144146
[HTTPRoute](https://gateway-api.sigs.k8s.io/v1alpha2/references/spec/#gateway.networking.k8s.io/v1beta1.HTTPRoute) object.
145-
* Write and apply the Kuadrant's [RateLimitPolicy](/doc/rate-limiting.md) and/or
146-
[AuthPolicy](apis/apim/v1alpha1/authpolicy_types.go) custom resources targeting the HTTPRoute resource
147+
* Write and apply the Kuadrant's [RateLimitPolicy](doc/rate-limiting.md) and/or
148+
[AuthPolicy](api/v1beta1/authpolicy_types.go) custom resources targeting the HTTPRoute resource
147149
to have your API protected.
148150

149151
#### If you are a *Cluster Operator*
150152

151153
* (Optionally) deploy istio ingress gateway using the
152154
[Gateway](https://gateway-api.sigs.k8s.io/v1alpha2/references/spec/#gateway.networking.k8s.io/v1beta1.Gateway) resource.
153-
* Write and apply the Kuadrant's [RateLimitPolicy](/doc/rate-limiting.md) and/or
154-
[AuthPolicy](apis/apim/v1alpha1/authpolicy_types.go) custom resources targeting the Gateway resource
155+
* Write and apply the Kuadrant's [RateLimitPolicy](doc/rate-limiting.md) and/or
156+
[AuthPolicy](api/v1beta1/authpolicy_types.go) custom resources targeting the Gateway resource
155157
to have your gateway traffic protected.
156158

157159
## User guides
@@ -163,7 +165,7 @@ The user guides section of the docs gathers several use-cases as well as the ins
163165
* [Gateway rate limiting for cluster operators](doc/user-guides/gateway-rl-for-cluster-operators.md)
164166
* [Authenticated rate limiting with JWTs and Kubernetes authnz](doc/user-guides/authenticated-rl-with-jwt-and-k8s-authnz.md)
165167

166-
## [Kuadrant Rate Limiting](/doc/rate-limiting.md)
168+
## [Kuadrant Rate Limiting](doc/rate-limiting.md)
167169

168170
## Documentation
169171

doc/development.md

+19-20
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* [Build custom OLM catalog](#build-custom-olm-catalog)
1010
* [Build kuadrant operator bundle image](#build-kuadrant-operator-bundle-image)
1111
* [Build custom catalog](#build-custom-catalog)
12-
* [Deploy kuadrant operator using OLM](#deploy-kuadrant-operator-using-olm-1)
1312
* [Cleaning up](#cleaning-up)
1413
* [Run tests](#run-tests)
1514
* [Unit tests](#unittests)
@@ -89,9 +88,9 @@ make install-olm
8988

9089
Deploy kuadrant using OLM. The `make deploy-catalog` target accepts the following variables:
9190

92-
| **Makefile Variable** | **Description** | **Default value** |
93-
| --- | --- | --- |
94-
| `CATALOG_IMG` | Kuadrant operator catalog image URL | `quay.io/kuadrant/kuadrant-operator-catalog:latest` |
91+
| **Makefile Variable** | **Description** | **Default value** |
92+
|-----------------------|-------------------------------------|-----------------------------------------------------|
93+
| `CATALOG_IMG` | Kuadrant operator catalog image URL | `quay.io/kuadrant/kuadrant-operator-catalog:latest` |
9594

9695
```sh
9796
make deploy-catalog [CATALOG_IMG=quay.io/kuadrant/kuadrant-operator-catalog:latest]
@@ -130,27 +129,27 @@ make bundle [IMG=quay.io/kuadrant/kuadrant-operator:latest] \
130129

131130
* Build the bundle image from the manifests
132131

133-
| **Makefile Variable** | **Description** | **Default value** |
134-
| --- | --- | --- |
135-
| `BUNDLE_IMG` | Kuadrant operator bundle image URL | `quay.io/kuadrant/kuadrant-operator-bundle:latest` |
132+
| **Makefile Variable** | **Description** | **Default value** |
133+
|-----------------------|------------------------------------|----------------------------------------------------|
134+
| `BUNDLE_IMG` | Kuadrant operator bundle image URL | `quay.io/kuadrant/kuadrant-operator-bundle:latest` |
136135

137136
```sh
138137
make bundle-build [BUNDLE_IMG=quay.io/kuadrant/kuadrant-operator-bundle:latest]
139138
```
140139

141140
* Push the bundle image to a registry
142141

143-
| **Makefile Variable** | **Description** | **Default value** |
144-
| --- | --- | --- |
145-
| `BUNDLE_IMG` | Kuadrant operator bundle image URL | `quay.io/kuadrant/kuadrant-operator-bundle:latest` |
142+
| **Makefile Variable** | **Description** | **Default value** |
143+
|-----------------------|------------------------------------|----------------------------------------------------|
144+
| `BUNDLE_IMG` | Kuadrant operator bundle image URL | `quay.io/kuadrant/kuadrant-operator-bundle:latest` |
146145

147146
```sh
148147
make bundle-push [BUNDLE_IMG=quay.io/kuadrant/kuadrant-operator-bundle:latest]
149148
```
150149

151150
Frequently, you may need to build custom kuadrant bundle with the default (`latest`) Limitador and
152151
Authorino bundles. These are the example commands to build the manifests, build the bundle image
153-
and push to the regitry.
152+
and push to the registry.
154153

155154
In the example, a new kuadrant operator bundle version `0.8.0` will be created that references
156155
the kuadrant operator image `quay.io/kuadrant/kuadrant-operator:v0.5.0` and latest Limitador and
@@ -169,17 +168,17 @@ make bundle-push BUNDLE_IMG=quay.io/kuadrant/kuadrant-operator-bundle:my-bundle
169168

170169
### Build custom catalog
171170

172-
The catalog's format will be [File-based Catalg](https://olm.operatorframework.io/docs/reference/file-based-catalogs/).
171+
The catalog's format will be [File-based Catalog](https://olm.operatorframework.io/docs/reference/file-based-catalogs/).
173172

174173
Make sure all the required bundles are pushed to the registry. It is required by the `opm` tool.
175174

176175
The `make catalog` target accepts the following variables:
177176

178-
| **Makefile Variable** | **Description** | **Default value** |
179-
| --- | --- | --- |
180-
| `BUNDLE_IMG` | Kuadrant operator bundle image URL | `quay.io/kuadrant/kuadrant-operator-bundle:latest` |
181-
| `LIMITADOR_OPERATOR_BUNDLE_IMG` | Limitador operator bundle URL | `quay.io/kuadrant/limitador-operator-bundle:latest` |
182-
| `AUTHORINO_OPERATOR_BUNDLE_IMG` | Authorino operator bundle URL | `quay.io/kuadrant/authorino-operator-bundle:latest` |
177+
| **Makefile Variable** | **Description** | **Default value** |
178+
|---------------------------------|------------------------------------|-----------------------------------------------------|
179+
| `BUNDLE_IMG` | Kuadrant operator bundle image URL | `quay.io/kuadrant/kuadrant-operator-bundle:latest` |
180+
| `LIMITADOR_OPERATOR_BUNDLE_IMG` | Limitador operator bundle URL | `quay.io/kuadrant/limitador-operator-bundle:latest` |
181+
| `AUTHORINO_OPERATOR_BUNDLE_IMG` | Authorino operator bundle URL | `quay.io/kuadrant/authorino-operator-bundle:latest` |
183182

184183
```sh
185184
make catalog [BUNDLE_IMG=quay.io/kuadrant/kuadrant-operator-bundle:latest] \
@@ -189,9 +188,9 @@ make catalog [BUNDLE_IMG=quay.io/kuadrant/kuadrant-operator-bundle:latest] \
189188

190189
* Build the catalog image from the manifests
191190

192-
| **Makefile Variable** | **Description** | **Default value** |
193-
| --- | --- | --- |
194-
| `CATALOG_IMG` | Kuadrant operator catalog image URL | `quay.io/kuadrant/kuadrant-operator-catalog:latest` |
191+
| **Makefile Variable** | **Description** | **Default value** |
192+
|-----------------------|-------------------------------------|-----------------------------------------------------|
193+
| `CATALOG_IMG` | Kuadrant operator catalog image URL | `quay.io/kuadrant/kuadrant-operator-catalog:latest` |
195194

196195
```sh
197196
make catalog-build [CATALOG_IMG=quay.io/kuadrant/kuadrant-operator-catalog:latest]

doc/logging.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Logging
22

33
The kuadrant operator outputs 3 levels of log messages: (from lowest to highest level)
4+
45
1. `debug`
56
2. `info` (default)
67
3. `error`
@@ -12,6 +13,7 @@ Only `debug` logging will include processing details.
1213
To configure the desired log level, set the environment variable `LOG_LEVEL` to one of the supported values listed above. Default log level is `info`.
1314

1415
Apart from log level, the operator can output messages to the logs in 2 different formats:
16+
1517
- `production` (default): each line is a parseable JSON object with properties `{"level":string, "ts":int, "msg":string, "logger":string, extra values...}`
1618
- `development`: more human-readable outputs, extra stack traces and logging info, plus extra values output as JSON, in the format: `<timestamp-iso-8601>\t<log-level>\t<logger>\t<message>\t{extra-values-as-json}`
1719

doc/proposals/authpolicy-crd.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ The new [GatewayAPI](https://gateway-api.sigs.k8s.io/) defines a standard [polic
99
## Goals
1010

1111
With `targetRef` from policy attachment concept, following are the goals:
12-
- Application developer should be able target [`HTTPRoute`](https://gateway-api.sigs.k8s.io/v1alpha2/references/spec/#gateway.networking.k8s.io/v1alpha2.HTTPRoute) object in their own namespace. This will define authorization policy at the hostname/domain/vHost level.
12+
- Application developer should be able to target [`HTTPRoute`](https://gateway-api.sigs.k8s.io/v1alpha2/references/spec/#gateway.networking.k8s.io/v1alpha2.HTTPRoute) object in their own namespace. This will define authorization policy at the hostname/domain/vHost level.
1313
- Cluster operator should be able to target [`Gateway`](https://gateway-api.sigs.k8s.io/v1alpha2/references/spec/#gateway.networking.k8s.io/v1alpha2.Gateway) object along with HTTPRoute in the gateway's namespace. This will define policy at the <ins>listener</ins> level.
1414
- To reduce context sharing at the gateway and external authorization provider, action type and auth-provider are defaulted to `CUSTOM` and authorino respectively.
1515

1616
## Proposed Solution
1717
Following is the proposed new CRD that combines policy attachment concepts with Istio's AuthorizationPolicy:
1818

19-
```yaml=
19+
```yaml
2020
apiVersion: kuadrant.io/v1beta1
2121
kind: AuthPolicy
2222
metadata:
@@ -50,7 +50,7 @@ status:
5050
reason: HTTPRouteProtected/GatewayProtected/Error
5151
status: "True" | "False"
5252
type: Available
53-
observedGeneration: 1
53+
observedGeneration: 1
5454
```
5555
5656
### Target Reference
@@ -84,7 +84,7 @@ status:
8484
- `methods`: a method matches over request method like `DELETE`.
8585
8686
Fields in a rule object are ANDed together but inner fields follow OR semantics. For example,
87-
```
87+
```yaml
8888
hosts: ["*.toystore.com"]
8989
methods: ["GET", "POST"]
9090
paths: ["/admin"]
@@ -100,7 +100,7 @@ AuthScheme is embedded form of [Authorino's AuthConfig](https://github.com/Kuadr
100100

101101
The example AuthPolicy showed above will create the following AuthConfig:
102102

103-
```yaml=
103+
```yaml
104104
apiVersion: authorino.kuadrant.io/v1beta1
105105
kind: AuthConfig
106106
metadata:

0 commit comments

Comments
 (0)