Kubernetes部署xxl-job
简介
XXL-JOB是一个轻量级分布式任务调度平台,其核心设计目标是开发迅速、学习简单、轻量级、易扩展。现已开放源代码并接入多家公司线上产品线,开箱即用。xxl-job-admin需要连接sql,所以提前准备好sql
初始化数据库
mysql初始化sql: https://github.com/xuxueli/xxl-job/blob/2.3.0/doc/db/tables_xxl_job.sql
部署xxl-job-admin
[root@k8s01 ~]# vim xxl-job-admin.yaml
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: xxl-job-admin
name: xxl-job-admin
namespace: tools-env
spec:
replicas: 1
selector:
matchLabels:
app: xxl-job-admin
template:
metadata:
labels:
app: xxl-job-admin
spec:
imagePullSecrets:
- name: harborsecret
containers:
- image: xuxueli/xxl-job-admin:2.3.
imagePullPolicy: IfNotPresent
name: xxl-job-admin
ports:
- containerPort: 8080
name: tcp-8080
protocol: TCP
env:
- name: PARAMS
value: "--spring.datasource.url=jdbc:mysql://x.x.x.x:3306/xxl_job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai --spring.datasource.username=root --spring.datasource.password=xxx --spring.mail.host=smtp.qiye.aliyun.com --spring.mail.username=xxx@gratus.cn --spring.mail.from=xxx@gratus.cn --spring.mail.password=123456 --spring.mail.properties.mail.smtp.starttls.enable=false --spring.mail.properties.mail.smtp.starttls.required=false --xxl.job.accessToken=dasj2nd81jf9asjdkl5jk234"
---
apiVersion: v1
kind: Service
metadata:
name: xxl-job-admin
namespace: tools-env
spec:
ports:
- name: tcp-8080
port: 8080
protocol: TCP
targetPort: 8080
nodePort: 31080
selector:
app: xxl-job-admin
sessionAffinity: None
type: NodePort
[root@k8s01 ~]# kubectl apply -f xxl-job-admin.yaml
访问xxl-job-admin
访问管理后台,Nodeport:31080/xxl-job-admin,默认账号密码:admin/123456
版权声明:
本站所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自
爱吃可爱多!
喜欢就支持一下吧
打赏
微信
支付宝