• yaml服务部署示例


    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: igirl
      namespace: chaolai
      labels:
        app: igirl
    spec:
      replicas: 1
      selector:
        matchLabels:
            app: igirl
      template:
        metadata:
          labels:
            app: igirl
        spec:
          restartPolicy: Always
          containers:
          - name: igirl
            image: registry.cn-beijing.aliyuncs.com/hantang/igirl:1.0.2
            imagePullPolicy: IfNotPresent
            ports:
            - containerPort: 80
            env:
            - name:  TZ
              value: Asia/Shanghai
            - name:  LANG
              value: zh_CN.UTF-8
            - name: APP_ENV
              valueFrom:
                  configMapKeyRef:
                      name: zhichan-config
                      key: APP_ENV
            - name: DB_HOST
              valueFrom:
                  configMapKeyRef:
                      name: zhichan-config
                      key: DB_HOST
            - name:  DB_PORT
              valueFrom:
                  configMapKeyRef:
                      name: zhichan-config
                      key: DB_PORT
            - name:  DB_PWD
              valueFrom:
                  configMapKeyRef:
                      name: zhichan-config
                      key: DB_PWD
            - name:  DB_USER
              valueFrom:
                  configMapKeyRef:
                      name: zhichan-config
                      key: DB_USER
            - name:  IGIRL_DB_NAME
              valueFrom:
                  configMapKeyRef:
                      name: zhichan-config
                      key: IGIRL_DB_NAME
            - name:  IGIRL_REDIS_DB
              valueFrom:
                  configMapKeyRef:
                      name: zhichan-config
                      key: IGIRL_REDIS_DB
            - name:  REDIS_HOST
              valueFrom:
                  configMapKeyRef:
                      name: zhichan-config
                      key: REDIS_HOST
            - name:  REDIS_PORT
              valueFrom:
                  configMapKeyRef:
                      name: zhichan-config
                      key: REDIS_PORT
            - name:  REDIS_PWD
              valueFrom:
                  configMapKeyRef:
                      name: zhichan-config
                      key: REDIS_PWD

            - name:  NODE_PORT
              valueFrom:
                  configMapKeyRef:
                      name: zhichan-config
                      key: NODE_PORT
    ---

    kind: Service
    apiVersion: v1
    metadata:
      labels:
         app: igirl-service
      name: igirl-service
      namespace: chaolai
    spec:
      type: NodePort
      ports:
        - port: 80
          targetPort: 80
          nodePort: 19100
      selector:
          app: igirl

  • 相关阅读:
    Lucene搜索引擎例子demo
    java Log4j日志配置详解大全
    java获取当前上一周、上一月、上一年的时间
    Django组件-cookie与session
    前端基础之jQuery
    Django组件-forms
    Django组件-分页器
    Django-Ajax
    Django模型层-多表操作
    Django模型层-单表操作
  • 原文地址:https://www.cnblogs.com/justart/p/11950250.html
Copyright © 2020-2023  润新知