k8s(kubernetes)、helm、kubectl多环境部署apollo

一、数据库使用rds【稳定】【kubernetes内搭建数据库不稳定】

二、.初始化数据库

三、多环境配置  

apollo-service-apollo-adminservice 

 apollo-service-apollo-configservice  

apollo-service-apollo-configdb

 【fat环境】

 [ 配置fat环境values.yaml ]

configdb:
  name: apollo-configdb
  # apolloconfigdb host【数据库地址rds的type为ExternalName】
  #此处要注意 rds 地址
  host: rm-xxx.mysql.rds.aliyuncs.com
  #此处要注意
  port: 3306
  #此处要注意 fat环境对应数据库名称
  dbName: xxx
  # apolloconfigdb user name
  #此处要注意 账号
  userName: xxx
  # apolloconfigdb password
  #此处要注意 密码
  password: xxx
  connectionStringProperties: characterEncoding=utf8
  service:
    # enabled 与 type
  #此处要注意
    enabled: true
    fullNameOverride: ""
    port: 3306
  #此处要注意 如果你也是rds则要修改为如下,如果不是rds请看具体配置说明
    type: ExternalName

configService:
  name: apollo-configservice
  fullNameOverride: ""
  replicaCount: 2
  containerPort: 8080
  image:
    repository: apolloconfig/apollo-configservice
    tag: ""
    pullPolicy: IfNotPresent
  imagePullSecrets: []
  service:
    fullNameOverride: ""
    port: 8080
    targetPort: 8080
  #此处要注意 需要设置外部连接时要设置为此类型
    type: NodePort
  ingress:
    enabled: false
    annotations: { }
    hosts:
      - host: ""
        paths: [ ]
    tls: [ ]
  liveness:
    initialDelaySeconds: 100
    periodSeconds: 10
  readiness:
    initialDelaySeconds: 30
    periodSeconds: 5
  config:
    # spring profiles to activate
    profiles: "github,kubernetes"
    # override apollo.config-service.url: config service url to be accessed by apollo-client 
    configServiceUrlOverride: ""
    # override apollo.admin-service.url: admin service url to be accessed by apollo-portal 
    adminServiceUrlOverride: ""
    # specify the context path, e.g. /apollo
    contextPath: ""
  # environment variables passed to the container, e.g. JAVA_OPTS
  env: {}
  strategy: {}
  resources: {}
  nodeSelector: {}
  tolerations: []
  affinity: {}

adminService:
  name: apollo-adminservice
  fullNameOverride: ""
  replicaCount: 2
  containerPort: 8090
  image:
    repository: apolloconfig/apollo-adminservice
    tag: ""
    pullPolicy: IfNotPresent
  imagePullSecrets: []
  service:
    fullNameOverride: ""
    port: 8090
    targetPort: 8090
  #此处要注意 需要设置外部连接时要设置为此类型
    type: NodePort
  ingress:
    enabled: false
    annotations: { }
    hosts:
      - host: ""
        paths: [ ]
    tls: [ ]
  liveness:
    initialDelaySeconds: 100
    periodSeconds: 10
  readiness:
    initialDelaySeconds: 30
    periodSeconds: 5
  config:
    # spring profiles to activate
    profiles: "github,kubernetes"
    # specify the context path, e.g. /apollo
    contextPath: ""
  # environment variables passed to the container, e.g. JAVA_OPTS
  env: {}
  strategy: {}
  resources: {}
  nodeSelector: {}
  tolerations: []
  affinity: {}

[ 创建及校验fat ]

 【uat环境】

[ 配置uat环境values.yaml ] —— 除了数据库有变更之外,其它与fat差不多

configdb:
  name: apollo-configdb
  # apolloconfigdb host【数据库地址rds的type为ExternalName】
  #此处要注意 rds 地址
  host: rm-xxx.mysql.rds.aliyuncs.com
  #此处要注意
  port: 3306
  #此处要注意 uat环境对应数据库名称
  dbName: xxx
  # apolloconfigdb user name
  #此处要注意 账号
  userName: xxx
  # apolloconfigdb password
  #此处要注意 密码
  password: xxx
  connectionStringProperties: characterEncoding=utf8
  service:
    # enabled 与 type
  #此处要注意
    enabled: true
    fullNameOverride: ""
    port: 3306
  #此处要注意 如果你也是rds则要修改为如下,如果不是rds请看具体配置说明
    type: ExternalName

configService:
  name: apollo-configservice
  fullNameOverride: ""
  replicaCount: 2
  containerPort: 8080
  image:
    repository: apolloconfig/apollo-configservice
    tag: ""
    pullPolicy: IfNotPresent
  imagePullSecrets: []
  service:
    fullNameOverride: ""
    port: 8080
    targetPort: 8080
  #此处要注意 需要设置外部连接时要设置为此类型
    type: NodePort
  ingress:
    enabled: false
    annotations: { }
    hosts:
      - host: ""
        paths: [ ]
    tls: [ ]
  liveness:
    initialDelaySeconds: 100
    periodSeconds: 10
  readiness:
    initialDelaySeconds: 30
    periodSeconds: 5
  config:
    # spring profiles to activate
    profiles: "github,kubernetes"
    # override apollo.config-service.url: config service url to be accessed by apollo-client 
    configServiceUrlOverride: ""
    # override apollo.admin-service.url: admin service url to be accessed by apollo-portal 
    adminServiceUrlOverride: ""
    # specify the context path, e.g. /apollo
    contextPath: ""
  # environment variables passed to the container, e.g. JAVA_OPTS
  env: {}
  strategy: {}
  resources: {}
  nodeSelector: {}
  tolerations: []
  affinity: {}

