美文网首页Web 前端开发 让前端飞
BuildScript文件夹下k8s yaml文件配置

BuildScript文件夹下k8s yaml文件配置

作者: small_Sun | 来源:发表于2019-11-28 14:41 被阅读0次

    前端项目,在部署发布的时候需要配置yaml文件:


    image.png

    BuildScript文件夹下需要这三个.yaml文件
    配置如下:


    image.png image.png

    就这样,三个文件内容基本一样,需根据实际情况修改namespace及host

    源码在这里

    apiVersion: extentions/v1beta1
    kind: Deployment
    metadata: 
        name:  web-master
        namespace: It23-05-foreign-assistant
    spec: 
        replicas: 1
        selector:
            matchLabels:
                run: web-master
        strategy:
            rollingUpdate:
                maxSurge: 1
                maxUnavailable: 1
            type: RollingUpdate
        template:
            metadata:
                lablels:
                    run: web-master
                    service.alauda.io/name: self.resource_name
                annotations:
                    owner.cm.io/info: '[{"name": "Jeff", "phone":"11111111111"}]'
            spec:
                containers:
                    - image: [image]
                    imagePillPolicy: Always
                    name: web-master
                    env:
                        - name: ENV_FOR_DYNACONF
                          value: passweb
                    ports:
                        - containerPort: 8080
                    resources:
                        limits:
                            cpu: ‘2’
                            memory: 2G
                        requests:
                            cpu: ‘2’
                            memory: 2G
    ---
    kind: Service
    apiVersion: v1
    metadata: 
        name: web-master
        namespace: It23-05-foreign-assistant
    spec:
        template:
            metadata:
                lablels:
                    run: web-master
                    service.alauda.io/name: self.resource_name
        ports:
            - port: 8080
              name: 8080-8080
              protocol: TCP
              targetPort: 8080
        selector:
            run: web-master
    ---
    apiVersion: route.openshift.io/v1
    kind: Route
    metadata:
        annotations:
            haproxy.router.openshift.io.timeout: 900s
        name: web-master
        namespace: It23-05-foreign-assistant 
    spec:
        host: web-master.xxx.xxxx.xx 
        to:
            kind: Service
            name: web-master
        port:
            targetPort: 8080-8080                                     
    
    

    相关文章

      网友评论

        本文标题:BuildScript文件夹下k8s yaml文件配置

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