feat: add k8s config. (#237)
This commit is contained in:
27
k8s/gorush-deployment.yaml
Normal file
27
k8s/gorush-deployment.yaml
Normal 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
16
k8s/gorush-service.yaml
Normal 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
|
||||
18
k8s/redis-master-deployment.yaml
Normal file
18
k8s/redis-master-deployment.yaml
Normal 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
|
||||
16
k8s/redis-master-service.yaml
Normal file
16
k8s/redis-master-service.yaml
Normal 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
|
||||
Reference in New Issue
Block a user