Skip to content

Commit

Permalink
Merge pull request #163 from GiganticMinecraft/add-mcserver-helm-chart
Browse files Browse the repository at this point in the history
Add mcserver helm chart
  • Loading branch information
kory33 authored Mar 26, 2022
2 parents effaa9d + 396c817 commit cb3c046
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 0 deletions.
5 changes: 5 additions & 0 deletions helm-charts/proxy-kubernetes-cloudflared-mcserver/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v2
name: proxy-kubernetes-cloudflared-mcserver
version: "1.0.0"
maintainers:
- name: GiganticMinecraft
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: cloudflared-mcserver--{{ .Values.MCServerName }}
labels:
app: cloudflared-mcserver--{{ .Values.MCServerName }}
appgroup: cloudflared
release-namespace: {{ .Release.Namespace }}
spec:
replicas: 1
selector:
matchLabels:
app: cloudflared-mcserver--{{ .Values.MCServerName }}
appgroup: cloudflared
template:
metadata:
labels:
app: cloudflared-mcserver--{{ .Values.MCServerName }}
appgroup: cloudflared
env: prod
spec:
containers:
- name: cloudflared-mcserver--{{ .Values.MCServerName }}
image: cloudflare/cloudflared:2021.12.1
args:
- access
- tcp
- --loglevel
- debug
- --hostname
- mcserver--{{ .Values.MCServerName }}.{{ .Values.subdomain }}.seichi.click
- --url
- 0.0.0.0:25565
env:
- name: TUNNEL_SERVICE_TOKEN_ID
valueFrom:
secretKeyRef:
name: cloudflared-access-token
key: TUNNEL_SERVICE_TOKEN_ID
- name: TUNNEL_SERVICE_TOKEN_SECRET
valueFrom:
secretKeyRef:
name: cloudflared-access-token
key: TUNNEL_SERVICE_TOKEN_SECRET
ports:
- containerPort: 25565
name: minecraft
readinessProbe:
initialDelaySeconds: 15
periodSeconds: 5
timeoutSeconds: 1
successThreshold: 2
failureThreshold: 2
tcpSocket:
port: 25565
resources:
requests:
memory: 64Mi
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: cloudflared-mcserver--{{ .Values.MCServerName }}
spec:
type: ClusterIP
ports:
- name: minecraft
port: 25565
protocol: TCP
targetPort: 25565
selector:
app: cloudflared-mcserver--{{ .Values.MCServerName }}
appgroup: cloudflared
release-namespace: {{ .Release.Namespace }}
7 changes: 7 additions & 0 deletions helm-charts/proxy-kubernetes-cloudflared-mcserver/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# プロキシされる先のマインクラフトサーバーの識別子。
MCServerName: "s0"
# ホスト名の seichi.click 以下のサブドメイン名。
subdomain: "tcp-network"
# この二つの設定で、プロキシ先の hostname が
# mcserver--{{ .Values.mcserver-name }}.{{ .Values.subdomain }}.seichi.click
# のように設定される。

0 comments on commit cb3c046

Please sign in to comment.