• 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

  • 相关阅读:
    .net core读取appsettings.config中文乱码问题
    vs2017错误:当前页面的脚本发生错误
    VS Code中无法识别npm命令
    Visual Studio报错/plugin.vs.js,行:1074,错误:缺少标识符、字符串或数字
    记录一次在生成数据库服务器上出现The timeout period elapsed prior to completion of the operation or the server is not responding.和Exception has been thrown by the target of an invocation的解决办法
    Java集合框架
    java hash表
    Java Dictionary 类存储键值
    java数据结构 栈stack
    java封装
  • 原文地址:https://www.cnblogs.com/justart/p/11950250.html
Copyright © 2020-2023  润新知