2022年8月

简介

excalidraw是一个在线画布工具,可以在网页上随意涂画,多种编辑功能可选,还可以导入图片,保存等功能


项目地址

https://github.com/excalidraw/excalidraw


本站Demo(自用)

https://canvas.ipip.icu


部署

Docker部署

镜像仓库地址: https://hub.docker.com/r/excalidraw/excalidraw

基础环境:

  • Linux
  • Docker

命令:

docker run --rm -dit --name excalidraw -p 5000:80 excalidraw/excalidraw:latest
#请替换5000为你所在主机要暴露该服务web页面的端口

Kubernetes部署

  • 1

    vim excalideaw-deployment.yaml
  • 2

    apiVersion: apps/v1
    kind: Deployment
    metadata:
    name: excalidraw
    labels:
      app: excalidraw
    spec:
    replicas: 2
    template:
      metadata:
        name: excalidraw
        labels:
          app: excalidraw
      spec:
        containers:
          - name: excalidraw
            image: excalidraw/excalidraw
            imagePullPolicy: IfNotPresent
            resources:
              limits:
                cpu: 500m
                memory: 500Mi
              requests:
                cpu: 10m
                memory: 100Mi
            ports:
              - containerPort: 80
                name: excalidraw
        restartPolicy: Always
    selector:
      matchLabels:
        app: excalidraw

apiVersion: v1
kind: Service
metadata:
name: excalidraw
spec:
type: NodePort
selector:

app: excalidraw

ports:

- port: 80
  nodePort: 12345

***需要修改nodePort端口为你自己的,如果你用其他方式暴露则忽略***

- 3

kubectl create ns excalidraw

创建excalidraw namespace

- 4

kubectl apply -f excalideaw-deployment.yaml -n excalidraw

部署excalidraw 工作负载


公众号:电影美剧喵


0906

沼泽深处的女孩


0905

瑞克和莫蒂 S6E01

龙之家族S1E03


0903

坠落

俄亥俄州的魔鬼


0902

指环王 力量之戒


0901

我曾来过

爱在度假屋


0824

神探大战

DC萌宠特遣队

龙之家族


0825

外星+人

不Nope


0826

奥利不见了

首尔大作战

唯我独尊


0831

白日梦想家


转ts

ffmpeg -y -i ymlw.mp4 -vcodec copy -acodec copy -vbsf h264_mp4toannexb film.ts

切分片

ffmpeg -i film.ts -c copy -map 0 -f segment -segment_list index.m3u8 -segment_time 5 film-%03d.ts

如你所见,本站运行在Kubernetes集群中,当某个节点有问题或者需要重启时,依然能提供正常的访问能力,并且可以自动恢复,直接进行维护即可,得益于Kubernetes的调度,让本站的容灾能力得到提升,下面是yaml文件


需要修改的地方

  • storageClassName ##修改为你自己的存储类名
  • storage #持久化存储空间的大小
  • nodePort #暴露在宿主机上的端口

部署

kubectl create ns typecho #创建namespace命名空间
kubectl apply -f typecho.yaml -n typecho

Typecho yaml文件

apiVersion: apps/v1
kind: Deployment
metadata:
  name: typecho
  labels:
    app: typecho
spec:
  replicas: 2
  template:
    metadata:
      name: typecho
      labels:
        app: typecho
    spec:
      containers:
        - name: typecho
          image: 80x86/typecho:latest
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 80
              protocol: TCP
              name: http
          env:
            - name: TIMEZONE
              value: "Asia/Shanghai"
          resources:
            requests:
              cpu: "300m"
              memory: "512Mi"
            limits:
              cpu: "1000m"
              memory: "2048Mi"
          volumeMounts:
            - name: typecho-data
              mountPath: /data
              readOnly: false
      volumes:
        - name: typecho-data
          persistentVolumeClaim:
            claimName: typecho-data
      restartPolicy: Always
  selector:
    matchLabels:
      app: typecho
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: typecho-data
spec:
  accessModes:
    - ReadWriteMany
  storageClassName: "nfs-storage2"   #你自己的sc
  resources:
    requests:
      storage: 10Gi    #存储大小
---
---
apiVersion: v1
kind: Service
metadata:
  name: typecho
spec:
  type: NodePort
  selector:
    app: typecho
  ports:
    - port: 80
      nodePort: 12345