minecraft

This commit is contained in:
Tomás Limpinho
2026-03-09 14:06:12 +00:00
parent 9297ee3964
commit 82675ca850
5 changed files with 44 additions and 20 deletions

View File

@ -6,10 +6,15 @@ metadata:
data: data:
SERVER_NAME: "Example Minecraft Server" SERVER_NAME: "Example Minecraft Server"
EULA: "true" EULA: "true"
VERSION: "1.21.1"
MAX_PLAYERS: "10" MAX_PLAYERS: "10"
ENABLE_WHITELIST: "true"
OPS: | OPS: |
tomas tomas
ENABLE_WHITELIST: "true" Shy_Doge
aleroqu
kiuma
WHITELIST: | WHITELIST: |
tomas tomas
Shy_Doge
aleroqu
kiuma

View File

@ -0,0 +1,9 @@
apiVersion: v1
kind: Secret
metadata:
name: minecraft-secret
namespace: minecraft
data:
SECRET_KEY: >-
c2VjcmV0IGRvIHBsYWl0Z2c=

View File

@ -2,11 +2,12 @@ apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: minecraft-service name: minecraft-service
namespace: stack-arr namespace: minecraft
spec: spec:
ports: ports:
- port: 19132 - port: 25565
protocol: UDP protocol: TCP
selector: selector:
app: minecraft app: minecraft
type: ClusterIP type: LoadBalancer
loadBalancerIP: 192.168.1.153

View File

@ -13,6 +13,7 @@ spec:
labels: labels:
app: minecraft app: minecraft
spec: spec:
hostNetwork: true # equivalente ao network_mode: host
securityContext: securityContext:
runAsNonRoot: true runAsNonRoot: true
runAsUser: 1013 runAsUser: 1013
@ -20,6 +21,14 @@ spec:
imagePullSecrets: imagePullSecrets:
- name: regcred - name: regcred
containers: containers:
- name: playit
image: ghcr.io/playit-cloud/playit-agent:0.17
env:
- name: SECRET_KEY
valueFrom:
secretKeyRef:
name: minecraft-secret # nome do Secret
key: SECRET_KEY # chave dentro do Secret
- name: minecraft - name: minecraft
image: itzg/minecraft-server image: itzg/minecraft-server
stdin: true stdin: true
@ -32,7 +41,7 @@ spec:
- configMapRef: - configMapRef:
name: minecraft-configmap name: minecraft-configmap
ports: ports:
- containerPort: 19132 - containerPort: 25565
name: serverport name: serverport
volumeMounts: volumeMounts:
- name: data - name: data

View File

@ -18,18 +18,18 @@
mode: '0644' mode: '0644'
#- name: Obter várias notas do Bitwarden - name: Obter várias notas do Bitwarden
# shell: | shell: |
# echo "unlock" echo "unlock"
# BW_SESSION=$(bw unlock {{ bw_password }} --raw) BW_SESSION=$(bw unlock {{ bw_password }} --raw)
# echo "get item" echo "get item"
# bw get item "{{ item.id }}" --session $BW_SESSION | jq -r '.notes' > {{ item.dest }} bw get item "{{ item.id }}" --session $BW_SESSION | jq -r '.notes' > {{ item.dest }}
# loop: loop:
# - { id: "iac.ansible.stackarr.minecraft.secret", dest: "/tmp/stack-arr/minecraft/kubernetes-files/files/minecraft-secret.yaml" } - { id: "iac.ansible.minecraft.minecraft.secret", dest: "/tmp/minecraft/minecraft/kubernetes-files/files/minecraft-secret.yaml" }
# args: args:
# executable: /bin/bash executable: /bin/bash
# environment: environment:
# BW_PASSWORD: "{{ BW_PASSWORD }}" BW_PASSWORD: "{{ BW_PASSWORD }}"
- name: Listar conteúdo do diretório remoto - name: Listar conteúdo do diretório remoto