Skip to content

Commit

Permalink
feat(shulker-operator): inject SHULKER_PROXY_PLAYER_DELTA_BEFORE_EXCL…
Browse files Browse the repository at this point in the history
…USION to proxies
  • Loading branch information
jeremylvln committed Feb 6, 2024
1 parent a4d3278 commit 6cde3d9
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ mod bungeecord {
server_icon: "A Server Icon".to_string(),
proxy_protocol: true,
ttl_seconds: 300,
players_delta_before_exclusion: 15,
};
let service_spec = Some(ProxyFleetServiceSpec {
type_: ProxyFleetServiceType::LoadBalancer,
Expand Down Expand Up @@ -552,6 +553,7 @@ mod velocity {
server_icon: "A Server Icon".to_string(),
proxy_protocol: true,
ttl_seconds: 300,
players_delta_before_exclusion: 15,
};
let service_spec = Some(ProxyFleetServiceSpec {
type_: ProxyFleetServiceType::LoadBalancer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ lazy_static! {
server_icon: "abc==".to_string(),
proxy_protocol: true,
ttl_seconds: 3600,
players_delta_before_exclusion: 15,
},
pod_overrides: Some(ProxyFleetTemplatePodOverridesSpec {
image: None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,11 @@ impl<'a> FleetBuilder {
value: Some(spec.config.ttl_seconds.to_string()),
..EnvVar::default()
},
EnvVar {
name: "SHULKER_PROXY_PLAYER_DELTA_BEFORE_EXCLUSION".to_string(),
value: Some(spec.config.players_delta_before_exclusion.to_string()),
..EnvVar::default()
},
EnvVar {
name: "SHULKER_NETWORK_ADMINS".to_string(),
value: Some(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ apiVersion: v1
kind: ConfigMap
data:
init-fs.sh: "#!/bin/sh\nset -euo pipefail\nset -o xtrace\n\ncp \"${SHULKER_CONFIG_DIR}/probe-readiness.sh\" \"${SHULKER_PROXY_DATA_DIR}/probe-readiness.sh\"\ncat \"${SHULKER_CONFIG_DIR}/server-icon.png\" | base64 -d > \"${SHULKER_PROXY_DATA_DIR}/server-icon.png\"\n\nif [ \"${SHULKER_VERSION_CHANNEL}\" == \"Velocity\" ]; then\n cp \"${SHULKER_CONFIG_DIR}/velocity-config.toml\" \"${SHULKER_PROXY_DATA_DIR}/velocity.toml\"\n echo \"dummy\" > \"${SHULKER_PROXY_DATA_DIR}/forwarding.secret\"\nelse\n cp \"${SHULKER_CONFIG_DIR}/bungeecord-config.yml\" \"${SHULKER_PROXY_DATA_DIR}/config.yml\"\nfi\n\nif [ ! -z \"${SHULKER_PROXY_PLUGIN_URLS+x}\" ]; then\n mkdir -p \"${SHULKER_PROXY_DATA_DIR}/plugins\"\n for plugin_url in ${SHULKER_PROXY_PLUGIN_URLS//;/ }; do\n (cd \"${SHULKER_PROXY_DATA_DIR}/plugins\" && wget \"${plugin_url}\")\n done\nfi\n\nif [ ! -z \"${SHULKER_PROXY_PATCH_URLS+x}\" ]; then\n for patch_url in ${SHULKER_PROXY_PATCH_URLS//;/ }; do\n (cd \"${SHULKER_PROXY_DATA_DIR}\" && wget \"${patch_url}\" -O - | tar -xzv)\n done\nfi\n"
probe-readiness.sh: "#!/bin/sh\nset -euo pipefail\nset -o xtrace\n\nif [ -f \"/tmp/drain-lock\" ]; then\n echo \"Drain lock found\" && exit 1\nfi\n\nbash /usr/bin/health.sh\n"
probe-readiness.sh: "#!/bin/sh\nset -euo pipefail\nset -o xtrace\n\nif [ -f \"/tmp/drain-lock\" ]; then\n echo \"Drain lock found\" && exit 1\nelif [ -f \"/tmp/readiness-lock\" ]; then\n echo \"Readiness lock found\" && exit 1\nfi\n\nbash /usr/bin/health.sh\n"
server-icon.png: abc==
velocity-config.toml: "config-version = \"2.6\"\nbind = \"0.0.0.0:25577\"\nmotd = \"A Motd\"\nshow-max-players = 1000\nonline-mode = true\nforce-key-authentication = true\nprevent-client-proxy-connections = true\nforwarding-secret-file = \"/mnt/shulker/forwarding-secret/key\"\nplayer-info-forwarding-mode = \"modern\"\n\n[servers]\nlobby = \"localhost:30000\"\nlimbo = \"localhost:30001\"\ntry = [\"lobby\", \"limbo\"]\n\n[forced-hosts]\n\n[advanced]\nhaproxy-protocol = true\ntcp-fast-open = true\n\n"
metadata:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ spec:
fieldPath: metadata.namespace
- name: SHULKER_PROXY_TTL_SECONDS
value: "3600"
- name: SHULKER_PROXY_PLAYER_DELTA_BEFORE_EXCLUSION
value: "15"
- name: SHULKER_NETWORK_ADMINS
value: ""
- name: SHULKER_PROXY_REDIS_HOST
Expand Down

0 comments on commit 6cde3d9

Please sign in to comment.