Build defiant

This commit is contained in:
Aram 🍐 2019-10-27 00:48:46 -04:00
parent ebb54c74e7
commit 8ab5245778
10 changed files with 261 additions and 0 deletions

2
defiant/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
.idea/
chart/defiant/manifests/

View file

@ -0,0 +1,5 @@
apiVersion: v1
description: DefiantSails entry for PythonDiscord code jam number 2
engine: gotpl
name: defiant
version: 0.1.0

View file

@ -0,0 +1,50 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}
labels:
app: defiant
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: 1
selector:
matchLabels:
app: defiant
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
template:
metadata:
{{- if .Values.podAnnotations }}
annotations:
{{ toYaml .Values.podAnnotations | indent 8 }}
{{- end }}
labels:
app: defiant
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
containers:
- name: defiant
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: 80
protocol: TCP
resources:
{{ toYaml .Values.resources | indent 12 }}

View file

@ -0,0 +1,61 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}
labels:
app: rethinkdb
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: 1
selector:
matchLabels:
app: rethinkdb
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
template:
metadata:
{{- if .Values.podAnnotations }}
annotations:
{{ toYaml .Values.podAnnotations | indent 8 }}
{{- end }}
labels:
app: rethinkdb
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
containers:
- name: defiant
image: "rethinkdb:2.3.6"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: 28015
protocol: TCP
resources:
{{ toYaml .Values.resources | indent 12 }}
volumeMounts:
- mountPath: /data
name: rethinkdb-data
volumes:
- name: rethinkdb-data
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ .Values.persistence.existingClaim | default (printf "%s-%s" (.Release.Name) "data") | quote }}
{{- else }}
emptyDir: {}
{{- end }}

View file

@ -0,0 +1,28 @@
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ .Release.Name }}-data
labels:
app: checkmk
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.persistence.annotations }}
annotations:
{{ toYaml .Values.persistence.annotations | indent 4 }}
{{- end }}
spec:
accessModes:
- {{ .Values.persistence.accessMode | quote }}
resources:
requests:
storage: {{ .Values.persistence.storageSize | quote }}
{{- if .Values.persistence.storageClass }}
{{- if (eq "-" .Values.persistence.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.persistence.storageClass }}"
{{- end }}
{{- end }}
{{- end }}

View file

@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}
labels:
app: rethinkdb
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
type: ClusterIP
ports:
- targetPort: 28015
protocol: TCP
name: rethinkdb
port: 28015
selector:
app: rethinkdb
release: {{ .Release.Name }}

View file

@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}
labels:
app: defiant
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
type: ClusterIP
ports:
- targetPort: 80
protocol: TCP
name: defiant-voice
port: 80
selector:
app: defiant
release: {{ .Release.Name }}

View file

@ -0,0 +1,26 @@
image:
repository: registry.gitlab.com/momothereal/momoperes.ca/defiant
tag: latest
pullPolicy: Always
podAnnotations: {}
resources:
limits:
cpu: 250m
memory: 512Mi
requests:
cpu: 100m
memory: 256Mi
nodeSelector: {}
tolerations: []
affinity: {}
persistence:
enabled: true
accessMode: ReadWriteOnce
annotations:
"helm.sh/resource-policy": keep
storageClass: do-block-storage
storageSize: 1Gi

View file

@ -0,0 +1,26 @@
web:
# Flask (web) configuration
ip: "0.0.0.0"
port: 80
database:
# RethinkDB configuration
ip: "rethinkdb.public"
port: 28015
database_name: "battle_myth_theater"
admin:
username: "admin" #Insecure, change from example credentials.
password: "admin" #Insecure, change from example credentials.
game:
max_stat_points: 20
debug: true
stories:
# Path to FFMPEG executable
ffmpeg: "/usr/bin/ffmpeg"
# Max story count per user.
# Note: this is ignored when 'debug' is set to true
max_story_count: 10