美文网首页
k8s部署DOClever

k8s部署DOClever

作者: 苏州运维开发 | 来源:发表于2018-07-03 17:20 被阅读0次

    开发组采用doclever进行开发文档规范管理,将服务运行在k8s集群中
    1.先部署mongodb
    vim mongodb-deployment.yaml

    apiVersion: extensions/v1beta1
    kind: Deployment
    metadata:
      name: mongodb
    spec:
       replicas: 1
       template:
         metadata:
           name: mongodb
           labels:
             app: mongodb
         spec:
           containers:
             - name: mongodb
               image: 172.21.205.57:5005/mongodb:latest
               ports:
                 - name : mongodb
                   containerPort: 27017
    --
    apiVersion: v1
    kind: Service
    metadata:
      name: mongodb-service
    spec:
      ports:
        - port: 27017
          targetPort: 27017
          protocol: TCP
      selector:
        app: mongodb
    

    2.DOClever服务

    apiVersion: extensions/v1beta1
    kind: Deployment
    metadata:
      name: doclever
    spec:
       replicas: 1
       template:
         metadata:
           name: doclever
           labels:
             app: doclever
         spec:
           containers:
             - name: doclever
               image: 172.21.205.57:5005/doclever:latest-ubuntu
               env:
               - name: DB_HOST
                 value: "mongodb://mongodb-service:27017/DOClever"
               - name: PORT
                 value: "10000"
               - name: DB_FILE
                 value: "/root/DOClever/data/file"
               - name: DB_IMG
                 value: "/root/DOClever/data/img"
               - name: DB_TEMP
                 value: "/root/DOClever/data/tmp"
               ports:
                 - name : doclever
                   containerPort: 10000
    --
    apiVersion: v1
    kind: Service
    metadata:
      name: doclever-service
    spec:
      ports:
        - port: 10000
          targetPort: 10000
          protocol: TCP
      selector:
        app: doclever
    

    注意点:未做持久化,可以采用共享网络存储作为后端存储;mongodb需先部署。


    image.png

    相关文章

      网友评论

          本文标题:k8s部署DOClever

          本文链接:https://www.haomeiwen.com/subject/mzjjuftx.html