Build defiant
This commit is contained in:
parent
ebb54c74e7
commit
8ab5245778
10 changed files with 261 additions and 0 deletions
|
@ -2,9 +2,11 @@ variables:
|
|||
WEBSITE_SRC: ${CI_PROJECT_DIR}/website
|
||||
INFRA_SRC: ${CI_PROJECT_DIR}/infra
|
||||
TEAMSPEAK_SRC: ${CI_PROJECT_DIR}/teamspeak
|
||||
DEFIANT_SRC: ${CI_PROJECT_DIR}/defiant
|
||||
|
||||
IMAGE_PREFIX: registry.gitlab.com/momothereal/momoperes.ca
|
||||
WEBSITE_IMAGE: ${IMAGE_PREFIX}/website
|
||||
DEFIANT_IMAGE: ${IMAGE_PREFIX}/defiant
|
||||
|
||||
KUBECONFIG_PARENT: /etc/deploy
|
||||
KUBECONFIG: ${KUBECONFIG_PARENT}/config
|
||||
|
@ -48,6 +50,8 @@ website:deploy:
|
|||
changes:
|
||||
- website/**/*
|
||||
|
||||
# INFRA #
|
||||
|
||||
infra:deploy:
|
||||
stage: deploy
|
||||
image: lwolf/helm-kubectl-docker:v1.15.4-v2.14.3
|
||||
|
@ -68,6 +72,8 @@ infra:deploy:
|
|||
changes:
|
||||
- infra/**/*
|
||||
|
||||
# TEAMSPEAK #
|
||||
|
||||
teamspeak:deploy:
|
||||
stage: deploy
|
||||
image: lwolf/helm-kubectl-docker:v1.15.4-v2.14.3
|
||||
|
@ -85,3 +91,22 @@ teamspeak:deploy:
|
|||
- master
|
||||
changes:
|
||||
- teamspeak/**/*
|
||||
|
||||
# DEFIANT #
|
||||
|
||||
defiant:release:
|
||||
stage: release
|
||||
image:
|
||||
name: gcr.io/kaniko-project/executor:debug
|
||||
entrypoint: [""]
|
||||
script:
|
||||
- cd ${DEFIANT_SRC}/src
|
||||
- git clone https://github.com/momothereal/code-jam-2.git defiant
|
||||
- cp main_config.yaml defiant/config/main_config.yaml
|
||||
|
||||
- echo "Building to ${DEFIANT_IMAGE}:${CI_COMMIT_TAG}"
|
||||
- echo "{\"auths\":{\"${CI_REGISTRY}\":{\"username\":\"${CI_REGISTRY_USER}\",\"password\":\"${CI_REGISTRY_PASSWORD}\"}}}" > /kaniko/.docker/config.json
|
||||
- /kaniko/executor --context ${DEFIANT_SRC}/src/defiant --dockerfile ${DEFIANT_SRC}/src/defiant/Dockerfile --destination ${DEFIANT_IMAGE}:${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHORT_SHA} --destination ${DEFIANT_IMAGE}:${CI_COMMIT_REF_SLUG}
|
||||
only:
|
||||
changes:
|
||||
- defiant/**/*
|
2
defiant/.gitignore
vendored
Normal file
2
defiant/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
.idea/
|
||||
chart/defiant/manifests/
|
5
defiant/chart/defiant/Chart.yaml
Normal file
5
defiant/chart/defiant/Chart.yaml
Normal file
|
@ -0,0 +1,5 @@
|
|||
apiVersion: v1
|
||||
description: DefiantSails entry for PythonDiscord code jam number 2
|
||||
engine: gotpl
|
||||
name: defiant
|
||||
version: 0.1.0
|
50
defiant/chart/defiant/templates/deployment.yaml
Normal file
50
defiant/chart/defiant/templates/deployment.yaml
Normal 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 }}
|
61
defiant/chart/defiant/templates/rethinkdb-deployment.yaml
Normal file
61
defiant/chart/defiant/templates/rethinkdb-deployment.yaml
Normal 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 }}
|
28
defiant/chart/defiant/templates/rethinkdb-pvc.yaml
Normal file
28
defiant/chart/defiant/templates/rethinkdb-pvc.yaml
Normal 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 }}
|
19
defiant/chart/defiant/templates/rethinkdb-service.yaml
Normal file
19
defiant/chart/defiant/templates/rethinkdb-service.yaml
Normal 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 }}
|
19
defiant/chart/defiant/templates/service.yaml
Normal file
19
defiant/chart/defiant/templates/service.yaml
Normal 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 }}
|
26
defiant/chart/defiant/values.yaml
Normal file
26
defiant/chart/defiant/values.yaml
Normal 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
|
26
defiant/src/main_config.yaml
Normal file
26
defiant/src/main_config.yaml
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue