• JIRA on K8s helm部署实战


    jira on k8s实战

    waht?

    你可能没听说过Atlassian,但我如果说:JIRAConfluenceBitbucket是不是就熟悉多了。

    他们家有很多产品,都真的非常好用。比如公司使用JIRA做项目管理,使用Confluence做文档、知识管理等(我个人用它来做笔记)。

    架构

    如何选择chart

    官方的chart

    官方的chart 虽然前面,但是这个chart目前还不能部署成功

    https://artifacthub.io/packages/helm/atlassian-data-center/jira
    
    • 1

    mox 的chart

    相对比较简单. 外部存储使用nfs、外部数据库使用自建数据库、访问方式选择nodeport

    https://artifacthub.io/packages/helm/mox/jira-software
    
    • 1
    【1】mox chart 安装脚本

    在脚本中指定数据库连接信息,这不是推荐的做法,可以使用secret 将DB 账密隐藏起来

    helm install my-release \
          --set databaseConnection.host="mydb.example.com" \
          --set databaseConnection.user="test" \
          --set databaseConnection.password="testpass" \
          --set databaseConnection.database="jiradb" \
          --set databaseConnection.port="5432" \
          --set databaseConnection.urlPrefix="jdbc:postgresql" \
          --set databaseConnection.databaseDriver="org.postgresql.Driver" \
          --set databaseConnection.type="postgres72" \
          --set databaseConnection.schemaName="public" \
          /opt/helm/jira-software/ -n jira
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11

    结果

    [root@master2 /opt/helm/jira-software]# helm install jira-for-cim       --set databaseConnection.host="10.50.10.25"       --set databaseConnection.user="dbuser_dba"       --set databaseConnection.password="DBUser.DBA"       --set databaseConnection.database="meta"       --set databaseConnection.port="5432"       --set databaseConnection.urlPrefix="jdbc:postgresql"       --set databaseConnection.databaseDriver="org.postgresql.Driver"       --set databaseConnection.type="postgres72"       --set databaseConnection.schemaName="public" /opt/helm/jira-software/ -n jira
    NAME: jira-for-cim
    LAST DEPLOYED: Wed Nov 23 10:42:49 2022
    NAMESPACE: jira
    STATUS: deployed
    REVISION: 1
    TEST SUITE: None
    NOTES:
    # 1. Get the application URL by running these commands:
      export NODE_PORT=$(kubectl get --namespace jira -o jsonpath="{.spec.ports[0].nodePort}" services jira-for-cim-jira-software)
      export NODE_IP=$(kubectl get nodes --namespace jira -o jsonpath="{.items[0].status.addresses[0].address}")
      echo http://$NODE_IP:$NODE_PORT
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    【2】生产环境的yaml

    部分重要配置

    # https://helm.mox.sh
    image:
      # 仓库修改为自己的,先自己在有外网的机器上拉去,然后push上去
      repository: 10.50.10.185/jira/atlassian/jira-software 
      tag: "latest"
      ## Specify a imagePullPolicy
      ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
      ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
      ##
      pullPolicy: IfNotPresent
      ## Optionally specify an array of imagePullSecrets.
      ## Secrets must be manually created in the namespace.
      ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
    # 服务暴露方式
    service:
      ## For minikube, set this to NodePort, elsewhere use LoadBalancer
      type: NodePort
      ## Use serviceLoadBalancerIP to request a specific static IP, otherwise leave blank
      ##
      ## Avoid removing the http connector, as the Synchrony proxy health check, still requires HTTP
      ## HTTP Port, must be the same as ATL_TOMCAT_PORT (default: 8080)
      port: 8080
      ## nodePorts:
      ##   http: 
      ##   https: 
      ## 外部可访问的ip,注意区间
      nodePorts:
        http: 30103
        https:
    # 资源限制
    resources:
      requests: # 首次启动至少需要的资源
        memory: 4Gi
        cpu: 1
      limits:  # 对总消耗资源的限制
        memory: 4Gi
    persistence:
      enabled: true
      annotations: {}
      ## existingClaim needs the existing PVC name
      existingClaim: ""
      accessMode: ReadWriteOnce
      size: 50Gi
    
      ## If defined, storageClassName: 
      # nfs sc
      storageClass: nfs-storage-179sc
    
    envVars:
      #
      ## Memory / Heap Size (JVM_MINIMUM_MEMORY) Mandatory, see @Notes above
      ## default: 1024m
      JVM_MINIMUM_MEMORY: 2048m
      ## Memory / Heap Size (JVM_MAXIMUM_MEMORY) Mandatory, see @Notes above
      ## default: 1024m
      JVM_MAXIMUM_MEMORY: 2048m
      ## The reserved code cache size of the JVM
      # JVM_RESERVED_CODE_CACHE_SIZE: 512m
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58

    jira 的sharedHome 和localHome 的区别?

    在这里插入图片描述

    申请license

    在这里插入图片描述
    在这里插入图片描述

    在这里插入图片描述

    license的限制

    这个license 应该是只有90天,且只能绑定到指定ip上。

    AAAB2w0ODAoPeNp9kl9vokAUxd/5FCT7spsNFIZIWxOStUCjG0ED1KbGlxGvMi4w7Axg+fbLv0a3Uh9v5t57fnPO/RYUILq0FBESkTpW9TG6F00/EJGCkPAHqhUwTmhqqLqi3CsPmqYKBwaQRjTLgMlzEkLKwd6RvOmy3cD2lt7MtwW3SLbAFvsXXm8wJFUwaZrjMHdxAsaRRqmcMPn0/uuQYBLLIU2EI2FYvhpbFiyMMAcL52A0VJKqSkgTeuWgyqBdaS4cx/bM2WT+8WS/Z4RVF3OomesxbKeWHebwgZXAZpbxNH8zpaeJE0hm4HqSNQqUDjJjdFeEudwUEqf7/IQZyPVWUoKRswJutdVA2IQ0B9a1xh3tFPPIcMyT+TytTj95sl+rW/s1ikbE+rvM0kCHRcUmkafcxaUSPr8Gu+N6VTr8rdQe/fXUX9HJxtgYgl9sechI1uZxZvk6qIE4h0yt/aqZU5yGXxh748tXofY6tcfzmeXbrjRXHx41pI/0bs1nj+oWY6BtWM3PMWsm9zjmICzYAaeE4/bbYUhzwWTQVp8vqg/i4+LRf860MBkjvA/YgrPLv2t50e/lxe8NvNjR/9iMRbvEcdEKdtBXZ3LD9EuCy7nzzq7+BygDTMYwLAIUZTubAbnGSD1NupQMTmoV2JmzDTECFDmcSTJUGqj+hIhlQQv+m7gNFZD0X02mi
    
    • 1

    登录地址及密码

    http://10.50.10.31:30103/login.jsp
    
    账密: admin/admin
    
    • 1
    • 2
    • 3

    在这里插入图片描述

    官方社区问答

    这里是k8s on jira的一个论坛,看起来并不活跃。

    https://community.atlassian.com/t5/Jira-questions/Jira-on-Kubernetes/qaq-p/1301550#U2198629

    禅道 on k8s

    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: zentao-pvc
      namespace: jira
    spec:
      accessModes:
      - ReadWriteMany
      storageClassName: nfs-storage-179sc
      resources:
        requests:
          storage: 100Gi 
    ---
    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: zentao-mysql-pvc
      namespace: jira
    spec:
      accessModes:
      - ReadWriteMany
      storageClassName: nfs-storage-179sc
      resources:
        requests:
          storage: 50Gi
    ---
    apiVersion: v1
    kind: Service
    metadata:
      labels:
        app: zentao
      name: zentao-client
      namespace: jira
    spec:
      ports:
      - port: 80
        nodePort: 30105
        name: zentao
      selector:
        app: zentao
      type: NodePort
    ---
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: zentao
      namespace: jira
      labels:
        app: zentao
    spec:
      selector:
        matchLabels:
          app: zentao
      replicas: 1
      template:
        metadata:
          labels:
            app: zentao
        spec:
          containers:
          - name: zentao
            image: 10.50.10.185/jira/easysoft/zentao:12.4.3
            #https://hub.docker.com/r/easysoft/zentao/tags
            resources:
              requests: 
                memory: "4Gi"
                cpu: "1"
              limits:
                memory: "4Gi"
                cpu: "1"
            env:
            - name: MYSQL_ROOT_PASSWORD
              value: '123456'
              #mysql密码
            ports:
            - name: zentao
              containerPort: 80
            - name: mysql
              containerPort: 3306
            volumeMounts:
            - name: zentao-data 
              mountPath: /www/zentaopms
            - name: zentao-mysql
              mountPath: /var/lib/mysql
          volumes:
            - name: zentao-data 
              persistentVolumeClaim:
                claimName: zentao-pvc
            - name: zentao-mysql 
              persistentVolumeClaim:
                claimName: zentao-mysql-pvc
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92

    参考

    【1 】helm安装 by mox user

    【2】jira运维与二开

  • 相关阅读:
    javaee之通用mapper
    面向阿克曼移动机器人(自行车模型)的LQR(最优二次型调节器)路径跟踪方法
    leetcode 83. Remove Duplicates from Sorted List 删除排序链表中的重复元素(简单)
    雷达模拟器 HPx-310
    宠物喂食器方案智能开发设计
    Selenium结合Jenkins进行持续集成
    python-(6-3-3)爬虫---requests入门(对参数封装)
    PWN环境搭建
    【36C++STL-常用容器----3、stack容器详解】
    AXS2030 5.2W 单通道 AB/D 类音频功率放大器
  • 原文地址:https://blog.csdn.net/MyySophia/article/details/127998503