Watch Star Fork

dev-ops / gopubGoApache-2.0

加入码云
与超过 200 万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
vue.js(element框架)+golang(beego框架)开发的运维发布系统,支持git,jenkins版本发布,go ssh,BT两种文件传输方式选择,支持部署前准备任务和部署后任务钩子函数
克隆/下载
一键复制 编辑 原始数据 按行查看 历史
gopub-kubernetes.yml 2.85 KB chaoyue 提交于 2018-04-09 15:30 . docker&k8s支持
apiVersion: apps/v1
kind: Deployment
metadata:
name: gopub
namespace: default
labels:
name: gopub
spec:
replicas: 1
selector:
matchLabels:
name: gopub
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
name: gopub
spec:
restartPolicy: Always
hostAliases:
- ip: "192.168.162.66"
hostnames:
- "gitlab.example.org"
- "packagist.example.org"
- "toran.example.org"
- ip: "192.168.143.41"
hostnames:
- "jenkins.example.org"
- ip: "127.0.0.1"
hostnames:
- "mysql"
containers:
- name: gopub
image: "lc13579443/gopub:latest"
imagePullPolicy: Always
securityContext:
privileged: true
ports:
- containerPort: 8192
name: http-port
env:
- name: MYSQL_HOST
value: '127.0.0.1'
- name: MYSQL_PORT
value: '3306'
- name: MYSQL_USER
value: 'root'
- name: MYSQL_PASS
value: '123456'
- name: MYSQL_DB
value: 'walle'
resources:
limits:
cpu: 2
memory: 4096Mi
requests:
cpu: 100m
memory: 200Mi
volumeMounts:
- name: localtime
mountPath: /etc/localtime
readOnly: true
- name: cgroup
mountPath: /sys/fs/cgroup
readOnly: true
- name: mysql
image: "mysql:5.7"
imagePullPolicy: Always
env:
- name: MYSQL_ROOT_PASSWORD
value: '123456'
ports:
- containerPort: 3306
name: mysql-port
resources:
limits:
cpu: 2
memory: 4096Mi
requests:
cpu: 100m
memory: 200Mi
volumeMounts:
- name: localtime
mountPath: /etc/localtime
readOnly: true
- name: cgroup
mountPath: /sys/fs/cgroup
readOnly: true
- name: mysql-data
mountPath: /var/lib/mysql
terminationGracePeriodSeconds: 30
volumes:
- name: localtime
hostPath:
path: /etc/localtime
- name: cgroup
hostPath:
path: /sys/fs/cgroup
- name: mysql-data
hostPath:
path: /data/gopub-mysql
---
apiVersion: v1
kind: Service
metadata:
name: gopub
namespace: default
labels:
name: gopub
spec:
type: NodePort
selector:
name: gopub
ports:
- name: gopub
port: 8192
nodePort: 8192

评论 ( 0 )

你可以在登录后,发表评论

8_float_left_people 8_float_left_close