Commit ad72572a by 张乐 Committed by GitHub

Merge pull request #676 from insoz/master

添加k8s配置文件
parents f6261558 5a55fe5e
# 使用前请先运行run.sh构建镜像(注释最后docker-compose.yml).
# 或者自行构建镜像后push到docker仓库并修改下列image的配置.
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: apollo-configservice
labels:
name: apollo-configservice
namespace: apollo
spec:
replicas: 1
template:
metadata:
labels:
name: apollo-configservice
spec:
containers:
- name: apollo-configservice
image: apollo-configservice
ports:
- containerPort: 8080
imagePullPolicy: Never
nodeSelector:
beta.kubernetes.io/os: linux
---
apiVersion: v1
kind: Service
metadata:
name: apollo-configservice
labels:
name: apollo-configservice
namespace: apollo
spec:
ports:
- port: 8080
targetPort: 8080
selector:
name: apollo-configservice
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: apollo-adminservice
labels:
name: apollo-adminservice
namespace: apollo
spec:
replicas: 1
template:
metadata:
labels:
name: apollo-adminservice
spec:
containers:
- name: apollo-adminservice
image: apollo-adminservice
ports:
- containerPort: 8090
imagePullPolicy: Never
nodeSelector:
beta.kubernetes.io/os: linux
---
apiVersion: v1
kind: Service
metadata:
name: apollo-adminservice
labels:
name: apollo-adminservice
namespace: apollo
spec:
ports:
- port: 8090
targetPort: 8090
selector:
name: apollo-adminservice
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: apollo-portal
labels:
name: apollo-portal
namespace: apollo
spec:
replicas: 1
template:
metadata:
labels:
name: apollo-portal
spec:
containers:
- name: apollo-portal
image: apollo-portal
ports:
- containerPort: 8080
imagePullPolicy: Never
nodeSelector:
beta.kubernetes.io/os: linux
---
apiVersion: v1
kind: Service
metadata:
name: apollo-portal
labels:
name: apollo-portal
namespace: apollo
spec:
type: NodePort
ports:
- port: 9090
targetPort: 8080
nodePort: 30090
selector:
name: apollo-portal
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: db
labels:
name: db
namespace: apollo
spec:
replicas: 1
template:
metadata:
labels:
name: db
spec:
containers:
- name: db
image: mariadb:latest
env:
- name: MYSQL_ROOT_PASSWORD
value: root
ports:
- containerPort: 3306
imagePullPolicy: Never
volumeMounts:
- mountPath: /docker-entrypoint-initdb.d
name: mysqlinit
volumes:
- name: mysqlinit
hostPath:
path: /root/apollo/scripts/sql-docker # 路径根据apollo项目路径修改
nodeSelector:
beta.kubernetes.io/os: linux
---
apiVersion: v1
kind: Service
metadata:
name: db
labels:
name: db
namespace: apollo
spec:
ports:
- port: 3306
targetPort: 3306
selector:
name: db
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment