-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from Kuadrant/kuadrant-v0.2.1
Kuadrantctl v0.1.0 release
- Loading branch information
Showing
13 changed files
with
310 additions
and
37 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
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 | ||
``` |
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,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: | ||
authorino.kuadrant.io/managed-by: authorino | ||
api: animaltoys | ||
rateLimit: | ||
global: | ||
maxValue: 100 | ||
period: 30 | ||
perRemoteIP: | ||
maxValue: 10 | ||
period: 30 | ||
authenticated: | ||
maxValue: 5 | ||
period: 30 |
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,62 @@ | ||
--- | ||
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-examples:talker-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" |
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,46 @@ | ||
--- | ||
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-examples:talker-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 |
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 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: user-secret-apikey | ||
annotations: | ||
secret.kuadrant.io/user-id: user-01 | ||
labels: | ||
authorino.kuadrant.io/managed-by: authorino | ||
api: animaltoys | ||
stringData: | ||
api_key: JUSTFORDEMOSOBVIOUSLYqDQsqSPMHkRhriEOtcRx | ||
type: Opaque |
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.