-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
8a91c3f
commit 22210f5
Showing
5 changed files
with
273 additions
and
0 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
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,140 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: app-prod | ||
spec: | ||
progressDeadlineSeconds: 360 | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: app-prod | ||
strategy: | ||
type: Recreate | ||
template: | ||
metadata: | ||
labels: | ||
app: app-prod | ||
spec: | ||
containers: | ||
- name: app-prod | ||
image: ghcr.io/vatsim-radar/vatsim-radar/production | ||
imagePullPolicy: Always | ||
ports: | ||
- containerPort: 3000 | ||
volumeMounts: | ||
- name: radar-data | ||
mountPath: /radar/src/data | ||
resources: | ||
requests: | ||
cpu: 300m | ||
memory: 300Mi | ||
limits: | ||
cpu: 950m | ||
memory: 950Mi | ||
readinessProbe: | ||
tcpSocket: | ||
port: 3000 | ||
initialDelaySeconds: 5 | ||
periodSeconds: 15 | ||
successThreshold: 1 | ||
failureThreshold: 10 | ||
timeoutSeconds: 15 | ||
imagePullSecrets: | ||
- name: ghcr-login-secret | ||
nodeSelector: | ||
doks.digitalocean.com/node-pool: premium-amd | ||
volumes: | ||
- name: radar-data | ||
hostPath: | ||
path: /opt/prod/data | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: worker-prod | ||
spec: | ||
progressDeadlineSeconds: 360 | ||
replicas: 1 | ||
strategy: | ||
type: Recreate | ||
selector: | ||
matchLabels: | ||
app: worker-prod | ||
template: | ||
metadata: | ||
labels: | ||
app: worker-prod | ||
spec: | ||
imagePullSecrets: | ||
- name: ghcr-login-secret | ||
nodeSelector: | ||
doks.digitalocean.com/node-pool: premium-amd | ||
containers: | ||
- name: worker | ||
image: ghcr.io/vatsim-radar/vatsim-radar/production | ||
imagePullPolicy: Always | ||
command: ["/radar/.config/worker-prod.sh"] | ||
ports: | ||
- containerPort: 8880 | ||
volumeMounts: | ||
- name: radar-data | ||
mountPath: /radar/src/data | ||
resources: | ||
requests: | ||
cpu: 300m | ||
memory: 300Mi | ||
limits: | ||
cpu: 1000m | ||
memory: 1Gi | ||
readinessProbe: | ||
tcpSocket: | ||
port: 8880 | ||
initialDelaySeconds: 5 | ||
periodSeconds: 15 | ||
successThreshold: 1 | ||
failureThreshold: 10 | ||
timeoutSeconds: 15 | ||
volumes: | ||
- name: radar-data | ||
hostPath: | ||
path: /opt/prod/data | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: worker-prod | ||
spec: | ||
ports: | ||
- port: 8880 | ||
selector: | ||
app: worker-prod | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: app-prod | ||
spec: | ||
ports: | ||
- port: 3000 | ||
selector: | ||
app: app-prod | ||
--- | ||
apiVersion: autoscaling/v2 | ||
kind: HorizontalPodAutoscaler | ||
metadata: | ||
name: app-prod-hpa | ||
spec: | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: app-prod | ||
minReplicas: 1 | ||
maxReplicas: 12 | ||
metrics: | ||
- type: Resource | ||
resource: | ||
name: cpu | ||
target: | ||
type: Utilization | ||
averageUtilization: 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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: db | ||
spec: | ||
ports: | ||
- port: 3306 | ||
selector: | ||
app: db | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: db | ||
spec: | ||
progressDeadlineSeconds: 360 | ||
strategy: | ||
type: Recreate | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: db | ||
template: | ||
metadata: | ||
labels: | ||
app: db | ||
spec: | ||
nodeSelector: | ||
doks.digitalocean.com/node-pool: basic | ||
containers: | ||
- name: db | ||
image: mysql | ||
env: | ||
- name: MYSQL_ALLOW_EMPTY_PASSWORD | ||
value: "yes" | ||
- name: MYSQL_DATABASE | ||
value: "radar" | ||
- name: MYSQL_ROOT_PASSWORD | ||
value: "localhost" | ||
ports: | ||
- containerPort: 3306 | ||
volumeMounts: | ||
- name: radar-data | ||
mountPath: /var/lib/mysql | ||
readinessProbe: | ||
exec: | ||
command: ["mysqladmin", "ping", "-h", "localhost"] | ||
initialDelaySeconds: 5 | ||
periodSeconds: 10 | ||
volumes: | ||
- name: radar-data | ||
persistentVolumeClaim: | ||
claimName: radar-db-prod |
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,52 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: redis | ||
spec: | ||
ports: | ||
- port: 6379 | ||
selector: | ||
app: redis | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: redis | ||
spec: | ||
progressDeadlineSeconds: 60 | ||
strategy: | ||
type: Recreate | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: redis | ||
template: | ||
metadata: | ||
labels: | ||
app: redis | ||
spec: | ||
nodeSelector: | ||
doks.digitalocean.com/node-pool: basic | ||
containers: | ||
- name: redis | ||
image: redis | ||
args: ["redis-server", "/usr/local/etc/redis/redis.conf", "--requirepass", "RADAR"] | ||
ports: | ||
- containerPort: 6379 | ||
volumeMounts: | ||
- name: redis-config | ||
mountPath: /usr/local/etc/redis | ||
volumes: | ||
- name: redis-config | ||
configMap: | ||
name: redis-config | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: redis-config | ||
data: | ||
redis.conf: | | ||
client-output-buffer-limit normal 836870912 836870912 0 | ||
client-output-buffer-limit slave 836870912 836870912 0 | ||
client-output-buffer-limit pubsub 836870912 836870912 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,11 @@ | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: radar-db-prod | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 1Gi | ||
storageClassName: do-block-storage |