-
Notifications
You must be signed in to change notification settings - Fork 14
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
Kuadrantctl v0.1.0 release #35
Changes from 4 commits
b82936a
402813c
7441d4b
33987da
ee721a3
4707414
84c1e8b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Dogs and Cats API | ||
|
||
|
||
## Install kuadrant | ||
|
||
The install command will create a namespace called `kuadrant-system` and deploy kuadrant services in that namespace. | ||
|
||
```bash | ||
kuadrantctl install | ||
``` | ||
|
||
## Deploy all | ||
|
||
```bash | ||
kubectl apply -f examples/dogs-cats | ||
``` | ||
|
||
|
||
## Test | ||
|
||
Run kubectl port-forward in a different shell: | ||
|
||
```bash | ||
❯ kubectl port-forward -n kuadrant-system service/kuadrant-gateway 9080:80 | ||
Forwarding from [::1]:9080 -> 8080 | ||
``` | ||
|
||
The service can now be accessed at `http://localhost:9080` via a browser or any other client, like curl. | ||
|
||
```bash | ||
❯ curl -H "Authorization: APIKEY JUSTFORDEMOSOBVIOUSLYqDQsqSPMHkRhriEOtcRx" -H "Host: api.animaltoys.127.0.0.1.nip.io" localhost:9080/cats/toys | ||
|
||
❯ curl -H "Authorization: APIKEY JUSTFORDEMOSOBVIOUSLYqDQsqSPMHkRhriEOtcRx" -H "Host: api.animaltoys.127.0.0.1.nip.io" localhost:9080/dogs/toys | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
apiVersion: networking.kuadrant.io/v1beta1 | ||
kind: APIProduct | ||
metadata: | ||
name: animaltoys | ||
spec: | ||
hosts: | ||
- api.animaltoys.127.0.0.1.nip.io | ||
APIs: | ||
- name: dogs | ||
namespace: default | ||
tag: production | ||
prefix: /dogs | ||
- name: cats | ||
namespace: default | ||
tag: production | ||
prefix: /cats | ||
securityScheme: | ||
- name: MyAPIKey | ||
apiKeyAuth: | ||
location: authorization_header | ||
name: APIKEY | ||
credential_source: | ||
labelSelectors: | ||
secret.kuadrant.io/managed-by: authorino | ||
api: animaltoys | ||
rateLimit: | ||
global: | ||
maxValue: 100 | ||
period: 30 | ||
perRemoteIP: | ||
maxValue: 10 | ||
period: 30 | ||
authenticated: | ||
maxValue: 5 | ||
period: 30 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: cats | ||
labels: | ||
svc: cats | ||
spec: | ||
selector: | ||
matchLabels: | ||
svc: cats | ||
template: | ||
metadata: | ||
labels: | ||
svc: cats | ||
spec: | ||
containers: | ||
- name: cats | ||
image: quay.io/3scale/authorino:echo-api | ||
env: | ||
- name: PORT | ||
value: "3000" | ||
ports: | ||
- containerPort: 3000 | ||
replicas: 1 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: cats-api | ||
annotations: | ||
discovery.kuadrant.io/scheme: "http" | ||
discovery.kuadrant.io/api-name: "cats" | ||
discovery.kuadrant.io/tag: "production" | ||
discovery.kuadrant.io/port: "80" | ||
discovery.kuadrant.io/oas-configmap: "cats-oas" | ||
labels: | ||
discovery.kuadrant.io/enabled: "true" | ||
spec: | ||
selector: | ||
svc: cats | ||
ports: | ||
- port: 80 | ||
protocol: TCP | ||
targetPort: 3000 | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: cats-oas | ||
data: | ||
openapi.yaml: | | ||
openapi: "3.0.0" | ||
info: | ||
title: "toy API" | ||
version: "1.0.0" | ||
servers: | ||
- url: http://toys/ | ||
paths: | ||
/toys: | ||
get: | ||
operationId: "getToys" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: dogs | ||
labels: | ||
svc: dogs | ||
spec: | ||
selector: | ||
matchLabels: | ||
svc: dogs | ||
template: | ||
metadata: | ||
labels: | ||
svc: dogs | ||
spec: | ||
containers: | ||
- name: dogs | ||
image: quay.io/3scale/authorino:echo-api | ||
env: | ||
- name: PORT | ||
value: "3000" | ||
ports: | ||
- containerPort: 3000 | ||
replicas: 1 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: dogs-api | ||
annotations: | ||
discovery.kuadrant.io/scheme: "http" | ||
discovery.kuadrant.io/api-name: "dogs" | ||
discovery.kuadrant.io/tag: "production" | ||
discovery.kuadrant.io/port: "80" | ||
discovery.kuadrant.io/matchpath: "/" | ||
discovery.kuadrant.io/matchpath-type: Prefix | ||
labels: | ||
discovery.kuadrant.io/enabled: "true" | ||
spec: | ||
selector: | ||
svc: dogs | ||
ports: | ||
- port: 80 | ||
protocol: TCP | ||
targetPort: 3000 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: user-secret-apikey | ||
annotations: | ||
secret.kuadrant.io/user-id: user-01 | ||
labels: | ||
secret.kuadrant.io/managed-by: authorino | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Authorino may cache this API key secret when it reconciles the However, this is NOT enough for Authorino to watch changes related to this API key secret, independently from the reconciliation of the If not specified, Authorino will default to watching only secret-related events of resources that include labels matching There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks for the tip. I will update to use the default value then. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added changes to 4707414 |
||
api: animaltoys | ||
stringData: | ||
api_key: JUSTFORDEMOSOBVIOUSLYqDQsqSPMHkRhriEOtcRx | ||
type: Opaque |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,5 +16,5 @@ limitations under the License. | |
package version | ||
|
||
var ( | ||
Version = "0.0.1" | ||
Version = "0.1.0" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend instead using: