jira 7.9.2部署到k8s并持久化

yaml文件如下:

root@bob-k8s3:/home/bob# cat jira.yml
apiVersion: v1
kind: Service
metadata:
  name: jira
  namespace: bob
spec:
  ports:
    - port: 8080
      targetPort: 8080
      protocol: TCP
  selector:
    app: jira
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: jira
  namespace: bob
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: jira
    spec:
      initContainers:
      - name: volume-mount-hack
        image: busybox
        command: ["sh", "-c", "chown -R 2:2 /var/atlassian/jira"]
        volumeMounts:
          - name: jira-volume
            mountPath: /var/atlassian/jira
            subPath: jira
      containers:
      - name: jira
        image: docker.jiuxia.com/jira:7.9.3
        ports:
        - containerPort: 8080
        volumeMounts:
        - name: jira-volume
          mountPath: /var/atlassian/jira
          subPath: bob-jira
        - name: jira-server-conf
          mountPath: /opt/atlassian/jira/conf/server.xml
          subPath: server.xml
      volumes:
        - name: jira-volume
          nfs:
            server: 10.108.52.135
            path: /nfs
        - name: jira-server-conf
          configMap:
            name: jira-server-conf
      imagePullSecrets:
      - name: docker-secret

server.xml文件内容



-












-

























-


-


-


















创建configmap

kubectl -n bob create configmap jira-server-conf --from-file=server.xml

部署

kubectl create -f jira.yml

在NFS服务器上查看挂载的内容

root@bob-Virtual-Machine:/nfs/hyf-jira# pwd
/nfs/hyf-jira
root@bob-Virtual-Machine:/nfs/bob-jira# ls
analytics-logs  caches  data  dbconfig.xml  export  import  jira-healthcheck-eol.json  log  logos  monitor  plugins  tmp

你可能感兴趣的:(jira 7.9.2部署到k8s并持久化)