• docker file
FROM openjdk:8-jre-slim
MAINTAINER xuxueli

ENV PARAMS=""

ENV TZ=PRC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

ADD target/xxl-job-admin-*.jar /app.jar

ENTRYPOINT ["sh","-c","java -jar $JAVA_OPTS /app.jar $PARAMS"]
  • 打镜像推送
sudo docker login --username=zaixiadongdong2019 registry.cn-hangzhou.aliyuncs.com
cd  xxl-job-master/
docker build -t registry.cn-hangzhou.aliyuncs.com/xx2022/xxl-job-admin:2.4.0 xxl-job-admin/
docker push registry.cn-hangzhou.aliyuncs.com/xx2022/xxl-job-admin:2.4.0
  • k8s xxl-job-admin.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: xxl-job-admin
spec:
  selector:
    matchLabels:
      app: xxl-job-admin
  template:
    metadata:
      labels:
        app: xxl-job-admin
    spec:
      containers:
      - name: xxl-job-admin
        image: registry.cn-hangzhou.aliyuncs.com/xx2022/xxl-job-admin:2.4.0
        ports:
        - containerPort: 8080
        env:
        - name: PARAMS
          value: "--spring.datasource.url=jdbc:mysql://xx.xx.xx.xx:3306/xxl_job_k8s?Unicode=true&characterEncoding=UTF-8&useSSL=false --spring.datasource.username=root --spring.datasource.password=xx --spring.mail.username=xxxxxx@126.com --spring.mail.password=xxxxxx"
---
apiVersion: v1
kind: Service
metadata:
  name: xxl-job-admin
  labels:
    app: xxl-job-admin
spec:
  ports:
  - port: 8080
    protocol: TCP
    name: http
  selector:
    app: xxl-job-admin
GitHub 加速计划 / xx / xxl-job
27.16 K
10.79 K
下载
xxl-job: 是一个分布式任务调度平台,核心设计目标是开发迅速、学习简单、轻量级、易扩展。
最近提交(Master分支:3 个月前 )
e5d26ba2 - 4 个月前
977ad87b - 4 个月前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