当前位置: 首页 > news >正文

k8s helm Seata1.5.1

1.当前文章是基于上一篇文章写的:

k8s Seata1.5.1_hunheidaode的博客-CSDN博客

在上面添加了些许改动,只不过是用helm部署了,其余的操作还是跟上篇博文一样子的。

2.环境:k8s  、nfs环境 或是动态存储

 nfs:

3.下载seta helm部署yaml文件:文件位于:不知道的可看上篇博文。

 4.我只是改动了values.yaml与templates下的deployment.yaml

deployment.yaml 改动了最后几行:

有原来hostpath改为NFS存储:

完整配置文件:

apiVersion: apps/v1
kind: Deployment
metadata:
{{- if .Values.namespace }}
  namespace: {{ .Values.namespace }}
{{- end}}
  name: {{ include "seata-server.name" . }}
  labels:
{{ include "seata-server.labels" . | indent 4 }}
spec:
  replicas: {{ .Values.replicaCount }}
  selector:
    matchLabels:
      app.kubernetes.io/name: {{ include "seata-server.name" . }}
      app.kubernetes.io/instance: {{ .Release.Name }}
  template:
    metadata:
      labels:
        app.kubernetes.io/name: {{ include "seata-server.name" . }}
        app.kubernetes.io/instance: {{ .Release.Name }}
    spec:
      containers:
        - name: {{ .Chart.Name }}
          image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
          imagePullPolicy: {{ .Values.image.pullPolicy }}
          ports:
            - name: http
              containerPort: 8091
              protocol: TCP
          {{- if .Values.volume }}
          volumeMounts:
            {{- range .Values.volume }}
            - name: {{ .name }}
              mountPath: {{ .mountPath }}
            {{- end}}
          {{- end}}
        {{- if .Values.env }}
          env:
          {{- if .Values.env.seataIp }}
            - name: SEATA_IP
              value: {{ .Values.env.seataIp  | quote }}
          {{- end }}
          {{- if .Values.env.seataPort }}
            - name: SEATA_PORT
              value: {{ .Values.env.seataPort | quote }}
          {{- end }}
          {{- if .Values.env.seataEnv }}
            - name: SEATA_ENV
              value: {{ .Values.env.seataEnv }}
          {{- end }}
          {{- if .Values.env.seataConfigName }}
            - name: SEATA_CONFIG_NAME
              value: {{ .Values.env.seataConfigName }}
          {{- end }}
          {{- if .Values.env.serverNode }}
            - name: SERVER_NODE
              value: {{ .Values.env.serverNode | quote }}
          {{- end }}
          {{- if .Values.env.storeMode }}
            - name: STORE_MODE
              value: {{ .Values.env.storeMode }}
          {{- end }}
        {{- end }}
     {{- if .Values.volume }}
      volumes:
        {{- range .Values.volume }}
        - name: {{ .name }}
          nfs:
            server: {{ .nfsServers }}
            path: {{ .nfsPath }}
        {{- end}}
     {{- end}}

只是改动的这块:

     {{- if .Values.volume }}
      volumes:
        {{- range .Values.volume }}
        - name: {{ .name }}
          nfs:
            server: {{ .nfsServers }}
            path: {{ .nfsPath }}
        {{- end}}
     {{- end}}

values.yaml 完整:

replicaCount: 1

namespace: default

image:
  repository: seataio/seata-server
  tag: 1.5.1
  pullPolicy: IfNotPresent

service:
  type: NodePort
  port: 30091
  nodePort: 30091

env:
  seataPort: "8091"
  storeMode: "file"
  seataIp: "192.168.56.211"
  seataConfigName: "file:/root/seata-config/registry/registry.conf"

volume:
  - name: seata-config
    mountPath: /seata-server/resources
    nfsServers: 192.168.56.211
    nfsPath: /data/k8s/resource

env的环境之前配置过但是没有起作用,可以不用写:

seataConfigName:后面的内容
把/seata-server/resources 下的文件挂载到
/data/k8s/resource下

把上篇博文的文件下的文件修改后上传到 /data/k8s/resource文件下:

 

application.yaml 也与上篇博文一样:

server:
  port: 7091

spring:
  application:
    name: seata-server

logging:
  config: classpath:logback-spring.xml
  file:
    path: ${user.home}/logs/seata
  extend:
    logstash-appender:
      destination: 127.0.0.1:4560
    kafka-appender:
      bootstrap-servers: 127.0.0.1:9092
      topic: logback_to_logstash
console:
  user:
    username: seata
    password: seata

