Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

k8s-mc script help #3

Open
phreekbird opened this issue Mar 15, 2022 · 3 comments
Open

k8s-mc script help #3

phreekbird opened this issue Mar 15, 2022 · 3 comments

Comments

@phreekbird
Copy link

ubuntu at omega in ~/Documents/k3s-minecraft-server on main
$ k8s-mclist
NAME   MODE   VERSION   SERVER   RUNNING
error: array index out of bounds: index 22, length 7

get the above error when i try to list my running mc servers. have no idea how to exec into them and run commands without doing this first as i dunno what the names are.

@gilesknap
Copy link
Owner

It looks like something is up with your k8s installation since k8s-mclist just calls a basic kubectl command.

To find out what pods you have running:

kubectl get pods -n minecraft

Or you could try

kubectl get pods --all-namespaces

If you don't see anything in the first command.

@phreekbird
Copy link
Author

huh those commands work find, i wonder if its cause im using k3s?

@gilesknap
Copy link
Owner

So k8s-mclist only does this

kubectl -n minecraft get deploy -o $format

where format is set using

format=custom-columns=\
NAME:metadata.labels.release\
,MODE:spec.template.spec.containers[0].env[22].value\
,VERSION:spec.template.spec.containers[0].env[2].value\
,SERVER:'spec.template.spec.nodeSelector.kubernetes\.io/hostname'\
,RUNNING:status.availableReplicas

I can only assume that one of the columns in format is missing from your setup for some reason - its not a great errror!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants