add ingress yaml for k8s

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2017-09-17 09:17:37 +00:00
parent 7dac7d0698
commit 8e98e0b6fe
5 changed files with 16 additions and 6 deletions

View File

@ -1,7 +1,7 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: frontend
name: gorush
spec:
replicas: 3
template:
@ -14,7 +14,7 @@ spec:
- name: gorush
image: appleboy/gorush
command: ["/gorush"]
args: ["-c", "config.yml", "-e", "redis", "--redis-addr", "redis-master:6379"]
args: ["-c", "config.yml", "-e", "redis", "--redis-addr", "redis:6379"]
env:
- name: GET_HOSTS_FROM
# value: dns

View File

@ -1,14 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: frontend
name: gorush
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
# type: LoadBalancer
ports:
- port: 8088
selector:

10
k8s/ingress.yaml Normal file
View File

@ -0,0 +1,10 @@
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: gorush
annotations:
http.port: "8089"
spec:
backend:
serviceName: gorush
servicePort: 8088

View File

@ -1,7 +1,7 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: redis-master
name: redis
spec:
replicas: 1
template:

View File

@ -1,7 +1,7 @@
apiVersion: v1
kind: Service
metadata:
name: redis-master
name: redis
labels:
app: redis
role: master