feat: add k8s config. (#237)

This commit is contained in:
Bo-Yi Wu
2017-06-07 09:11:05 -05:00
committed by GitHub
parent 276cb49ae4
commit eb05be95f0
5 changed files with 122 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: frontend
spec:
replicas: 3
template:
metadata:
labels:
app: gorush
tier: frontend
spec:
containers:
- name: gorush
image: appleboy/gorush
command: ["/gorush"]
args: ["-c", "config.yml", "-e", "redis", "--redis-addr", "redis-master:6379"]
env:
- name: GET_HOSTS_FROM
# value: dns
# If your cluster config does not include a dns service, then to
# instead access environment variables to find service host
# info, comment out the 'value: dns' line above, and uncomment the
# line below:
value: env
ports:
- containerPort: 8088

16
k8s/gorush-service.yaml Normal file
View File

@@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
name: frontend
labels:
app: gorush
tier: frontend
spec:
# if your cluster supports it, uncomment the following to automatically create
# an external load-balanced IP for the frontend service.
type: LoadBalancer
ports:
- port: 8088
selector:
app: gorush
tier: frontend

View File

@@ -0,0 +1,18 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: redis-master
spec:
replicas: 1
template:
metadata:
labels:
app: redis
role: master
tier: backend
spec:
containers:
- name: master
image: redis
ports:
- containerPort: 6379

View File

@@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
name: redis-master
labels:
app: redis
role: master
tier: backend
spec:
ports:
- port: 6379
targetPort: 6379
selector:
app: redis
role: master
tier: backend