1.创建Service.yaml文件
vim jira_service.yaml
apiVersion: v1
kind: Service
metadata:
labels:
app: jira
name: jira
spec:
ports:
- port: 8080
targetPort: 8080
selector:
app: jira
type: NodePort
---
apiVersion: v1
kind: Service
metadata:
name: jira-headless
labels:
app: jira
spec:
ports:
- port: 8080
name: jira-server
clusterIP: None
selector:
app: jira
2.创建jira部署yaml文件
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
app: jira
name: jira
spec:
replicas: 1
selector:
matchLabels:
app: jira
serviceName: jira-headless
template:
metadata:
labels:
app: jira
name: jira
spec:
containers:
- name: jira
image: registry.cn-hangzhou.aliyuncs.com/mypaas/jira:7.13.0
imagePullPolicy: Always
resources:
requests:
memory: "1Gi"
cpu: "1000m"