update k8s document and yml (#284)
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
20
k8s/gorush-aws-ingress.yaml
Normal file
20
k8s/gorush-aws-ingress.yaml
Normal 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
|
||||
@@ -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
|
||||
|
||||
4
k8s/gorush-namespace.yaml
Normal file
4
k8s/gorush-namespace.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: gorush
|
||||
@@ -2,6 +2,7 @@ apiVersion: extensions/v1beta1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: redis
|
||||
namespace: gorush
|
||||
spec:
|
||||
replicas: 1
|
||||
template:
|
||||
@@ -2,6 +2,7 @@ apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: redis
|
||||
namespace: gorush
|
||||
labels:
|
||||
app: redis
|
||||
role: master
|
||||
@@ -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:
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: gorush
|
||||
annotations:
|
||||
http.port: "8089"
|
||||
spec:
|
||||
backend:
|
||||
serviceName: gorush
|
||||
servicePort: 8088
|
||||
Reference in New Issue
Block a user