Skip to content

Instantly share code, notes, and snippets.

@olix0r
Created June 8, 2018 16:24
Show Gist options
  • Save olix0r/a0cf2f6de6d1d71c05e5a33f35d69dd1 to your computer and use it in GitHub Desktop.
Save olix0r/a0cf2f6de6d1d71c05e5a33f35d69dd1 to your computer and use it in GitHub Desktop.
# Examples:
#
# # Deploy everything
# :; kubectl apply -f strest.yml --prune -l 'app=strest'
#
# # Add server instances
# :; kubectl -n strest scale -l 'strest-server-profile=fast' --replicas=10
---
kind: Namespace
apiVersion: v1
metadata:
name: strest
labels:
app: strest
# target.strest.svc.cluster.local receives all strest traffic.
---
kind: Service
apiVersion: v1
metadata:
name: target
namespace: strest
labels:
app: strest
strest-role: server
spec:
type: ClusterIP
selector:
app: strest
strest-role: server
ports:
- name: strest-grpc
port: 8888
targetPort: 8888
---
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: strest-server-slow
namespace: strest
labels:
app: strest
strest-server-profile: slow
strest-role: server
spec:
replicas: 1
template:
metadata:
labels:
app: strest
strest-role: server
spec:
containers:
- name: main
image: gcr.io/runconduit/strest-grpc:0.0.6-rc1
imagePullPolicy: IfNotPresent
ports:
- name: strest-grpc
containerPort: 8888
- name: admin-http
containerPort: 9999
args: [
"server",
"--address", ":8888",
"--metricAddr", ":9999",
"--latencyPercentiles", "50=20,90=50,99=100,999=500"]
---
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: strest-server-fast
namespace: strest
labels:
app: strest
strest-server-profile: fast
strest-role: server
spec:
replicas: 9
template:
metadata:
labels:
app: strest
strest-role: server
spec:
containers:
- name: main
image: gcr.io/runconduit/strest-grpc:0.0.6-rc1
imagePullPolicy: IfNotPresent
ports:
- name: strest-grpc
containerPort: 8888
- name: admin-http
containerPort: 9999
args: [
"server",
"--address=:8888",
"--metricAddr=:9999",
"--latencyPercentiles", "50=20,90=50,99=100,999=500"]
---
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: strest-client
namespace: strest
labels:
app: strest
strest-role: client
spec:
replicas: 1
template:
metadata:
labels:
app: strest
strest-role: client
spec:
containers:
- name: main
image: gcr.io/runconduit/strest-grpc:0.0.6-rc1
imagePullPolicy: IfNotPresent
ports:
- name: admin-http
containerPort: 9999
args: [
"client",
"--address", "target:8888",
"--metricAddr", ":9999",
"--streams", "10"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment