-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add README to all directories - Copy Kubernetes resources from docs - Create example using kind Signed-off-by: Anders Eknert <[email protected]>
- Loading branch information
1 parent
817ba90
commit 8bfdbd0
Showing
6 changed files
with
164 additions
and
6 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,3 @@ | ||
# Kafka Topic Datasource | ||
|
||
Example code for the Styra Load [Kafka integration](https://docs.styra.com/load/configuration/data/kafka-streams-api). |
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,27 @@ | ||
# Kubernetes Deployment | ||
|
||
Example code for [deployment](https://docs.styra.com/load/installation/deployment) of Styra Load in a Kubernetes cluster. | ||
|
||
To run the example code in a local [kind](https://kind.sigs.k8s.io) cluster, follow the steps outlined below. | ||
|
||
First, create a new cluster with the provided configuration file. | ||
|
||
```shell | ||
$ kind create cluster --config kind-config.yaml | ||
``` | ||
|
||
Edit the `manifests.yaml` file and add your license key in the `styra-load-license` secret manifest. | ||
|
||
Next, deploy the resource manifests: | ||
|
||
```shell | ||
$ kubectl apply -f manifests.yaml | ||
``` | ||
|
||
Last, deploy the Nginx ingress controller in order to make the deployment accessible from your machine: | ||
|
||
```shell | ||
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml | ||
``` | ||
|
||
Your Styra Load instance should now be reachable on `localhost:8181/load`. |
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,14 @@ | ||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
nodes: | ||
- role: control-plane | ||
kubeadmConfigPatches: | ||
- | | ||
kind: InitConfiguration | ||
nodeRegistration: | ||
kubeletExtraArgs: | ||
node-labels: "ingress-ready=true" | ||
extraPortMappings: | ||
- containerPort: 8181 | ||
hostPort: 8181 | ||
protocol: TCP |
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,111 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: load | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: styra-load-license | ||
namespace: load | ||
type: Opaque | ||
stringData: | ||
license: changeme | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: styra-load-config | ||
namespace: load | ||
data: | ||
config.yaml: | | ||
decision_logs: | ||
console: true | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app: load | ||
namespace: load | ||
name: load | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: load | ||
template: | ||
metadata: | ||
labels: | ||
app: load | ||
name: load | ||
spec: | ||
containers: | ||
- name: load | ||
image: ghcr.io/styrainc/load:latest | ||
args: | ||
- "run" | ||
- "--server" | ||
- "--addr=0.0.0.0:8181" | ||
- "--config-file=/etc/config/config.yaml" | ||
env: | ||
- name: STYRA_LOAD_LICENSE_KEY | ||
valueFrom: | ||
secretKeyRef: | ||
name: styra-load-license | ||
key: license | ||
volumeMounts: | ||
- name: config | ||
mountPath: /etc/config | ||
readinessProbe: | ||
httpGet: | ||
path: /health | ||
scheme: HTTP | ||
port: 8181 | ||
initialDelaySeconds: 3 | ||
periodSeconds: 5 | ||
livenessProbe: | ||
httpGet: | ||
path: /health | ||
scheme: HTTP | ||
port: 8181 | ||
initialDelaySeconds: 3 | ||
periodSeconds: 5 | ||
volumes: | ||
- name: config | ||
configMap: | ||
name: styra-load-config | ||
items: | ||
- key: "config.yaml" | ||
path: "config.yaml" | ||
--- | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: load | ||
namespace: load | ||
spec: | ||
selector: | ||
app: load | ||
ports: | ||
- port: 8181 | ||
--- | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: load | ||
namespace: load | ||
annotations: | ||
nginx.ingress.kubernetes.io/rewrite-target: /$2 | ||
spec: | ||
rules: | ||
- http: | ||
paths: | ||
- pathType: Prefix | ||
path: /load(/|$)(.*) | ||
backend: | ||
service: | ||
name: load | ||
port: | ||
number: 8181 |
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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
# Performance Testing | ||
|
||
This folder contains a number of large OPA bundles for performance testing. | ||
|
||
Please see the Load documentation for instructions on how to use these bundles | ||
in performance tests. | ||
in [performance tests](https://docs.styra.com/load/performance-testing). |