【发布时间】:2018-10-23 17:46:22
【问题描述】:
所以,请原谅我。一个月前刚开始学习docker和kubernets。
我已经完成了我的 .yml 文件,该文件可以获取我的 Minecraft 服务器并运行它。我现在想要 ftp 访问。目前,有一个用于 world 文件夹的驱动器和用于服务器的 config 文件夹(因为我不能将整个目录放在已安装的驱动器上(对吗?),并且每次重建映像时都需要保存这两个文件夹)。
所以,我希望能够访问 /config。最好在 minecraft 节点仍在读写时。这里有几个问题。
- 在为它制作 docker 文件时,如何制作最小的 FTP 图像?我无法弄清楚一个场景。我最好的是 python:alpine 上的基础图像,并使用类似 this 的东西
- 是否有可能让节点在另一个驱动器正在使用它时访问它?还是我必须在我制作的界面中制作一些自定义脚本来关闭我的世界服务器然后启动 FTP 节点?
当前 yml:
apiVersion: v1
kind: Service
metadata:
name: lapitos
labels:
type: lapitos
spec:
type: LoadBalancer
ports:
- name: minecraft
port: 25565
protocol: TCP
targetPort: 25565
- name: minecraft-rcon
port: 25575
protocol: TCP
targetPort: 25575
selector:
app: lapitos
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: lapitos
spec:
serviceName: lapitos
replicas: 1
selector:
matchLabels:
app: lapitos
template:
metadata:
labels:
app: lapitos
spec:
containers:
- name: lapitos
image: gcr.io/mchostingnet-202204/lapitosbeta2
resource:
limits:
cpu: "2"
requests:
cpu: "2"
ports:
- containerPort: 25565
name: minecraft
volumeMounts:
- name: world
mountPath: /world
- name: config
mountPath: /config
- name: logs
mountPath: /logs
volumeClaimTemplates:
- metadata:
name: world
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 25Gi
- metadata:
name: config
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 1Gi
- metadata:
name: logs
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 1Gi
【问题讨论】:
标签: docker kubernetes google-kubernetes-engine