Skip to content

Instantly share code, notes, and snippets.

@ElderMael
Created December 5, 2023 22:15
Show Gist options
  • Save ElderMael/bd1416991b4e26dc477750621912f981 to your computer and use it in GitHub Desktop.
Save ElderMael/bd1416991b4e26dc477750621912f981 to your computer and use it in GitHub Desktop.
import * as k8s from "@pulumi/kubernetes";
import {config} from "./config";
export const minecraftNamespace = new k8s.core.v1.Namespace('minecraft', {
metadata: {
name: 'minecraft',
}
});
const minecraftChart = new k8s.helm.v3.Chart('minecraft-chart', {
namespace: minecraftNamespace.metadata.name,
chart: 'minecraft',
version: '4.9.0',
fetchOpts: {
repo: 'https://itzg.github.io/minecraft-server-charts/',
},
values: {
image: {
repository: 'itzg/minecraft-server',
tag: 'latest',
pullPolicy: 'IfNotPresent',
},
replicaCount: 1,
resources: {
requests: {
cpu: '4000m',
memory: '2348M',
},
limits: {
cpu: '6000m',
memory: '3000M',
},
},
minecraftServer: {
eula: "TRUE",
ops: "e600a7d7-7494-45af-8e47-a411a040cc9e,ElderMael,ElderMaelX,coreanos,ElderMichita,RoBlueKiran321",
maxPlayers: 5,
version: '1.19.2',
levelSeed: '8486214866965744170',
type: 'VANILLA',
// downloadModpackUrl: 'https://mediafiles.forgecdn.net/files/3988/24/Better+MC+%5bFABRIC%5d+1.19.2+v5.zip',
memory: "2048M",
gamemode: "survival",
difficulty: "normal",
serviceType: "LoadBalancer",
maxWorldSize: 20000,
maxBuildHeight: 512,
maxTickTime: 60000,
spawnAnimals: true,
spawnMonsters: true,
spawnNPCs: true,
motd: "Bienvenido al servidor de Brothers At Gaming :)",
removeOldMods: false,
allowNether: true,
announcePlayerAchievements: true,
},
extraEnv: {},
rcon: {
enabled: true,
port: 25575,
password: config.requireSecret('rcon-password'),
serviceType: "LoadBalancer",
},
persistence: {
storageClass: "local-path",
dataDir: {
enabled: true,
size: "2Gi"
},
},
initContainers: [
{
name: "permissions",
image: "busybox",
command: [
"sh",
"-c",
"chown -R 1000:2000 /data"
],
securityContext: {
runAsUser: 0,
},
volumeMounts: [
{
name: "datadir",
mountPath: "/data",
},
],
},
],
},
}, {
dependsOn: [
minecraftNamespace,
],
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment