Added kustomize base files (#1800)

This commit is contained in:
Geoff Bourne 2022-10-23 22:00:16 -05:00 committed by GitHub
parent 1769f28015
commit 5e2553274f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 93 additions and 0 deletions

22
kustomize/README.md Normal file
View File

@ -0,0 +1,22 @@
This directory provides a base to use with [kubectl kustomize](https://kubernetes.io/docs/tasks/manage-kubernetes-objects/kustomization/).
## Example overlay content
### kustomization.yml
```yaml
nameSuffix: "-forge"
commonLabels:
server: forge
bases:
- https://github.com/itzg/docker-minecraft-server.git/kustomize/base
configMapGenerator:
- name: mc
envs:
- mc.env
```
### mc.env
```
EULA=true
TYPE=FORGE
```

View File

@ -0,0 +1,3 @@
resources:
- statefulset.yml
- service.yml

View File

@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
labels:
service: mc
annotations: {}
# Such as
# mc-router.itzg.me/externalServerName: $(EXTERNAL_SERVICE_NAME)
name: mc
spec:
ports:
- name: minecraft
port: 25565
targetPort: 25565
type: NodePort
selector:
server: mc

View File

@ -0,0 +1,51 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: mc
spec:
replicas: 1
serviceName: mc
selector:
matchLabels:
server: mc
template:
metadata:
labels:
server: mc
spec:
containers:
- name: mc
envFrom:
- configMapRef:
name: mc
optional: true
env: []
image: itzg/minecraft-server
stdin: true
tty: true
volumeMounts:
- mountPath: /data
name: data
resources:
requests:
cpu: 150m
livenessProbe:
exec:
command: ["mc-health"]
initialDelaySeconds: 120
periodSeconds: 60
readinessProbe:
exec:
command: ["mc-health"]
initialDelaySeconds: 20
periodSeconds: 10
failureThreshold: 12
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 500Mi