分类 Linux 下的文章
使用Docker/Kubernetes 部署excalidraw在线画板工具
- 作者: SUNBALCONY
- 时间:
- 分类: Linux,kubernetes,Docker
- 评论
简介
excalidraw是一个在线画布工具,可以在网页上随意涂画,多种编辑功能可选,还可以导入图片,保存等功能
项目地址
https://github.com/excalidraw/excalidraw
本站Demo(自用)
部署
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 工作负载
【在线记事本】你的下一个笔记本,何必是笔记本
- 作者: SUNBALCONY
- 时间:
- 分类: Linux,kubernetes,Docker
- 评论
简介
【在线记事本】是由本小破站老大开发,本小破站老大托管的在线记事本服务,原始格式保存,em表情支持,支持多种存储,即时保存的在线笔记本,支持Docker/Kubernetes多种部署方式。
体验地址: https://note.ipip.icu
项目地址
使用ffmpeg将mp4转为m3u8
- 作者: SUNBALCONY
- 时间:
- 分类: Linux
- 2 条评论
转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部署Typecho博客
- 作者: SUNBALCONY
- 时间:
- 分类: Linux,kubernetes,Docker
- 2 条评论
如你所见,本站运行在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