seata:
  config:
    # support: nacos 、 consul 、 apollo 、 zk  、 etcd3
    type: nacos
    nacos:
      server-addr: 192.168.56.211:30683
      namespace: public
      group: SEATA_GROUP
      username: nacos
      password: nacos
      ##if use MSE Nacos with auth, mutex with username/password attribute
      #access-key: ""
      #secret-key: ""
      data-id: seata.properties
  registry:
    # support: nacos 、 eureka 、 redis 、 zk  、 consul 、 etcd3 、 sofa
    type: nacos
    preferred-networks: 192.168.*
    nacos:
      application: seata-server
      server-addr: 192.168.56.211:30683
      group: SEATA_GROUP
      namespace: public
      cluster: default
      username: nacos
      password: nacos
      ##if use MSE Nacos with auth, mutex with username/password attribute
      #access-key: ""
      #secret-key: ""

  store:
    # support: file 、 db 、 redis
    mode: db
    session:
      mode: db
    lock:
      mode: db
    file:
      dir: sessionStore
      max-branch-session-size: 16384
      max-global-session-size: 512
      file-write-buffer-cache-size: 16384
      session-reload-read-size: 100
      flush-disk-mode: async
    db:
      datasource: druid
      db-type: mysql
      driver-class-name: com.mysql.jdbc.Driver
      url: jdbc:mysql://192.168.56.211:31306/seata?rewriteBatchedStatements=true
      user: root
      password: s00J8De852
      min-conn: 5
      max-conn: 100
      global-table: global_table
      branch-table: branch_table
      lock-table: lock_table
      distributed-lock-table: distributed_lock
      query-limit: 100
      max-wait: 5000
  security:
    secretKey: SeataSecretKey0c382ef121d778043159209298fd40bf3850a017
    tokenValidityInMilliseconds: 1800000
    ignore:
      urls: /,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/api/v1/auth/login      

5.直接启动 

cd /root/seata 

helm install  seata ./seata-server

6.查看

 7.访问nacos 看到已经被注册到nacos中。

 

 

 

 

相关文章:

  • 物业公司如何解决降本增收?快鲸智慧社区系统来帮你
  • MobTech 短信验证Android端 API
  • kafka学习总结
  • 政策汇总 | 川渝发布若干政策支持双城经济圈健康发展、岷山行动计划第三批项目申报解答......近期16个政策汇总
  • Vue3.0中使用路由进行跳转和传参以及取值
  • 迷茫了3年:做完这个测试项目,我终于决定辞职
  • 时间相关模块
  • LINU下登录脚本的执行顺序
  • MySQL 文本函数和窗口函数
  • springboot+cloud实战派PDF让开发和微服务架构像喝水一样简单
  • QML自定义的日历控件
  • Hive的 mapreduce 计算例子
  • 代码演示傅里叶合成演示
  • 【实用工具】magic-api接口快速开发框架
  • 在线客服功能介绍-了解常见在线客服系统的功能点
  • [分享]iOS开发 - 实现UITableView Plain SectionView和table不停留一起滑动
  • android 一些 utils
  • AngularJS指令开发(1)——参数详解
  • const let
  • GraphQL学习过程应该是这样的
  • JavaScript新鲜事·第5期
  • Java多态
  • leetcode388. Longest Absolute File Path
  • PAT A1017 优先队列
  • React组件设计模式(一)
  • Spring Cloud(3) - 服务治理: Spring Cloud Eureka
  • storm drpc实例
  • 分布式任务队列Celery
  • 后端_MYSQL
  • 技术:超级实用的电脑小技巧
  • 开源SQL-on-Hadoop系统一览
  • 软件开发学习的5大技巧,你知道吗?
  • 使用 Node.js 的 nodemailer 模块发送邮件(支持 QQ、163 等、支持附件)
  • 在Docker Swarm上部署Apache Storm:第1部分
  • 自制字幕遮挡器
  • 深度学习之轻量级神经网络在TWS蓝牙音频处理器上的部署
  • FaaS 的简单实践
  • mysql 慢查询分析工具:pt-query-digest 在mac 上的安装使用 ...
  • 测评:对于写作的人来说,Markdown是你最好的朋友 ...
  • #Java第九次作业--输入输出流和文件操作
  • (1)STL算法之遍历容器
  • (Java)【深基9.例1】选举学生会
  • (二)linux使用docker容器运行mysql
  • (附源码)计算机毕业设计ssm基于B_S的汽车售后服务管理系统
  • (附源码)流浪动物保护平台的设计与实现 毕业设计 161154
  • (论文阅读23/100)Hierarchical Convolutional Features for Visual Tracking
  • (十) 初识 Docker file
  • (五)大数据实战——使用模板虚拟机实现hadoop集群虚拟机克隆及网络相关配置
  • (转)linux 命令大全
  • (转)Mysql的优化设置
  • .Net core 6.0 升8.0
  • .Net IE10 _doPostBack 未定义
  • .NET教程 - 字符串 编码 正则表达式(String Encoding Regular Express)
  • @cacheable 是否缓存成功_让我们来学习学习SpringCache分布式缓存,为什么用?
  • @Valid和@NotNull字段校验使用