所以,请原谅我。我一个月前刚刚开始学习docker和kubernets。
我已经达到了这样的程度,即我的.yml文件需要我的Minecraft服务器并运行它。我现在想要ftp访问。目前,有一个用于world文件夹的驱动器和用于服务器的config文件夹(因为我无法将整个目录放在已安装的驱动器上(对吗?),并且这两个文件夹需要在每次映像时保存重建)。
所以,我希望能够访问/配置。优选地,虽然Minecraft节点仍在读取和写入。这里有几个问题。
当前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
答案 0 :(得分:0)
1.-从任何注册表中获取适合您的ftp图像并使用它,而不是自己创建。如果仍然是要求,我不知道。 注意:Compute Engine已阻止端口21。
2.-是的,你可以。卷访问模式: