Я сделал репродукцию вашей проблемы, и ответ: Проверка готовности и живучести.
Ваша диаграмма не успевает встать, поэтому после того, как тест готовности вернет false, тест на живучесть убьети попробуйте сделать это снова и снова.
livenessProbe: указывает, работает ли контейнер. В случае сбоя проверки работоспособности кублет убивает Контейнер, и Контейнер подвергается политике перезапуска. Если Контейнер не предоставляет проверку живучести, по умолчанию используется состояние Успех.
readinessProbe: Указывает, готов ли Контейнер к запросам на обслуживание. В случае сбоя проверки готовности контроллер конечных точек удаляет IP-адрес модуля из конечных точек всех служб, соответствующих модулю. Состояние готовности по умолчанию до начальной задержки - Отказ. Если Контейнер не обеспечивает проверку готовности, состояние по умолчанию - Успех.
Вы можете использовать вашу команду после моего редактирования
helm install --name mine-release --set resources.requests.memory="1024Mi" --set minecraftServer.memory="1024M" --set minecraftServer.eula=TRUE --set livenessProbe.initialDelaySeconds=90 --set livenessProbe.periodSeconds=15 --set readinessProbe.initialDelaySeconds=90 --set readinessprobe.periodSeconds=15 --namespace=mine-release stable/minecraft
ИЛИ
Используйте helm fetch для загрузки диаграммы управления на свой компьютер
helm fetch stable/minecraft --untar
вместо изменения значений в команде установки helm, вы можете использовать текстовый редактор, например vi или nano, и обновлять все в minecraft / values.yaml
vi/nano ./minecraft/values.yaml
файл minecraft / values.yaml после редактирования
# ref: https://hub.docker.com/r/itzg/minecraft-server/
image: itzg/minecraft-server
imageTag: latest
## Configure resource requests and limits
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
##
resources:
requests:
memory: 1024Mi
cpu: 500m
nodeSelector: {}
tolerations: []
affinity: {}
securityContext:
# Security context settings
runAsUser: 1000
fsGroup: 2000
# Most of these map to environment variables. See Minecraft for details:
# https://hub.docker.com/r/itzg/minecraft-server/
livenessProbe:
command:
- mcstatus
- localhost:25565
- status
initialDelaySeconds: 90
periodSeconds: 15
readinessProbe:
command:
- mcstatus
- localhost:25565
- status
initialDelaySeconds: 90
periodSeconds: 15
minecraftServer:
# This must be overridden, since we can't accept this for the user.
eula: "TRUE"
# One of: LATEST, SNAPSHOT, or a specific version (ie: "1.7.9").
version: "1.14.4"
# This can be one of "VANILLA", "FORGE", "SPIGOT", "BUKKIT", "PAPER", "FTB", "SPONGEVANILLA"
type: "VANILLA"
# If type is set to FORGE, this sets the version; this is ignored if forgeInstallerUrl is set
forgeVersion:
# If type is set to SPONGEVANILLA, this sets the version
spongeVersion:
# If type is set to FORGE, this sets the URL to download the Forge installer
forgeInstallerUrl:
# If type is set to BUKKIT, this sets the URL to download the Bukkit package
bukkitDownloadUrl:
# If type is set to SPIGOT, this sets the URL to download the Spigot package
spigotDownloadUrl:
# If type is set to PAPER, this sets the URL to download the PaperSpigot package
paperDownloadUrl:
# If type is set to FTB, this sets the server mod to run
ftbServerMod:
# Set to true if running Feed The Beast and get an error like "unable to launch forgemodloader"
ftbLegacyJavaFixer: false
# One of: peaceful, easy, normal, and hard
difficulty: easy
# A comma-separated list of player names to whitelist.
whitelist:
# A comma-separated list of player names who should be admins.
ops:
# A server icon URL for server listings. Auto-scaled and transcoded.
icon:
# Max connected players.
maxPlayers: 20
# This sets the maximum possible size in blocks, expressed as a radius, that the world border can obtain.
maxWorldSize: 10000
# Allows players to travel to the Nether.
allowNether: true
# Allows server to announce when a player gets an achievement.
announcePlayerAchievements: true
# Enables command blocks.
enableCommandBlock: true
# If true, players will always join in the default gameMode even if they were previously set to something else.
forcegameMode: false
# Defines whether structures (such as villages) will be generated.
generateStructures: true
# If set to true, players will be set to spectator mode if they die.
hardcore: false
# The maximum height in which building is allowed.
maxBuildHeight: 256
# The maximum number of milliseconds a single tick may take before the server watchdog stops the server with the message. -1 disables this entirely.
maxTickTime: 60000
# Determines if animals will be able to spawn.
spawnAnimals: true
# Determines if monsters will be spawned.
spawnMonsters: true
# Determines if villagers will be spawned.
spawnNPCs: true
# Max view distance (in chunks).
viewDistance: 10
# Define this if you want a specific map generation seed.
levelSeed:
# One of: creative, survival, adventure, spectator
gameMode: survival
# Message of the Day
motd: "Welcome to Minecraft on Kubernetes!"
# If true, enable player-vs-player damage.
pvp: false
# One of: DEFAULT, FLAT, LARGEBIOMES, AMPLIFIED, CUSTOMIZED
levelType: DEFAULT
# When levelType == FLAT or CUSTOMIZED, this can be used to further customize map generation.
# ref: https://hub.docker.com/r/itzg/minecraft-server/
generatorSettings:
worldSaveName: world
# If set, this URL will be downloaded at startup and used as a starting point
downloadWorldUrl:
# force re-download of server file
forceReDownload: false
# If set, the modpack at this URL will be downloaded at startup
downloadModpackUrl:
# If true, old versions of downloaded mods will be replaced with new ones from downloadModpackUrl
removeOldMods: false
# Check accounts against Minecraft account service.
onlineMode: true
# If you adjust this, you may need to adjust resources.requests above to match.
memory: 1024M
# General JVM options to be passed to the Minecraft server invocation
jvmOpts: ""
# Options like -X that need to proceed general JVM options
jvmXXOpts: ""
serviceType: LoadBalancer
rcon:
# If you enable this, make SURE to change your password below.
enabled: false
port: 25575
password: "CHANGEME!"
serviceType: LoadBalancer
query:
# If you enable this, your server will be "published" to Gamespy
enabled: false
port: 25565
## Additional minecraft container environment variables
##
extraEnv: {}
persistence:
## minecraft data Persistent Volume Storage Class
## If defined, storageClassName: <storageClass>
## If set to "-", storageClassName: "", which disables dynamic provisioning
## If undefined (the default) or set to null, no storageClassName spec is
## set, choosing the default provisioner. (gp2 on AWS, standard on
## GKE, AWS & OpenStack)
##
# storageClass: "-"
dataDir:
# Set this to false if you don't care to persist state between restarts.
enabled: true
Size: 1Gi
podAnnotations: {}
Затем мы используем helm install
helm install --name mine-release --namespace=mine-release ./minecraft -f ./minecraft/values.yaml
Результатыиз helm install:
NAME: mine-release
LAST DEPLOYED: Fri Oct 11 14:52:17 2019
NAMESPACE: mine-release
STATUS: DEPLOYED
RESOURCES:
==> v1/PersistentVolumeClaim
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
mine-release-minecraft-datadir Pending standard 0s
==> v1/Pod(related)
NAME READY STATUS RESTARTS AGE
mine-release-minecraft-f4558bfd5-mwm55 0/1 Pending 0 0s
==> v1/Secret
NAME TYPE DATA AGE
mine-release-minecraft Opaque 1 0s
==> v1/Service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
mine-release-minecraft LoadBalancer 10.0.13.180 <pending> 25565:32020/TCP 0s
==> v1beta1/Deployment
NAME READY UP-TO-DATE AVAILABLE AGE
mine-release-minecraft 0/1 1 0 0s
NOTES:
Get the IP address of your Minecraft server by running these commands in the
same shell:
!! NOTE: It may take a few minutes for the LoadBalancer IP to be available. !!
You can watch for EXTERNAL-IP to populate by running:
kubectl get svc --namespace mine-release -w mine-release-minecraft
Результаты из логов:
[12:53:45] [Server-Worker-1/INFO]: Preparing spawn area: 98%
[12:53:45] [Server thread/INFO]: Time elapsed: 26661 ms
[12:53:45] [Server thread/INFO]: Done (66.833s)! For help, type "help"
[12:53:45] [Server thread/INFO]: Starting remote control listener
[12:53:45] [RCON Listener #1/INFO]: RCON running on 0.0.0.0:25575