jira on k8s实战
waht?
你可能没听说过Atlassian,但我如果说:JIRA、Confluence、Bitbucket是不是就熟悉多了。
他们家有很多产品,都真的非常好用。比如公司使用JIRA做项目管理,使用Confluence做文档、知识管理等(我个人用它来做笔记)。
架构
如何选择chart
官方的chart
官方的chart 虽然前面,但是这个chart目前还不能部署成功
https://artifacthub.io/packages/helm/atlassian-data-center/jira
mox 的chart
相对比较简单. 外部存储使用nfs、外部数据库使用自建数据库、访问方式选择nodeport
https://artifacthub.io/packages/helm/mox/jira-software
【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
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
【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: <to set explicitly, choose port between 30000-32767> ## https: <to set explicitly, choose port between 30000-32767> ## 外部可访问的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: <storageClass> # 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
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
登录地址及密码
http://10.50.10.31:30103/login.jsp 账密: admin/admin
官方社区问答
这里是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
参考
【2】jira运维与二开