### 文章目录
- [@[toc]](#文章目录 @[toc] 一、部署yaml 二、访问使用 三、参考地址)
- [一、部署yaml](#文章目录 @[toc] 一、部署yaml 二、访问使用 三、参考地址)
- [二、访问使用](#文章目录 @[toc] 一、部署yaml 二、访问使用 三、参考地址)
- [三、参考地址](#文章目录 @[toc] 一、部署yaml 二、访问使用 三、参考地址)
一、部署yaml
-
部署前提是使用 nfs 作为动态 storageClass 存储。
cat >zentao.yaml<<EOF
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: zentao-pvc
namespace: work
spec:
accessModes:
- ReadWriteMany
storageClassName: managed-nfs-storage
resources:
requests:
storage: 1GiapiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: zentao-mysql-pvc
namespace: work
spec:
accessModes:
- ReadWriteMany
storageClassName: managed-nfs-storage
resources:
requests:
storage: 1GiapiVersion: v1
kind: Service
metadata:
labels:
app: zentao
name: zentao-client
namespace: work
spec:
ports:
- port: 80
targetPort: 80
nodePort: 30007
name: zentao
selector:
app: zentao
type: NodePortapiVersion: apps/v1
kind: Deployment
metadata:
name: zentao
namespace: work
labels:
app: zentao
spec:
selector:
matchLabels:
app: zentao
replicas: 1
template:
metadata:
labels:
app: zentao
spec:
containers:
- name: zentao
image: easysoft/zentao:12.4.3
#https://hub.docker.com/r/easysoft/zentao/tags
resources:
requests:
memory: "2Gi"
cpu: "2000m"
limits:
memory: "2Gi"
cpu: "2000m"
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
EOFkubectl create ns work
kubectl apply -f zentao.yaml#查看
[root@k8s-master1 ~]# kubectl get pods -n work
NAME READY STATUS RESTARTS AGE
zentao-584777bdf7-v8gjc 1/1 Running 0 13m
[root@k8s-master1 ~]# kubectl get pvc -n work
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
zentao-mysql-pvc Bound pvc-8537a52f-5e37-4a2f-acb0-770e5c1734d1 1Gi RWX managed-nfs-storage 13m
zentao-pvc Bound pvc-e079d51d-f681-4640-a2bb-44da2bd6b577 1Gi RWX managed-nfs-storage 13m
[root@k8s-master1 ~]# kubectl get pvc -n work |grep zentao
zentao-mysql-pvc Bound pvc-8537a52f-5e37-4a2f-acb0-770e5c1734d1 1Gi RWX managed-nfs-storage 13m
zentao-pvc Bound pvc-e079d51d-f681-4640-a2bb-44da2bd6b577 1Gi RWX managed-nfs-storage 13m
二、访问使用
访问:http://192.168.4.115:30007/
- 点击开始安装------------一直下一步------------输入数据库密码:123456
- 创建用户名:admin 密码:123456,勾选中导入demo数据。
- 输入admin和123456登录,修改密码为:Abcd12345@