Redo code cleanup (#429)

* Code cleanup of routes config loader and API server (#424)

(cherry picked from commit 1ee3eb4de3)

* Refactored server setup and run out of main (#425)

(cherry picked from commit 05c57c3b85)

* Code cleanup in and around connector (#427)

(cherry picked from commit b3e88db48c)

* Update away from deprecated k8s NewInformer

* Tidy up couple of k8s docs examples
This commit is contained in:
Geoff Bourne
2025-07-13 10:00:40 -05:00
committed by GitHub
parent 172aed3893
commit af1e193958
21 changed files with 789 additions and 760 deletions
+18 -5
View File
@@ -34,22 +34,22 @@ apiVersion: apps/v1
kind: Deployment
metadata:
labels:
run: mc-router
name: mc-router
app: mc-router
name: mc-router-deployment
spec:
selector:
matchLabels:
run: mc-router
app: mc-router
strategy:
type: Recreate
template:
metadata:
labels:
run: mc-router
app: mc-router
spec:
serviceAccountName: mc-router
containers:
- image: itzg/mc-router:latest
- image: itzg/mc-router
name: mc-router
# Add "--auto-scale-up" here for https://github.com/itzg/mc-router/#auto-scale-up
args:
@@ -68,3 +68,16 @@ spec:
limits:
memory: 100Mi
cpu: "250m"
---
apiVersion: v1
kind: Service
metadata:
name: mc-router
spec:
selector:
app: mc-router
ports:
- protocol: TCP
port: 25565
targetPort: proxy
type: NodePort
+16 -15
View File
@@ -2,39 +2,38 @@
apiVersion: v1
kind: Service
metadata:
name: mc-stable
name: mc-latest
annotations:
"mc-router.itzg.me/defaultServer": "true"
spec:
type: ClusterIP
type: NodePort
ports:
- port: 25566
name: mc-router
targetPort: 25565
- port: 25565
name: minecraft
selector:
run: mc-stable
app: mc-latest
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
run: mc-stable
name: mc-stable
app: mc-latest
name: mc-latest
spec:
selector:
matchLabels:
run: mc-stable
app: mc-latest
template:
metadata:
labels:
run: mc-stable
app: mc-latest
spec:
securityContext:
runAsUser: 1000
fsGroup: 1000
containers:
- image: itzg/minecraft-server
name: mc-stable
name: mc-latest
env:
- name: EULA
value: "TRUE"
@@ -48,25 +47,27 @@ metadata:
annotations:
"mc-router.itzg.me/externalServerName": "snapshot.your.domain"
spec:
type: NodePort
ports:
- port: 25565
name: minecraft
selector:
run: mc-snapshot
app: mc-snapshot
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
run: mc-snapshot
app: mc-snapshot
name: mc-snapshot
spec:
selector:
matchLabels:
run: mc-snapshot
app: mc-snapshot
template:
metadata:
labels:
run: mc-snapshot
app: mc-snapshot
spec:
securityContext:
runAsUser: 1000