update k8s document and yml (#284)

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu
2017-09-22 11:22:10 +08:00
committed by GitHub
parent 8e98e0b6fe
commit 411b6efc4a
8 changed files with 46 additions and 42 deletions

View File

@@ -0,0 +1,20 @@
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: gorush
namespace: gorush
annotations:
# Kubernetes Ingress Controller for AWS ALB
# https://github.com/coreos/alb-ingress-controller
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/subnets: "subnet-3cd22c75,subnet-4aff342d"
alb.ingress.kubernetes.io/security-groups: sg-329c2b54
spec:
rules:
- host: gorush.example.com
http:
paths:
- path: /
backend:
serviceName: gorush
servicePort: 8088

View File

@@ -2,6 +2,7 @@ apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: gorush
namespace: gorush
spec:
replicas: 3
template:
@@ -11,17 +12,10 @@ spec:
tier: frontend
spec:
containers:
- name: gorush
image: appleboy/gorush
- image: appleboy/gorush
name: gorush
imagePullPolicy: Always
command: ["/gorush"]
args: ["-c", "config.yml", "-e", "redis", "--redis-addr", "redis: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

View File

@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: gorush

View File

@@ -2,6 +2,7 @@ apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: redis
namespace: gorush
spec:
replicas: 1
template:

View File

@@ -2,6 +2,7 @@ apiVersion: v1
kind: Service
metadata:
name: redis
namespace: gorush
labels:
app: redis
role: master

View File

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

View File

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