Skip to content

Commit

Permalink
add example deploy with kubernetes
Browse files Browse the repository at this point in the history
  • Loading branch information
felipejfc committed Apr 23, 2018
1 parent 469e6cf commit 1bf1ac5
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 0 deletions.
42 changes: 42 additions & 0 deletions deploy/kubernetes/example-backend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
app: pitaya-example
name: backend
namespace: pitaya-example
spec:
replicas: 3
selector:
matchLabels:
app: pitaya-example
template:
metadata:
labels:
app: pitaya-example
server: backend
spec:
containers:
- image: quay.io/felipejfc/pitaya-example-sv:v1
command:
- /server
- -type
- game
- -frontend=false
env:
- name: PITAYA_CLUSTER_RPC_CLIENT_NATS_CONNECT
value: nats://nats-cluster-1.nats-io.svc.cluster.local:4222
- name: PITAYA_CLUSTER_RPC_SERVER_NATS_CONNECT
value: nats://nats-cluster-1.nats-io.svc.cluster.local:4222
- name: PITAYA_CLUSTER_SD_ETCD_ENDPOINTS
value: etcd-cluster-1.etcd.svc.cluster.local:2379
- name: PITAYA_HEARTBEAT_INTERVAL
value: 10s
name: backend
resources:
limits:
cpu: 1000m
memory: 300Mi
requests:
cpu: 100m
memory: 200Mi
61 changes: 61 additions & 0 deletions deploy/kubernetes/example-frontend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
app: pitaya-example
name: frontend
namespace: pitaya-example
spec:
replicas: 3
selector:
matchLabels:
app: pitaya-example
template:
metadata:
labels:
app: pitaya-example
server: frontend
spec:
containers:
- image: quay.io/felipejfc/pitaya-example-sv:v1
command:
- /server
- -type
- connector
- -frontend=true
env:
- name: PITAYA_CLUSTER_RPC_CLIENT_NATS_CONNECT
value: nats://nats-cluster-1.nats-io.svc.cluster.local:4222
- name: PITAYA_CLUSTER_RPC_SERVER_NATS_CONNECT
value: nats://nats-cluster-1.nats-io.svc.cluster.local:4222
- name: PITAYA_CLUSTER_SD_ETCD_ENDPOINTS
value: etcd-cluster-1.etcd.svc.cluster.local:2379
- name: PITAYA_HEARTBEAT_INTERVAL
value: 10s
name: frontend
resources:
limits:
cpu: 1000m
memory: 300Mi
requests:
cpu: 100m
memory: 200Mi
---
apiVersion: v1
kind: Service
metadata:
labels:
app: pitaya-example
name: frontend
namespace: pitaya-example
spec:
ports:
- name: tcp
port: 32222
protocol: TCP
targetPort: 32222
selector:
app: pitaya-example
server: frontend
type: LoadBalancer

5 changes: 5 additions & 0 deletions examples/testing/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM alpine:3.7

ADD ./server /server

CMD /server

0 comments on commit 1bf1ac5

Please sign in to comment.