kubernetes部署showdoc 文档管理

  sre

pvc showdoc-data

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: showdoc-data
  namespace: sre
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: "300Gi"
  volumeName: 
  storageClassName: nfs-trojan


Deployment showdoc-server

apiVersion: apps/v1
kind: Deployment
metadata:
  name: showdoc-server
  namespace: sre
spec:
  replicas: 1
  selector:
    matchLabels:
      showdoc: server
  template:
    metadata:
      labels:
        showdoc: server
    spec:
      containers:
      - name: showdoc-server
        image: star7th/showdoc
        imagePullPolicy: IfNotPresent
        restartPolicy: OnFailure
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
        volumeMounts:
        - name: showdoc-data
          mountPath: /var/www
      volumes:
       - name: showdoc-data
         persistentVolumeClaim:
           claimName: showdoc-data

svc

kind: Service
apiVersion: v1
metadata:
  labels:
    showdoc: server
  name: showdoc-svc
  namespace: sre
spec:
  type: NodePort
  ports:
  - name: showdoc-http
    port: 80
    targetPort: 80
    nodePort: 30145
    protocol: TCP
  selector:
    showdoc: server

LEAVE A COMMENT

Captcha Code