adminService:
  name: apollo-adminservice
  fullNameOverride: ""
  replicaCount: 2
  containerPort: 8090
  image:
    repository: apolloconfig/apollo-adminservice
    tag: ""
    pullPolicy: IfNotPresent
  imagePullSecrets: []
  service:
    fullNameOverride: ""
    port: 8090
    targetPort: 8090
  #此处要注意 需要设置外部连接时要设置为此类型
    type: NodePort
  ingress:
    enabled: false
    annotations: { }
    hosts:
      - host: ""
        paths: [ ]
    tls: [ ]
  liveness:
    initialDelaySeconds: 100
    periodSeconds: 10
  readiness:
    initialDelaySeconds: 30
    periodSeconds: 5
  config:
    # spring profiles to activate
    profiles: "github,kubernetes"
    # specify the context path, e.g. /apollo
    contextPath: ""
  # environment variables passed to the container, e.g. JAVA_OPTS
  env: {}
  strategy: {}
  resources: {}
  nodeSelector: {}
  tolerations: []
  affinity: {}

[ 创建及校验fat ]

 【pro环境】

[ 配置uat环境values.yaml ] —— 数据库有变动及service type也可以有变动

configdb:
  name: apollo-configdb
  # apolloconfigdb host【数据库地址rds的type为ExternalName】
  #此处要注意 rds 地址
  host: rm-xxx.mysql.rds.aliyuncs.com
  #此处要注意
  port: 3306
  #此处要注意 pro环境对应数据库名称
  dbName: xxx
  # apolloconfigdb user name
  #此处要注意 账号
  userName: xxx
  # apolloconfigdb password
  #此处要注意 密码
  password: xxx
  connectionStringProperties: characterEncoding=utf8
  service:
    # enabled 与 type
  #此处要注意
    enabled: true
    fullNameOverride: ""
    port: 3306
  #此处要注意 如果你也是rds则要修改为如下,如果不是rds请看具体配置说明
    type: ExternalName

configService:
  name: apollo-configservice
  fullNameOverride: ""
  replicaCount: 2
  containerPort: 8080
  image:
    repository: apolloconfig/apollo-configservice
    tag: ""
    pullPolicy: IfNotPresent
  imagePullSecrets: []
  service:
    fullNameOverride: ""
    port: 8080
    targetPort: 8080
  #理论上没有外部服务要调用此地址可以直接是ClusterIP类型,但是以防万一后期拓展,所以还是设置为NodePort
    type: NodePort
  ingress:
    enabled: false
    annotations: { }
    hosts:
      - host: ""
        paths: [ ]
    tls: [ ]
  liveness:
    initialDelaySeconds: 100
    periodSeconds: 10
  readiness:
    initialDelaySeconds: 30
    periodSeconds: 5
  config:
    # spring profiles to activate
    profiles: "github,kubernetes"
    # override apollo.config-service.url: config service url to be accessed by apollo-client 
    configServiceUrlOverride: ""
    # override apollo.admin-service.url: admin service url to be accessed by apollo-portal 
    adminServiceUrlOverride: ""
    # specify the context path, e.g. /apollo
    contextPath: ""
  # environment variables passed to the container, e.g. JAVA_OPTS
  env: {}
  strategy: {}
  resources: {}
  nodeSelector: {}
  tolerations: []
  affinity: {}

adminService:
  name: apollo-adminservice
  fullNameOverride: ""
  replicaCount: 2
  containerPort: 8090
  image:
    repository: apolloconfig/apollo-adminservice
    tag: ""
    pullPolicy: IfNotPresent
  imagePullSecrets: []
  service:
    fullNameOverride: ""
    port: 8090
    targetPort: 8090
  #理论上没有外部服务要调用此地址可以直接是ClusterIP类型,但是以防万一后期拓展,所以还是设置为NodePort
    type: NodePort
  ingress:
    enabled: false
    annotations: { }
    hosts:
      - host: ""
        paths: [ ]
    tls: [ ]
  liveness:
    initialDelaySeconds: 100
    periodSeconds: 10
  readiness:
    initialDelaySeconds: 30
    periodSeconds: 5
  config:
    # spring profiles to activate
    profiles: "github,kubernetes"
    # specify the context path, e.g. /apollo
    contextPath: ""
  # environment variables passed to the container, e.g. JAVA_OPTS
  env: {}
  strategy: {}
  resources: {}
  nodeSelector: {}
  tolerations: []
  affinity: {}

[ 创建及校验fat ]

四、配置安装apollo-portal

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值