赞
踩
最近折腾了一下emby,实现了一个比较绕的玩法。
下面可能废话比较多,便于从0开始。
apt install -y vim
。避免鼠标右键粘贴出问题,需要配置vi ~/.vimrc
if has("mouse")
set mouse-=a
endif
vi /etc/resolv.conf
, 内容为 nameserver 192.168.1.1(ip自己改,一般是你的无线路由或者光猫)vi /etc/network/interfaces
,(具体ip自己改,网关一般是你的无线路由或者光猫),如果你的硬件名不是eth0,则使用你的硬件名。具体通过:ls /sys/class/net
找auto eth0
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.xx
netmask 255.255.255.0
gateway 192.168.1.1
bradcase 192.168.1.255
systemctl restart networking
vi /etc/ssh/sshd_config
systemctl restart sshd
apt install -y cifs-utils
vi /root/.smbcred
username=windows共享服务器的用户名
password=windows共享服务器的密码
vi /etc/fstab
//windows的ip/共享的目录(如//192.168.1.2/movie) /本地的目录(如/mnt/media/movie) cifs ro,vers=3.0,credentials=/root/.smbcred
mount -t cifs //192.168.1.2/movie /mnt/media/movie -o ro,vers=3.0,credentials=/root/.smbcred
curl -sfL http://rancher-mirror.cnrancher.com/k3s/k3s-install.sh | INSTALL_K3S_MIRROR=cn sh -s -
k3s kubectl get node
vi emby.yaml
#pvc kind: PersistentVolumeClaim apiVersion: v1 metadata: name: emby-config spec: resources: requests: storage: 10Gi accessModes: - ReadWriteOnce storageClassName: local-path --- #svc apiVersion: v1 kind: Service metadata: name: emby labels: app: emby spec: type: NodePort ports: - name: emby port: 8096 targetPort: 8096 nodePort: 30030 selector: app: emby --- #deploy apiVersion: apps/v1 kind: Deployment metadata: name: emby labels: app: emby spec: replicas: 1 selector: matchLabels: app: emby template: metadata: labels: app: emby spec: containers: - name: emby image: emby/embyserver ports: - containerPort: 8096 resources: limits: cpu: 2000m memory: 4096Mi requests: cpu: 100m memory: 256Mi volumeMounts: - name: emby-config mountPath: /config - name: emby-media mountPath: /media - name: localtime readOnly: true mountPath: /etc/localtime volumes: - name: emby-config persistentVolumeClaim: claimName: emby-config - name: emby-media hostPath: type: Directory path: /mnt/media - name: localtime hostPath: type: File path: /etc/localtime strategy: type: Recreate
kubectl apply -f emby.yaml
然后就可以盯着看了 watch 'kubectl get pod'
,等到emby的pod状态为Running就成功了
最后补充下。当你想卸载的时候,linux上只需要跑 kubectl delete -f emby.yaml
,你的config存储和程序就都没了。
当你连linux虚机也不想要了的时候,直接把虚机删了。
原有的win上的媒体文件不受任何影响,非常方便。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。