Skip to content

Commit

Permalink
Add better information for OperatorHub (#330)
Browse files Browse the repository at this point in the history
* Add description

* Update CRDs versions and samples in CSV

* Enhance CRDs descriptions

---------

Co-authored-by: Grzegorz Piotrowski <[email protected]>
  • Loading branch information
alexsnaps and grzpiotrowski authored Nov 27, 2023
1 parent 2740b79 commit 77ee696
Show file tree
Hide file tree
Showing 15 changed files with 88 additions and 55 deletions.
2 changes: 1 addition & 1 deletion api/v1beta1/kuadrant_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (r *KuadrantStatus) Equals(other *KuadrantStatus, logger logr.Logger) bool
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status

// Kuadrant is the Schema for the kuadrants API
// Kuadrant configures installations of Kuadrant Service Protection components
type Kuadrant struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
2 changes: 2 additions & 0 deletions api/v1beta2/authpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ func (s *AuthPolicyStatus) Equals(other *AuthPolicyStatus, logger logr.Logger) b
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:metadata:labels="gateway.networking.k8s.io/policy=direct"

// AuthPolicy enables authentication and authorization for service workloads in a Gateway API network
type AuthPolicy struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
3 changes: 2 additions & 1 deletion api/v1beta2/ratelimitpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,11 @@ func (s *RateLimitPolicyStatus) Equals(other *RateLimitPolicyStatus, logger logr
return true
}

// RateLimitPolicy is the Schema for the ratelimitpolicies API
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:metadata:labels="gateway.networking.k8s.io/policy=direct"

// RateLimitPolicy enables rate limiting for service workloads in a Gateway API network
type RateLimitPolicy struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
43 changes: 39 additions & 4 deletions bundle/manifests/kuadrant-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,34 @@ metadata:
},
"spec": {}
},
{
"apiVersion": "kuadrant.io/v1beta2",
"kind": "AuthPolicy",
"metadata": {
"name": "toystore"
},
"spec": {
"rules": {
"authentication": {
"apikey": {
"apiKey": {
"selector": {}
}
},
"credentials": {
"authorizationHeader": {
"prefix": "APIKEY"
}
}
}
},
"targetRef": {
"group": "gateway.networking.k8s.io",
"kind": "HTTPRoute",
"name": "toystore"
}
}
},
{
"apiVersion": "kuadrant.io/v1beta2",
"kind": "RateLimitPolicy",
Expand Down Expand Up @@ -41,7 +69,7 @@ metadata:
capabilities: Basic Install
categories: Integration & Delivery
containerImage: quay.io/kuadrant/kuadrant-operator:latest
createdAt: "2023-11-24T11:49:17Z"
createdAt: "2023-11-27T14:18:37Z"
operators.operatorframework.io/builder: operator-sdk-v1.32.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
repository: https://github.com/Kuadrant/kuadrant-operator
Expand All @@ -52,15 +80,22 @@ spec:
apiservicedefinitions: {}
customresourcedefinitions:
owned:
- kind: AuthPolicy
- description: AuthPolicy enables authentication and authorization for service
workloads in a Gateway API network
displayName: AuthPolicy
kind: AuthPolicy
name: authpolicies.kuadrant.io
version: v1beta2
- description: Kuadrant is the Schema for the kuadrants API
- description: Kuadrant configures installations of Kuadrant Service Protection
components
displayName: Kuadrant
kind: Kuadrant
name: kuadrants.kuadrant.io
version: v1beta1
- kind: RateLimitPolicy
- description: RateLimitPolicy enables rate limiting for service workloads in
a Gateway API network
displayName: RateLimitPolicy
kind: RateLimitPolicy
name: ratelimitpolicies.kuadrant.io
version: v1beta2
description: A Kubernetes Operator to manage the lifecycle of the Kuadrant system
Expand Down
2 changes: 2 additions & 0 deletions bundle/manifests/kuadrant.io_authpolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ spec:
- name: v1beta2
schema:
openAPIV3Schema:
description: AuthPolicy enables authentication and authorization for service
workloads in a Gateway API network
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
Expand Down
3 changes: 2 additions & 1 deletion bundle/manifests/kuadrant.io_kuadrants.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ spec:
- name: v1beta1
schema:
openAPIV3Schema:
description: Kuadrant is the Schema for the kuadrants API
description: Kuadrant configures installations of Kuadrant Service Protection
components
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
Expand Down
3 changes: 2 additions & 1 deletion bundle/manifests/kuadrant.io_ratelimitpolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ spec:
- name: v1beta2
schema:
openAPIV3Schema:
description: RateLimitPolicy is the Schema for the ratelimitpolicies API
description: RateLimitPolicy enables rate limiting for service workloads in
a Gateway API network
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
Expand Down
2 changes: 2 additions & 0 deletions config/crd/bases/kuadrant.io_authpolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ spec:
- name: v1beta2
schema:
openAPIV3Schema:
description: AuthPolicy enables authentication and authorization for service
workloads in a Gateway API network
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
Expand Down
3 changes: 2 additions & 1 deletion config/crd/bases/kuadrant.io_kuadrants.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ spec:
- name: v1beta1
schema:
openAPIV3Schema:
description: Kuadrant is the Schema for the kuadrants API
description: Kuadrant configures installations of Kuadrant Service Protection
components
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
Expand Down
3 changes: 2 additions & 1 deletion config/crd/bases/kuadrant.io_ratelimitpolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ spec:
- name: v1beta2
schema:
openAPIV3Schema:
description: RateLimitPolicy is the Schema for the ratelimitpolicies API
description: RateLimitPolicy enables rate limiting for service workloads in
a Gateway API network
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ spec:
apiservicedefinitions: {}
customresourcedefinitions:
owned:
- description: Kuadrant is the Schema for the kuadrants API
- description: Kuadrant configures installations of Kuadrant Service Protection components
displayName: Kuadrant
kind: Kuadrant
name: kuadrants.kuadrant.io
version: v1beta1
- description: Enable AuthN and AuthZ based access control on workloads
- description: AuthPolicy enables authentication and authorization for service workloads in a Gateway API network
displayName: AuthPolicy
kind: AuthPolicy
name: authpolicies.kuadrant.io
version: v1beta1
- description: Enable access control on workloads based on HTTP rate limiting
version: v1beta2
- description: RateLimitPolicy enables rate limiting for service workloads in a Gateway API network
displayName: RateLimitPolicy
kind: RateLimitPolicy
name: ratelimitpolicies.kuadrant.io
version: v1beta1
version: v1beta2
description: A Kubernetes Operator to manage the lifecycle of the Kuadrant system
displayName: Kuadrant Operator
icon:
Expand Down
31 changes: 0 additions & 31 deletions config/samples/kuadrant_v1beta1_authpolicy.yaml

This file was deleted.

18 changes: 18 additions & 0 deletions config/samples/kuadrant_v1beta2_authpolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
apiVersion: kuadrant.io/v1beta2
kind: AuthPolicy
metadata:
name: toystore
spec:
targetRef:
group: gateway.networking.k8s.io
kind: HTTPRoute
name: toystore
rules:
authentication:
"apikey":
apiKey:
selector: {}
credentials:
authorizationHeader:
prefix: APIKEY
2 changes: 1 addition & 1 deletion config/samples/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Append samples you want in your CSV to this file as resources ##
resources:
- kuadrant_v1beta1_kuadrant.yaml
- kuadrant_v1beta1_authpolicy.yaml
- kuadrant_v1beta2_authpolicy.yaml
- kuadrant_v1beta2_ratelimitpolicy.yaml
#+kubebuilder:scaffold:manifestskustomizesamples
16 changes: 8 additions & 8 deletions examples/toystore/authpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ spec:
group: gateway.networking.k8s.io
kind: HTTPRoute
name: toystore
routeSelectors:
- matches:
- path:
type: Exact
value: "/admin/toy"
method: DELETE
rules:
routeSelectors:
- matches:
- path:
type: Exact
value: "/admin/toy"
method: DELETE
authentication:
"apikey":
apiKey:
selector:
matchLabels:
app: toystore
credentials:
in: authorization_header
keySelector: APIKEY
authorizationHeader:
prefix: APIKEY
response:
success:
dynamicMetadata:
Expand Down

0 comments on commit 77ee696

Please sign in to comment.