k8s 部署 showdoc
ShowDoc 是一款专为IT团队设计的知识文档和API管理工具,它允许用户通过Markdown语法轻松地创建和编辑美观的API文档、数据字典文档、技术文档,甚至在线Excel文档。 本文通过kubernetes集群环境部署,接下来,我们将详细介绍如何部署。
showdoc部署
创建yaml文件
vi showdoc.yaml
apiVersion: v1
kind: Service
metadata:
labels:
app: showdoc
name: showdoc
namespace: project
spec:
ports:
- name: port-nginx
port: 80
protocol: TCP
targetPort: 80
selector:
app: showdoc
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: showdoc
namespace: project
spec:
replicas: 1
selector:
matchLabels:
app: showdoc
template:
metadata:
name: showdoc
creationTimestamp: null
labels:
app: showdoc
spec:
nodeName: k8s-node2
containers:
- image: registry.cn-shenzhen.aliyuncs.com/star7th/showdoc
name: showdoc
imagePullPolicy: IfNotPresent
volumeMounts:
- name: docdata
mountPath: /var/www/html
volumes:
- name: docdata
hostPath:
type: DirectoryOrCreate
path: /showdoc_data/html
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-showdoc
namespace: project
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
ingressClassName: nginx
rules:
- host: showdoc.test.com
http:
paths:
- path: /(.*)
pathType: ImplementationSpecific
backend:
service:
name: showdoc
port:
number: 80
执行安装
kubectl apply -f showdoc.yaml