Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c309060
commit a40fcf1
Showing
8 changed files
with
200 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
apiVersion: v2 | ||
name: faf-content | ||
version: 1.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: faf-content | ||
labels: | ||
app: faf-content | ||
data: | ||
"default.conf": |- | ||
server { | ||
listen 80; | ||
listen [::]:80; | ||
server_name localhost; | ||
root /data; | ||
# K8s healthcheck | ||
# Access the path. If 200 is returned, Nginx can receive requests. | ||
location /health { | ||
access_log off; | ||
return 200; | ||
} | ||
location / { | ||
index index.html index.htm; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: faf-content | ||
labels: | ||
app: faf-content | ||
annotations: | ||
reloader.stakater.com/auto: "true" | ||
spec: | ||
replicas: 1 | ||
revisionHistoryLimit: 10 | ||
selector: | ||
matchLabels: | ||
app: faf-content | ||
template: | ||
metadata: | ||
labels: | ||
app: faf-content | ||
spec: | ||
containers: | ||
- image: nginx:1.25.4-alpine-slim | ||
imagePullPolicy: Always | ||
name: faf-content | ||
ports: | ||
- containerPort: 80 | ||
volumeMounts: | ||
- name: config | ||
mountPath: /etc/nginx/conf.d/default.conf | ||
subPath: default.conf | ||
- name: faf-replays-pvc | ||
mountPath: /data/replays | ||
readOnly: true | ||
- name: faf-maps-pvc | ||
mountPath: /data/maps | ||
readOnly: true | ||
- name: faf-mods-pvc | ||
mountPath: /data/mods | ||
readOnly: true | ||
- name: faf-featured-mods-pvc | ||
mountPath: /data/legacy-featured-mod-files | ||
readOnly: true | ||
- name: faf-content-pvc | ||
mountPath: /data | ||
readOnly: true | ||
startupProbe: | ||
httpGet: | ||
port: 80 | ||
path: /health | ||
initialDelaySeconds: 10 | ||
failureThreshold: 30 | ||
periodSeconds: 3 | ||
livenessProbe: | ||
httpGet: | ||
port: 80 | ||
path: /health | ||
failureThreshold: 3 | ||
periodSeconds: 10 | ||
restartPolicy: Always | ||
volumes: | ||
- name: config | ||
configMap: | ||
name: faf-content | ||
- name: faf-replays-pvc | ||
persistentVolumeClaim: | ||
claimName: faf-replays-pvc | ||
readOnly: true | ||
- name: faf-maps-pvc | ||
persistentVolumeClaim: | ||
claimName: faf-maps-pvc | ||
readOnly: true | ||
- name: faf-mods-pvc | ||
persistentVolumeClaim: | ||
claimName: faf-mods-pvc | ||
readOnly: true | ||
- name: faf-featured-mods-pvc | ||
persistentVolumeClaim: | ||
claimName: faf-featured-mods-pvc | ||
readOnly: true | ||
- name: faf-content-pvc | ||
persistentVolumeClaim: | ||
claimName: faf-content-pvc | ||
readOnly: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
apiVersion: traefik.io/v1alpha1 | ||
kind: Middleware | ||
metadata: | ||
name: cors | ||
spec: | ||
headers: | ||
accessControlAllowMethods: | ||
- "GET" | ||
accessControlAllowOriginList: | ||
- "*" | ||
accessControlMaxAge: 60 | ||
addVaryHeader: false | ||
|
||
--- | ||
|
||
apiVersion: traefik.io/v1alpha1 | ||
kind: Middleware | ||
metadata: | ||
name: redirect-replay-subdomain | ||
spec: | ||
redirectRegex: | ||
regex: ^(http|https)://replay.{{.Values.baseDomain}}/(\\d+) | ||
replacement: ${1}://api.{{.Values.baseDomain}}/game/${2}/replay" | ||
|
||
--- | ||
|
||
apiVersion: traefik.io/v1alpha1 | ||
kind: IngressRoute | ||
metadata: | ||
name: faf-content | ||
spec: | ||
entryPoints: | ||
- websecure | ||
routes: | ||
- match: Host(`content.{{.Values.baseDomain}}`) || Host(`replay.${DOMAINNAME}`) | ||
kind: Rule | ||
services: | ||
- name: faf-content | ||
port: 80 | ||
middlewares: | ||
- name: redirect-replay-subdomain | ||
- name: cors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: faf-content | ||
labels: | ||
app: faf-content | ||
spec: | ||
selector: | ||
app: faf-content | ||
ports: | ||
- port: 80 | ||
targetPort: 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,7 @@ spec: | |
resources: | ||
requests: | ||
storage: {{ .pv.size }} | ||
|
||
--- | ||
|
||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,4 +21,7 @@ spec: | |
operator: In | ||
values: | ||
- {{ $.Values.zfs.nodeId }} | ||
|
||
--- | ||
|
||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters